The HyperNews Linux KHG Discussion Pages

Question: calling interupts from linux

Forum: The Linux Kernel Hackers' Guide
Keywords: interrupts callable from C.
Date: Thu, 18 Sep 1997 14:55:46 GMT
From: John J. Binder <>

I'm trying to figure out how to run irq 0x10 from gcc so as to interact with the video card directly. I believe it will have to be done with inline assembler.

 The general question is "How do you make interupts work from gcc.

To say get the video mode (coded for with 0x0f in register ah when irq 0x10 is called) I tried a fragment like:

int ans;
__asm__ __volatile__ (
	"movb $0x0F,%%ah\n\t" \
	"int $0x10\n\t" \
	"movl %%eax,ans\n\t" \
	:"=memory" (ans) \

printf( "ans='%d'\n",(int) ans);


But it gives a segmentation fault.

Permissions? ioperm?? whats the answer?

Thanks John


1. Sad: You can't by Michael K. Johnson newest