OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Sep 20, 2020 8:11 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: enable paging before setting up idt
PostPosted: Sun Sep 06, 2020 1:54 am 
Offline
Member
Member

Joined: Sat Aug 18, 2018 8:44 pm
Posts: 100
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!!!


Top
 Profile  
 
 Post subject: Re: enable paging before setting up idt
PostPosted: Sun Sep 06, 2020 2:04 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 20, 2011 2:01 pm
Posts: 86
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!!!

It's not compulsory, I initialize the IDT well after setting up paging.

Check that your idt_init is using virtual addresses.

_________________
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS


Top
 Profile  
 
 Post subject: Re: enable paging before setting up idt
PostPosted: Sun Sep 06, 2020 3:30 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 619
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.

_________________
Life is beautiful. Nobody said easy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group