Page 1 of 1

GRUB

Posted: Fri Dec 09, 2005 12:00 am
by Pela Kiu
How is GDT,IDT,LDT tables asigned at the moment that grub call the entry point of the kernel. Are interrupts enabled?

Re: GRUB

Posted: Fri Dec 09, 2005 12:00 am
by carbonBased
This isn't defined by the multiboot standard, that i can recall, and therefore you shouldn't rely on GRUB to put your kernel in any known format.

The first thing you should do is setup your own GDT, IDT and (if required) LDT.

That being said, if I recall correctly, when I was writting my kernel entry code, GRUB put the system into a state with a GDT with two entries... one code, one data, each the full 4GB range. No LDT, and interrupts disabled (therefore probably no IDT either).

--Jeff

Re: GRUB

Posted: Fri Dec 09, 2005 12:00 am
by rexlunae
carbonBased wrote:This isn't defined by the multiboot standard, that i can recall, and therefore you shouldn't rely on GRUB to put your kernel in any known format.
The multiboot standard specifies that you need to set up your own GDT and IDT, but it does specify that the interrupts are disabled, and it says that the os must define an IDT before enabling them. Enterring protected mode without an IDT defined and with interrupts enabled would risk a tripple-fault.

My info comes from <a href="http://www.gnu.org/software/grub/manual/multiboot/">this</a> document.