#include "printf.h" #include "palloc.h" #include "gdt.h" #include "idt.h" #include "irq.h" #include "multiboot.h" void main() { printf("main()\n"); palloc_init(); printf("Page allocator initiated.\n"); gdt_init(); printf("GDT set.\n"); idt_init(); printf("IDT set.\n"); irq_init(); printf("IRQs set.\n"); printf("Multiboot flags: %08x\n", multiboot_info.flags); for(unsigned int i = 0; i < multiboot_info.mods_count; i++) { printf("Module %u: %08x %08x %s\n", i, multiboot_info.mods_addr[0].mod_start, multiboot_info.mods_addr[0].mod_end, multiboot_info.mods_addr[0].string); } asm volatile("sti"); asm volatile( "push $0x23\n" "push $entry_stack_top\n" "pushf\n" "push $0x1b\n" "push %0\n" "iret\n" :: "r" (multiboot_info.mods_addr[0].mod_start) ); printf("Halting.\n"); asm volatile( "cli\n" "hlt\n" ); while(1); }