增加系统调用

1、修改sys.c

      命令:sudo   gedit   /usr/src/linux-2.6.38.8/kernel/sys.c

      添加如下内容:

#include <linux/gt_fs.h>

asmlinkage long sys_rt_read(unsigned int ipointnr, __64 time, struct data_package_info *dpi)

{

      return my_sys_rt_read(ipointnr, time, dpi);

}

asmlinkage long sys_rt_write(unsigned int ipointnr, struct data_package_info *dpi, unsigned int cout)

{

      return my_sys_rt_write(ipointnr, dpi, count);

}

asmlinkage long sys_rt_info(struct rt_info m_info)

{

      return my_sys_rt_info(m_info);

}

2、增加系统调用号:

      命令:sudo gedit /usr/src/linux-2.6.38.8/arch/x86/include/asm/unistd_32.h

      添加如下内容:

#define __NR_rt_read               342

#define __NR_rt_write               343

#define __NR_rt_info                 344

#define NR_syscalls   344

3、增加系统调用

      命令:sudo gedit /usr/src/linux-2.6.38.8/arch/x86/kernel/syscall_table_32.S

      添加如下内容:

.long sys_rt_read               /* 342 */

.long sys_rt_write              /* 343 */

.long sys_rt_info               /* 344 */

4、编译内核

      。。。。。。

      (见“linux编译内核”一章)

你可能感兴趣的:(linux,struct,table)