首页 > 代码库 > Add a system call on Ubuntu 13.04(x64) with x86_64
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
?
1 | 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
?
1 | 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 += ...
?
1 2 3 4 | 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!
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。