GRUB and 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
rhughes
Posts: 16
Joined: Thu Apr 22, 2010 7:01 am

GRUB and GDT

Post by rhughes »

Hello

I am assuming that as GRUB boots you into protected mode, it has already setup a basic GDT.

Would this GDT suffice for most needs, or would I need to set another one? I can't seem to find the answer by reading the GRUB manual.

Thanks,

Richard Hughes
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: GRUB and GDT

Post by Combuster »

I don't know about your reading skills but:
All other processor registers and flag bits are undefined. This includes, in particular

(...)

‘GDTR’
Even though the segment registers are set up as described above, the ‘GDTR’
may be invalid, so the OS image must not load any segment registers (even just
reloading the same values!) until it sets up its own ‘GDT’
.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
rhughes
Posts: 16
Joined: Thu Apr 22, 2010 7:01 am

Re: GRUB and GDT

Post by rhughes »

Thanks :)
Post Reply