Page 1 of 1

need a secong GDT ?

Posted: Wed May 13, 2009 3:58 am
by stoned
Do you ever need to reload a second GDT ? what is the reason behind ?

thank you

Re: need a secong GDT ?

Posted: Wed May 13, 2009 4:55 am
by gedd
There only one GTD that you reload when add descriptor in it, for example when you add a process

Re: need a secong GDT ?

Posted: Wed May 13, 2009 5:04 am
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.

Re: need a secong GDT ?

Posted: Mon May 18, 2009 6:43 pm
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...