Originally Posted by archanac07
anisha, as you say i'll start with keyboard interrupt handler.
if you have any reference material plz share with me. it'll helpful.
Here s a simple keyboard interrupt handler
, I wrote few months back !
After u have inserted this module, if you press Esc
key, U'll get something printed which u can see with dmesg
This function services keyboard interrupts.
irq_handler_t irq_handler (int irq, void *dev_id, struct pt_regs *regs)
static unsigned char scancode;
Read keyboard status
scancode = inb (0x60);
if ((scancode == 0x01) || (scancode == 0x81))
printk ("\nYou pressed Esc !");
return (irq_handler_t) IRQ_HANDLED;
Initialize the module − register the IRQ handler
int init_module ()
Request IRQ 1, the keyboard IRQ, to go to our irq_handler SA_SHIRQ means we're willing to have othe handlers on this IRQ. SA_INTERRUPT can be used to make the handler into a fast interrupt.
return request_irq (1, (irq_handler_t) irq_handler, SA_SHIRQ, "test_keyboard_irq_handler", (void *)(irq_handler));
obj-m += keyboardInterruptHandler.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
I hope it helps u to get started
Though it looks simple, I had to take great pains writing it