Page 1 of 2
How can i load the IDT?
Posted: Mon Jan 02, 2017 6:50 am
by NunoLava1998
I want to load the IDT. However, i can't find a page with steps on how to do it, and i can't find what order to do it in.
How can i load the Interrupt Descriptor Table?
github at https://github.com/NunoLava1998/DixiumOS
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 6:56 am
by iansjack
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 6:57 am
by NunoLava1998
iansjack wrote:http://wiki.osdev.org/IDT
I'm pretty sure i've read that a million times (and there is no text that shows how to do things). Not trying to offend.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:02 am
by Octacone
You load it with "lidt" instruction. If that was your question.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:04 am
by NunoLava1998
octacone wrote:You load it with "lidt" instruction. If that was your question.
I meant something else. I know you have to load it with lidt.
I'm using C by the way. I'll use C++ when needed.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:05 am
by glauxosdever
Hi,
Since you are starting over, you should already know how to implement the features you implemented previously. Didn't you load the IDT previously? If so, why are you asking again the same question?
It's true that over time the community gets more experience as a whole, but:
Also, the wiki should describe it clearly enough. If you however have issues understanding the wiki, you can try to ask.
Edit: Also, would you please remove the image from your signature (or at least replace it with a much smaller one)?
Regards,
glauxosdever
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:07 am
by alexfru
NunoLava1998 wrote:I meant something else.
Then be constructive and tell us what it is that you don't understand or are doing (show your code) which isn't working. We have limited mind reading.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:13 am
by NunoLava1998
glauxosdever wrote:Hi,
Since you are starting over, you should already know how to implement the features you implemented previously. Didn't you load the IDT previously? If so, why are you asking again the same question?
It's true that over time the community gets more experience as a whole, but:
Also, the wiki should describe it clearly enough. If you however have issues understanding the wiki, you can try to ask.
Edit: Also, would you please remove the image from your signature (or at least replace it with a much smaller one)?
Regards,
glauxosdever
I didn't really load it, just that QEMU probably was too nice and loaded it for me. And even then, it didn't work. I'm making everything (except the IDT, of course) with a pinch of salt now.
To anyone asking to remove the image:
okay
To anyone asking what i mean:
I mean about what to do when loading the IDT in a lot of detail, like what order to do functions, what to do, etc., the IDT page does not offer much information (and is confusing).
I am not asking for code.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:13 am
by iansjack
NunoLava1998 wrote:iansjack wrote:http://wiki.osdev.org/IDT
I'm pretty sure i've read that a million times (and there is no text that shows how to do things). Not trying to offend.
It describes the whole process of creating the IDT and loading it. What part don't you understand?
Or are you, perhaps, telling us that you don't understand the interrupt mechanism and how to write an interrupt handler?
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:16 am
by NunoLava1998
iansjack wrote:NunoLava1998 wrote:iansjack wrote:http://wiki.osdev.org/IDT
I'm pretty sure i've read that a million times (and there is no text that shows how to do things). Not trying to offend.
It describes the whole process of creating the IDT and loading it. What part don't you understand?
Or are you, perhaps, telling us that you don't understand the interrupt mechanism and how to write an interrupt handler?
Uhh, not the latter part.
I don't understand a lot how the loading IDT process is like, etc.
I just need a (lot) more detail, which order to make, what to do.
I am
not asking for code, by the way.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:22 am
by alexfru
If you know how interrupts work and you know that the IDT must be prepared and IDTR must be loaded with LIDT prior to using interrupts, what's left that you don't understand? Do you understand how GDT, GDTR and LGDT work? This is very similar. Selectors, offsets, segment/gate types, privilege levels, etc.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:24 am
by iansjack
OK. So you know how to write an interrupt handler. The wiki page tells you the format of the descriptors in the IDT and how to tell the processor where the table is located.
So what don't you understand?
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:32 am
by glauxosdever
Hi,
If you don't understand something on the wiki, I'll try to rephrase it so it is more clear.
Regards,
glauxosdever
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:49 am
by NunoLava1998
iansjack wrote:OK. So you know how to write an interrupt handler. The wiki page tells you the format of the descriptors in the IDT and how to tell the processor where the table is located.
So what don't you understand?
how to actually load the IDT (what do i need to prepare, what do i put in the lidt instruction, etc.)
alexfru wrote:If you know how interrupts work and you know that the IDT must be prepared and IDTR must be loaded with LIDT prior to using interrupts, what's left that you don't understand? Do you understand how GDT, GDTR and LGDT work? This is very similar. Selectors, offsets, segment/gate types, privilege levels, etc.
I don't understand the GDT too, however GRUB already loads this.
glauxosdever wrote:Hi,
If you don't understand something on the wiki, I'll try to rephrase it so it is more clear.
Regards,
glauxosdever
Okay. The IDT page doesn't offer much, so you can try to add more information.
Re: How can i load the IDT?
Posted: Mon Jan 02, 2017 7:55 am
by alexfru
NunoLava1998 wrote:iansjack wrote:OK. So you know how to write an interrupt handler. The wiki page tells you the format of the descriptors in the IDT and how to tell the processor where the table is located.
So what don't you understand?
how to actually load the IDT (what do i need to prepare, what do i put in the lidt instruction, etc.)
Perhaps, you should follow your own advice?:
NunoLava1998 wrote:
Read a bit more of your books and the wiki and you should be able to get it working.
Have you downloaded the CPU manual and located the descriptions of GDT, GDTR, LGDT? Ditto for IDT, IDTR, LIDT?