need a secong GDT ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
stoned
Posts: 7
Joined: Mon Mar 16, 2009 7:09 am

need a secong GDT ?

Post by stoned »

Do you ever need to reload a second GDT ? what is the reason behind ?

thank you
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: need a secong GDT ?

Post by gedd »

There only one GTD that you reload when add descriptor in it, for example when you add a process
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
User avatar
Masterkiller
Member
Member
Posts: 153
Joined: Sat May 05, 2007 6:20 pm

Re: need a secong GDT ?

Post by Masterkiller »

If your OS handle memory as segments (not paging), you will have to limit every process of the system by a segment. On process switch you will have to remap address space, so you reload LDT (if using one GDT/multiple LDT) or reload GDT (if using multiple GDT). Anyway both are bad ideas, segmentation (and thus GDT/LDT) exist only for compability, all modern system will use paging mechanism.

P.S. you can preload your GDT if plan to switch between (un)real and protected mode more times.
ALCA OS: Project temporarity suspended!
Current state: real-mode kernel-FS reader...
User avatar
kop99
Member
Member
Posts: 120
Joined: Fri May 15, 2009 2:58 am

Re: need a secong GDT ?

Post by kop99 »

if you've made a gdt table in real mode, and you need to protected mode, maybe there is the need to new gdt table that is same previous one in protected mode....
because probably the real mode gdt is located in first 640k region and you'll want to put it to more than 1MB address...
Post Reply