Page 1 of 1

ISR's in Pmode

Posted: Wed Jan 23, 2002 7:55 pm
by Bart Grantham
So I'm trying to write an ISR that will run in Pmode.  I'm doing this in C, with the requisite asm wrapper.  I believe that my ASM wrapper and C code are ok because I can switch the iret to a ret and it works exactly as I expect (reads keycode from 0x60 and displays to screen).  So with all that in place...

How do I register this interrupt?  I know how to unmask the IRQ, but where do I put the pointer to my function?  I've read Craig Peacock's tutorial/intro [ http://www.nondot.org/sabre/os/files/Mi ... terupt.pdf ] and it seems very clear, but I think that it was written with real mode in mind and things seem very different in protected mode.

So obviously it's not as simple as writing &my_keyboard_isr to memory location 9 * 32.  How is it done?

Re: ISR's in Pmode

Posted: Wed Jan 23, 2002 9:10 pm
by Bart Grantham
Ah!  I found a page that somewhat discusses my problem.  A quote:

"Unlike in real mode, where the interrupt vector table is always at address 00000h, in protected mode, the Interrupt Descriptor Table can be anywhere in memory and is protected by the processor and the OS. Also unlike the real-mode interrupt vector table, the IDT stores additional information about the various handlers, but it is essentially still a "jump table" indexed on the interrupt number."
[ http://courses.ece.uiuc.edu/ece291/book ... rupts.html ]

Well, I think I can figure it out from here by checking the Multiboot Spec (I am using GRUB).  If any of the guru's want to follow up, I'd appreciate the sanity check and I'm sure others would find it helpful.