其中irq9是50Hz方波接入isa总线的irq9引脚,方波控制端口是0x136,程序使用gcc -o test test.c编译,无法通过,请大虾指点: #include <stdio.h> #include <asm/io.h> #include <linux/sched.h>
void interrupt_handler()
{ printf("interrupt
"); }
int main() { int result; iopl(3); result = request_irq(9,interrupt_handler,SA_INTERRUPT,"test",NULL); printf("%d
",result); outb(1,0x136);//irq9引脚打开50Hz方波 irq_enable(9); usleep(5000000); outb(0,0x136); free_irq(9,NULL);
return 0; }
|