toadragethe5th / GUINIX

Hobby Operating system
1 stars 1 forks source link

Halting your kernel #5

Open alexydens opened 1 month ago

alexydens commented 1 month ago

I have noticed that you use a loop to halt your kernel. This is usually fine, but in the case of an interrupt it can fail. An option instead then is to first clear interrupts with the cli instruction, and then halt with the hlt instruction. I would also suggest writing the kernel in C. This may require investing in a cross compiler, but it is usually beneficial to jump from boot.S to a kernel entry point. As well as this, I would suggest that you reconfigure the GDT, as the one provided by a multiboot-compatible bootloader is not guaranteed to be effective. You can do this in assembly before the main kernel, or in C using packed structs. Just note that you may need a far jump to get into the correct logical address space. That being said, many people identity map the segments and opt for a higher-half kernel through the use of the virtual address space by using paging. To implement paging, consider the advice of such resources as wikipedia, the osdev wiki and the intel developers manual for IA-32 and IA-64 machines, depending on whether you plan to support long mode.

toadragethe5th commented 1 month ago

This is very much in an early stage. I haven't worked on developing this for like a month.