Add a system call on Ubuntu 13.04(x64) with x86_64

We added a system call to modify idt table, then programed it in modify_idt.c

1. Put our modify_idt.c file in /usr/src/linux-3.10.15/arch/x86/kernel

2. /usr/src/linux-3.10.15/arch/x86/syscalls# vim syscall_64.tbl

 add a new line

314     64      modify_idt              sys_modify_idt

3. Add the prototype of our system call in

/usr/src/linux-3.10.15/include/linux/syscalls.h

asmlinkage long sys_modify_idt(int i);

4. Add the file to the Makefile in /usr/src/linux-3.10.15/arch/x86/kernel/Makefile by

adding modify_idt.o to the list in obj-y += ...

obj-y                   := process_$(BITS).o signal.o entry_$(BITS).o
obj-y                   += traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o

obj-y                   += modify_idt.o    // adding this one

5. Do not forget to recompile & reload the kernel before testing!

转载于:https://www.cnblogs.com/bittorrent/p/3744028.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值