Hey-
I was reading about interrupts, and I got to thinking it would be a real
neat thing to use interrupts for program-wide exception handling. What I
haven't been able to find is a clear guide or example program for how to
install a C function into the IDT. And what happens about passing arguments?
I'd like to have something like this:
void malloc_failure( );
Say I install this as interrupt slot 42, then I can do:
if(!(p=(int*)ma lloc(1000*4))) // array of 1000 ints
__asm__ ("int $0x42");
Is there any reason for this not to work? How do I set up the
interrupts? Would I need root privelidges to do that?
Thanks!!
I was reading about interrupts, and I got to thinking it would be a real
neat thing to use interrupts for program-wide exception handling. What I
haven't been able to find is a clear guide or example program for how to
install a C function into the IDT. And what happens about passing arguments?
I'd like to have something like this:
void malloc_failure( );
Say I install this as interrupt slot 42, then I can do:
if(!(p=(int*)ma lloc(1000*4))) // array of 1000 ints
__asm__ ("int $0x42");
Is there any reason for this not to work? How do I set up the
interrupts? Would I need root privelidges to do that?
Thanks!!
Comment