what to do after kernel is in memory
Posted: Thu Oct 24, 2013 6:00 pm
Hello,
I have written a simple bootloader and kernel (very basic!). The MBR code loads sectors and jumps to it. The freshly loaded code sets up a temporary 32 bit GDT and jumps to 32 bit Protected Mode without paging. Then it creates the final 64 bit GDT, the final 64 bit IDT and the paging tables PML4, PDPT, PDT and PT, before jumping to 64 bit Long Mode. As soon as it is in 64 bit Long Mode I switch from Assembly to C code with void kmain(uint64_t gdtptr, uint64_t idtptr, uint64_t pml4ptr) as first function. I have written some basic functions like managing the GDT, the IDT, the paging tables and the VESA screen. And here is my question: What should I do next? How do I communicate with the hard disk, the network interface or the keyboard? How do I read the rest of my OS into memory?
I have written a simple bootloader and kernel (very basic!). The MBR code loads sectors and jumps to it. The freshly loaded code sets up a temporary 32 bit GDT and jumps to 32 bit Protected Mode without paging. Then it creates the final 64 bit GDT, the final 64 bit IDT and the paging tables PML4, PDPT, PDT and PT, before jumping to 64 bit Long Mode. As soon as it is in 64 bit Long Mode I switch from Assembly to C code with void kmain(uint64_t gdtptr, uint64_t idtptr, uint64_t pml4ptr) as first function. I have written some basic functions like managing the GDT, the IDT, the paging tables and the VESA screen. And here is my question: What should I do next? How do I communicate with the hard disk, the network interface or the keyboard? How do I read the rest of my OS into memory?