How can i load the IDT?

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.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

How can i load the IDT?

Post 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
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How can i load the IDT?

Post by iansjack »

NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: How can i load the IDT?

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: How can i load the IDT?

Post by Octacone »

You load it with "lidt" instruction. If that was your question.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: How can i load the IDT?

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: How can i load the IDT?

Post 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
Last edited by glauxosdever on Mon Jan 02, 2017 7:07 am, edited 1 time in total.
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: How can i load the IDT?

Post 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.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: How can i load the IDT?

Post 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.
Last edited by NunoLava1998 on Mon Jan 02, 2017 7:14 am, edited 1 time in total.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How can i load the IDT?

Post 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?
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: How can i load the IDT?

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: How can i load the IDT?

Post 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.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How can i load the IDT?

Post 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?
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: How can i load the IDT?

Post 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
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

Re: How can i load the IDT?

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: How can i load the IDT?

Post 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?
Post Reply