Page 1 of 1
GDT advice
Posted: Sat Aug 23, 2008 4:22 am
by System123
I have finally got my OS to boot without any triple faults. Now I was just wondering, does the GDT have to be set up before the Protected mode Jump? and would you recommend setting it up in assembler code or Pascal code??
Re: GDT advice
Posted: Sat Aug 23, 2008 4:25 am
by JackScott
Even if it doesn't theoretically have to (not sure about this) it's definitely a good idea to have one set up. You can build the table in either assembly or Pascal, doesn't matter. But the LGDT instruction will have to be done in assembly, obviously.
Re: GDT advice
Posted: Sat Aug 23, 2008 5:41 am
by ru2aqare
System123 wrote:I have finally got my OS to boot without any triple faults. Now I was just wondering, does the GDT have to be set up before the Protected mode Jump? and would you recommend setting it up in assembler code or Pascal code??
It has to be set up before you reload any of the segment registers in protected mode. If by "protected mode jump" you mean the usual "jmp 0x08:12345678" instruction, then yes, it has to be set up before that.
Re: GDT advice
Posted: Sun Aug 24, 2008 4:01 am
by System123
Thanks.. I have it set up an running now.