码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-05-22 15:51:03      阅读:269      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   c   code   color   

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!

Add a system call on Ubuntu 13.04(x64) with x86_64,布布扣,bubuko.com

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

标签:style   blog   class   c   code   color   

原文地址:http://www.cnblogs.com/bittorrent/p/3744028.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!