#define MODULE
int i;
void intr_handler(void) {
outb_p(0x01, LPT);
}
int init_module(void) {
// 5 Volts for irq through a pull up resistor.
// Install interrupt handler
// irq7 setup: set the mask and read pending irq
return 0;
}
void cleanup_module(void) {
// Disable irq7
}
//
// rt_irq.c
//
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <asm/io.h>
#include <asm/rt_irq.h>
#define LPT 0x378
#define LPTS 0x379
#define LPTC 0x37A
// Any width for the response.
for(i=0;i<10000;i++);
outb_p(0x03, LPT);
outb_p(inb_p(LPT)|0x01,LPT);
request_RTirq(7, intr_handler);
outb_p(inb_p(0x21)&(~0x80),0x21);
outb_p(0x20,0x20);
// Enable irq7
outb_p(inb_p(LPTC)|0x10,LPTC);
outb_p(inb_p(LPTC)&(~0x10),LPTC);
// Uninstall interrupt handler
free_RTirq(7);