Zig Bare Bones: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
[unchecked revision][unchecked revision]
No edit summary
mNo edit summary
Line 131:
<source lang="c">
const fmt = @import("std").fmt;
const mem = @import("std").mem;
const Writer = @import("std").io.Writer;
 
Line 160 ⟶ 159:
var column: usize = 0;
var color = vgaEntryColor(ConsoleColors.LightGray, ConsoleColors.Black);
var buffer = @intToPtras([*]volatile u16, @ptrFromInt(0xB8000));
 
fn vgaEntryColor(fg: ConsoleColors, bg: ConsoleColors) u8 {
Line 181 ⟶ 180:
 
pub fn clear() void {
mem.set@memset(u16, buffer[0..VGA_SIZE], vgaEntry(' ', color));
}
 
Line 224 ⟶ 223:
. = 1M;
*(.multiboot) {
KEEP(*(.multiboot))
}
 
.text : ALIGN(4K) {
*(.multiboot)
*(.text)
}
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu