一个想法的副产物,,,
参考
http://stackoverflow.com/questions/2497919/changing-the-interrupt-descriptor-table
不多说 就上代码算了。。。
Centos 5.5 编译测试通过
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/desc.h>
typedef struct desc_struct gate_desc;
struct desc_easy {
unsigned short a;
unsigned short b;
unsigned short c;
unsigned short d;
} __attribute__((packed)) ;
struct desc_ptr {
unsigned short size;
unsigned long address;
} __attribute__((packed)) ;
#define PGFAULT_INT 0x0E
static unsigned long isr_orig;
static unsigned long isr_new;
static gate_desc *PF_gate;
asmlinkage void my_function(void);
void stub(void)
{
__asm__
(
" pushal \n"
" pushl %es \n"
" pushl