OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 4:28 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: 127
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: 110
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: 1604
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!


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: Bing [Bot] and 160 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