Is idt set up mandatory before enable paging?
I am playing with the OS tutorial... I move the idt_init after paging and keep getting weird crashes...
someone help!!!
enable paging before setting up idt
- bellezzasolo
- Member
- Posts: 110
- Joined: Sun Feb 20, 2011 2:01 pm
Re: enable paging before setting up idt
It's not compulsory, I initialize the IDT well after setting up paging.ITchimp wrote:Is idt set up mandatory before enable paging?
I am playing with the OS tutorial... I move the idt_init after paging and keep getting weird crashes...
someone help!!!
Check that your idt_init is using virtual addresses.
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
https://github.com/ChaiSoft/ChaiOS
Re: enable paging before setting up idt
While you are creating your paging implementation, you may want to add a temporary "early IDT". The routines would have to operate while paging is not available, and mostly just panic, but do so in an orderly fashion (unlike when you don't do this, maybe even load a zero-length IDT, and if something goes wrong the machine will tripple-fault). But yes, the main IDT has to be loaded after enabling paging. Both the IDT base address and the addresses of the routines contained therein are linear addresses, and thus will be considered virtual addresses once CR0.PG is enabled. Same for GDT, by the way. The GDT you load for switching to protected mode is only temporary, and the final version can only be loaded after you enable paging.
Carpe diem!