const debug = @import("debugcon.zig"); const ALIGN = 1 << 0; const MEMINFO = 1 << 1; const MAGIC = 0xE85250D6; // const FLAGS = ALIGN | MEMINFO; const FLAGS = 0; const MultibootHeader = extern struct { magic: u32, flags: u32, len: u32, checksum: u32, tag0: u16, tag1: u16, tag2: u32, }; export const multiboot2 align(4) linksection(".multiboot") = MultibootHeader{ .magic = MAGIC, .flags = FLAGS, .len = 24, .checksum = 0x100000000 - (MAGIC + FLAGS + 24), .tag0 = 0, .tag1 = 0, .tag2 = 8, }; export fn _start() callconv(.Naked) noreturn { asm volatile ( \\ mov _sstack, %rsp \\ mov %rsp, %rbp ); asm volatile ("jmp kmain"); } var vga = @as([*]volatile u16, @ptrFromInt(0xB8000)); export fn kmain() noreturn { //print OK vga[0] = 0x2f4f; vga[1] = 0x2f4b; // write debug data debug.outb(0xe9, 'H'); debug.outb(0xe9, 'i'); debug.outb(0xe9, '!'); debug.outb(0xe9, '\n'); while (true) {} }