Ints

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.
Post Reply
VoidLogic

Ints

Post by VoidLogic »

Mode: Real Mode
Lang: C++\C,ASM when needed
Comp: Borland C++ 5.02
-------------------------------------------------------------------------------
Ok, Hey plp
So int 0X1C is the clock tick int, does that mean that ints code is ran after every clock tick? yes I think....
If I wanted to make a int for everytime a key was pressed or the mouse was clicked how would I do this? This int would place the input data in queues located in the kernel.

-VoidLogic
carbonBased

RE:Ints

Post by carbonBased »

The Timer (IRQ 0 -> can be directed to any interrupt through the PIC) can be programmed to call an interrupt based on a number of different circumstances (check up some docs on the 8253 Programmable Interval Timer, ie the PIT).

As for the keyboard, that's IRQ 1, which is called every time a key is pressed (and/or released, depending on how you've setup the keyboard controller; see keyboard controller docs).  Inside your keyboard ISR, you can do whatever you want, but must read from port 0x60, otherwise the keyboard controller deems the current key as still active/not processed, and will not process any other keypresses).

The mouse is an entirely different story, and varries from brand you brand.  Again, just search for some docs on the mouse brand you wish to support.

For all these documents, I would suggest the OSDev resource center, at http://www.nondot.org/sabre/os/articles.  Otherwise, search on google for some more documentation (all this information is readily available, you just have to put some effort into it and _search_ for it ;))  I would also recommend checking out the source code for some working OSs in the starting phazes.  Most implement at least the few above devices that you're looking for.

Cheers,
Jeff
Post Reply