Can anyone explain the IDT?
Posted: Wed Oct 08, 2003 7:04 pm
Hi everybody! ;D
I'm working on an OS project with a friend. At this point we need to implement new interrupt handlers. It seems that these are stored in the IDT. Can somone explain:
1. Where (in memory) are the IDT located?
2. What is the relation between interrupts (INT's) and IRQ's?
3. What is an interrupt gate, and does it some way relate to I/O ports?
4. I've found some code examples that look like this:
outb(0x20, 0x11); /* Start init of controller 0, require 4 bytes */
outb(0x21, IRQ_START); /* IRQ 0-7 use vectors 0x20-0x27 (32-39) */
outb(0x21, 0x04); /* Slave controller on IRQ 2 */
outb(0x21, 0x01); /* Normal EOI nonbuffered, 80x86 mode */
outb(0x21, 0xfb); /* Disable int 0-7, enable int 2 */
The people I hope to receive answers from, do definitely know what this code does. Unfortunately I dont, although I know that what this code does, is to initialise the first PIC on a Pentium machine. I also know that the first operand in these instructions (20 and 21) are addresses of some kind (I/O port addresses?) that points to the PIC0, and that the corresp. addresses to PIC1 are a0/a1. What I would like to know, however, is WHY these addresses, what is on address 10 or 6f for instance?
Is there possibly some good reference on this somewhere on the web?
I have downloaded the 3 volumes of Intel's reference guide, they are very exhaustive, I have still not found an answer to these questions. ???
I'd love some help
Greetings,
Marius :-*
I'm working on an OS project with a friend. At this point we need to implement new interrupt handlers. It seems that these are stored in the IDT. Can somone explain:
1. Where (in memory) are the IDT located?
2. What is the relation between interrupts (INT's) and IRQ's?
3. What is an interrupt gate, and does it some way relate to I/O ports?
4. I've found some code examples that look like this:
outb(0x20, 0x11); /* Start init of controller 0, require 4 bytes */
outb(0x21, IRQ_START); /* IRQ 0-7 use vectors 0x20-0x27 (32-39) */
outb(0x21, 0x04); /* Slave controller on IRQ 2 */
outb(0x21, 0x01); /* Normal EOI nonbuffered, 80x86 mode */
outb(0x21, 0xfb); /* Disable int 0-7, enable int 2 */
The people I hope to receive answers from, do definitely know what this code does. Unfortunately I dont, although I know that what this code does, is to initialise the first PIC on a Pentium machine. I also know that the first operand in these instructions (20 and 21) are addresses of some kind (I/O port addresses?) that points to the PIC0, and that the corresp. addresses to PIC1 are a0/a1. What I would like to know, however, is WHY these addresses, what is on address 10 or 6f for instance?
Is there possibly some good reference on this somewhere on the web?
I have downloaded the 3 volumes of Intel's reference guide, they are very exhaustive, I have still not found an answer to these questions. ???
I'd love some help
Greetings,
Marius :-*