当前位置:网站首页>It was so simple to implement system call
It was so simple to implement system call
2022-06-13 09:39:00 【LuckyDog0623】
system call :
perform read System call will generate swi Instructions , Put the system call number in r7 In the register
(1) System call entry address

(2) Take out the system call number and put it in scno in

(3) Find the system call table

.type sys_call_table, #object
ENTRY(sys_call_table)
#include "calls.S" System call table

(4) How to implement new system calls
① stay printk Implement function body in
void sys_pk()
{
printk("this is a new sys call\n");
}
②caLLs.S Middle append
③unistd.h Middle append
④ Call in user mode
void pk()
{
__asm__(
"ldr r7,=363 \n"
"swi \n"
:
:
:"memory"
)
}
void main()
{
pk();
}
边栏推荐
- Classes and objects -- object model and this pointer
- Exploitation of competitive loopholes in attacking and defending world PWN play conditions
- (dp+ memory) acwing 901 skiing
- Timestamp to localdate
- Calculate the number of days between two times (supports cross month and cross year)
- LeetCode 202. 快乐数
- LeetCode 72. Edit distance
- Jenkins integrates LDAP. The problem of login failure of Jenkins users caused by LDAP configuration error is solved
- LeetCode 343. 整数拆分
- Consolas-with-Yahei
猜你喜欢

(topological sorting +bfs) acwing 848 Topological sequence of digraph
![[Luogu p1403] Research on divisor](/img/c1/b2a91ddad264d5f8283abf27dc8839.jpg)
[Luogu p1403] Research on divisor

Trees and binary trees: traversal of binary trees

Tree and binary tree: basic operation and implementation of binary tree

acwing 786. Number k

Alibaba senior experts analyze the standard design of protocol

go-zero微服务实战系列(三、API定义和表结构设计)

C language: dynamic memory management
![[ssl1271] sort I [heap]](/img/4d/f1e1b400db244835f037049a9577bf.jpg)
[ssl1271] sort I [heap]

【 ssl2 ⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶⁶83
随机推荐
go-zero微服务实战系列(三、API定义和表结构设计)
LeetCode 6095. Strong password checker II
LeetCode 5289. Fair distribution of cookies (DFS)
VGA常用分辨率及计算方法
Class and object -- friend
VDD,DVDD,AVDD,VCC,AFVDD,DOVDD,IOVDD
The turtle library displays the system time
Classes and objects -- object model and this pointer
Classes and objects - initialization and cleanup of objects
[51nod p2102] or subtraction and [bit operation]
Standard template library (STL)
C language: summary of question brushing (1)
Z字形变换
C language: dynamic memory management
Instruction level parallelism (?)
VGA common resolution and calculation method
LeetCode 6096. Success logarithm of spells and potions (binary search)
虚拟化和云计算文章大合集
Exercise 8-3 rotate the array to the right (20 points)
LeetCode 5259. 计算应缴税款总额