IDT's and GDT's

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
[email protected]

IDT's and GDT's

Post by [email protected] »

I've been making a test kernel. Basically just
something to more or less play around with to learn
more about the PC and how it operates. Anyway,
When I define an IDT and I, then, enable interrupts,
the computer seems to triple fault. Another question
that I have is this...if you are in the bootloader and
you load a GDT, do you also have to reload this in
your kernel? If so, why? And if you have two differing
GDT's (kernel and bootloaders GDTs are different), can
this potentially make it to where when I create my IDT,
I have problems? Any help would be really appreciated.
Guest

RE:IDT's and GDT's

Post by Guest »

>On 2001-07-29 22:33:52, [email protected] wrote:
>I've been making a test kernel. Basically just
>something to more or less play around with to learn
>more about the PC and how it operates. Anyway,
>When I define an IDT and I, then, enable interrupts,
>the computer seems to triple fault. Another question
>that I have is this...if you are in the bootloader and
>you load a GDT, do you also have to reload this in
>your kernel? If so, why? And if you have two differing
>GDT's (kernel and bootloaders GDTs are different), can
>this potentially make it to where when I create my IDT,
>I have problems? Any help would be really appreciated.
Guest

RE:IDT's and GDT's

Post by Guest »

>On 2001-07-29 22:38:40, Anonymous wrote:
>>On 2001-07-29 22:33:52, [email protected] wrote:
>>I've been making a test kernel. Basically just
>>something to more or less play around with to learn
>>more about the PC and how it operates. Anyway,
>>When I define an IDT and I, then, enable interrupts,
>>the computer seems to triple fault.

Did you set up handlers(gates) in your IDT for the interrupts ??
Did you issue LIDT before STI ?
If you didn't and did not mask them,you will get tripple fault!
But In many cases the problem comes from setting wrong values
in the IDT ?

email: [email protected]









Another question
>>that I have is this...if you are in the bootloader and
>>you load a GDT, do you also have to reload this in
>>your kernel? If so, why? And if you have two differing
>>GDT's (kernel and bootloaders GDTs are different), can
>>this potentially make it to where when I create my IDT,
>>I have problems? Any help would be really appreciated.
Guest

RE:IDT's and GDT's

Post by Guest »

>On 2001-07-29 22:59:08, Anonymous wrote:
>>On 2001-07-29 22:38:40, Anonymous wrote:
>>>On 2001-07-29 22:33:52, [email protected] wrote:
>>>I've been making a test kernel. Basically just
>>>something to more or less play around with to learn
>>>more about the PC and how it operates. Anyway,
>>>When I define an IDT and I, then, enable interrupts,
>>>the computer seems to triple fault.
>
>Did you set up handlers(gates) in your IDT for the interrupts ??
>Did you issue LIDT before STI ?
>If you didn't and did not mask them,you will get tripple fault!
>But In many cases the problem comes from setting wrong values
>in the IDT ?
>
>email: [email protected]
>
Yes, I issued LIDT and created a table, but it's quite possible
that my values are screwy. The format of the IDT is

<16-bit offset of handler (low)>:<16-bit selector>:<16-bit "permissions" control (such as 8E, etc.)>:<16-bit offset of handler (high)>

Is this correct? Would anyone happen to know where I might see some
quick code that would just simply create an LDT, enough for me to do sti?
Nothing fancy ...just something simple? I really think something
in my LDT is wrong, personally.
>
>
>
>
>
>
>
>
> Another question
>>>that I have is this...if you are in the bootloader and
>>>you load a GDT, do you also have to reload this in
>>>your kernel? If so, why? And if you have two differing
>>>GDT's (kernel and bootloaders GDTs are different), can
>>>this potentially make it to where when I create my IDT,
>>>I have problems? Any help would be really appreciated.
Post Reply