I just started writing my own os. I have i small bootloader which kicks me into pmode and starts my kenrnel. I too have a simple printf() function. But how do i make a scanf() function? I know that i cant use bios functions in pmode.
Is there anything i have to todo beside setting up the IDT (IDTR, etc)?
Which interrupts are taken?
... and which interrupt is triggered when a key is pressed?
thanks
Interrupts in pmode
Re:Interrupts in pmode
To accept user input you will need to write a driver for the keyboard. To do that you'll need to install a handler for IRQ 1, which will mean setting up an IDT and remapping the hardware interrupts via the PIC so that they don't clash with Intel's reserved interrupts.
Re:Interrupts in pmode
So I just have to map interrupt 9 (IRQ01) to my own keyboard driver?
Which one are this?
Can i/(Do i have to) use Interrupt 9 for keyboard?
What do you mean by this? Are there some reserved interrupts which i cant use?... so that they don't clash with Intel's reserved interrupts.
Which one are this?
Can i/(Do i have to) use Interrupt 9 for keyboard?
Re:Interrupts in pmode
Intel reserved interrupts 0 to 15 for its own use, for CPU exceptions, etc. However, when they designed the original PC BIOS, IBM put BIOS functions and hardware interrupt handlers on a lot of those interrupt numbers. A protected mode OS must be prepared to handle any of the first 16 exceptions, so you must program the PIC to move the IRQ handlers out of the way. This should be dealt with in any interrupt tutorial.