3.8.X Linux内核调用新架构
来源:互联网 发布:sql查询分析器建立 编辑:程序博客网 时间:2024/06/06 13:17
与2.6.X内核版本相比,3.8.x内核的系统调用表有着很大的区别。从结构上来说:2.6.X内核版本调用号与调用表的分离定义(调用号定义文件:
/arch/x86/include/asm/unistd.h,系统调用表:arch/i386/kernel/entry.S ),当开发者对内核添加自己的系统调用时,需要分别修改这两个文件,指定系统调用号和对应的系统调用表。
调用号结构如下:
/*
* This file contains the system call numbers.
*/
#define __NR_restart_syscall 0
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3
#define __NR_write 4
#define __NR_open 5
#define __NR_close 6
#define __NR_waitpid 7
#define __NR_creat 8
#define __NR_link 9
#define __NR_unlink 10
#define __NR_execve 11
#define __NR_chdir 12
调用表格式如下:
ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_ni_syscall)
……
.long SYMBOL_NAME(sys_ni_syscall)
.rept NR_syscalls-(.-sys_call_table)/4
.long SYMBOL_NAME(sys_ni_syscall)
.endr
转到3.8.x中调用表格式使用新的结构(\arch\x86\syscalls\syscall_32.tbl):如下
# 32-bit system call numbers and entry vectors
#
# The format is:
# <number> <abi> <name> <entry point> <compat entry point>
#
# The abi is always "i386" for this file.
#
0 i386 restart_syscall sys_restart_syscall
1 i386 exit sys_exit
2 i386 fork sys_fork stub32_fork
3 i386 read sys_read
4 i386 write sys_write
5 i386 open sys_open compat_sys_open
6 i386 close sys_close
7 i386 waitpid sys_waitpid sys32_waitpid
8 i386 creat sys_creat
#
# The format is:
# <number> <abi> <name> <entry point> <compat entry point>
#
# The abi is always "i386" for this file.
#
0 i386 restart_syscall sys_restart_syscall
1 i386 exit sys_exit
2 i386 fork sys_fork stub32_fork
3 i386 read sys_read
4 i386 write sys_write
5 i386 open sys_open compat_sys_open
6 i386 close sys_close
7 i386 waitpid sys_waitpid sys32_waitpid
8 i386 creat sys_creat
………………
3.8.x中 系统调用号与系统调用表放置在同一个文件syscall_32.tbl中,更容易维护添加和使用!
- 3.8.X Linux内核调用新架构
- 添加新的Linux内核系统调用
- 向linux内核添加系统调用新老内核比较
- 向linux内核中添加新的系统调用
- 为arm linux内核添加新的系统调用
- 在linux 4.x内核中增加系统调用
- linux内核4.2.x实现自定义系统调用
- linux内核4.2.x实现自定义系统调用
- linux编译新内核
- Linux内核体系架构
- Linux内核架构概述
- linux内核架构
- Linux内核体系架构
- Linux内核架构: workqueue
- Linux内核架构演化
- Linux内核整体架构
- linux time新架构
- Linux内核-系统调用
- 条形码处理类库 ZXing
- 销售人员如何抓住客户?
- 关于lua table的实现
- Java基础复习:Set接口
- 给51 DIY超轻量级多任务操作系统
- 3.8.X Linux内核调用新架构
- ubuntu 13.04-eclipse-python-MySQLdb
- 程序人
- C#学习零散笔记
- 黑马程序员——骑士飞行棋C#代码
- request.getHeader("Referer")理解
- 画笔 Draw()函数
- 技术普及帖:你刚才在淘宝上买了一件东西
- 黑马程序员 java中的函数重载和函数重写