Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
3769917c
提交
3769917c
10月 27, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass system call arguments via registers.
上级
a938d2bd
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
16 行增加
和
15 行删除
+16
-15
TODO
TODO
+0
-2
initcode.S
initcode.S
+2
-3
syscall.c
syscall.c
+14
-2
usys.S
usys.S
+0
-8
没有找到文件。
TODO
浏览文件 @
3769917c
...
@@ -4,8 +4,6 @@
...
@@ -4,8 +4,6 @@
- (is there a way to use address_space(256) attributes?)
- (is there a way to use address_space(256) attributes?)
* bring mtrace back
* bring mtrace back
* finish syscall/sysret implementation
* finish syscall/sysret implementation
- pass syscall args via argument registers
- (adjust argint and friends)
* make uart console work over IPMI SOL
* make uart console work over IPMI SOL
* make syslinux/pxelinux work over IPMI SOL
* make syslinux/pxelinux work over IPMI SOL
* the elf loader in exec.c is a bit sketchy
* the elf loader in exec.c is a bit sketchy
...
...
initcode.S
浏览文件 @
3769917c
...
@@ -6,9 +6,8 @@
...
@@ -6,9 +6,8 @@
# exec(init, argv)
# exec(init, argv)
.globl start
.globl start
start:
start:
pushq $argv
movq $argv, %rsi
pushq $init
movq $init, %rdi
pushq $0 // where caller pc would be
movq $SYS_exec, %rax
movq $SYS_exec, %rax
int $T_SYSCALL
int $T_SYSCALL
...
...
syscall.c
浏览文件 @
3769917c
...
@@ -53,7 +53,19 @@ fetchstr(uptr addr, char **pp)
...
@@ -53,7 +53,19 @@ fetchstr(uptr addr, char **pp)
int
int
argint64
(
int
n
,
u64
*
ip
)
argint64
(
int
n
,
u64
*
ip
)
{
{
return
fetchint64
(
myproc
()
->
tf
->
rsp
+
8
+
8
*
n
,
ip
);
switch
(
n
)
{
case
0
:
*
ip
=
myproc
()
->
tf
->
rdi
;
break
;
case
1
:
*
ip
=
myproc
()
->
tf
->
rsi
;
break
;
case
2
:
*
ip
=
myproc
()
->
tf
->
rdx
;
break
;
case
3
:
*
ip
=
myproc
()
->
tf
->
rcx
;
break
;
case
4
:
*
ip
=
myproc
()
->
tf
->
r8
;
break
;
case
5
:
*
ip
=
myproc
()
->
tf
->
r9
;
break
;
default:
cprintf
(
"argint64: bad arg %d
\n
"
,
n
);
return
-
1
;
}
return
0
;
}
}
int
int
...
@@ -62,7 +74,7 @@ argint32(int n, int *ip)
...
@@ -62,7 +74,7 @@ argint32(int n, int *ip)
int
r
;
int
r
;
u64
i
;
u64
i
;
r
=
fetchint64
(
myproc
()
->
tf
->
rsp
+
8
+
8
*
n
,
&
i
);
r
=
argint64
(
n
,
&
i
);
if
(
r
>=
0
)
if
(
r
>=
0
)
*
ip
=
i
;
*
ip
=
i
;
return
r
;
return
r
;
...
...
usys.S
浏览文件 @
3769917c
...
@@ -4,16 +4,8 @@
...
@@ -4,16 +4,8 @@
#define SYSCALL(name) \
#define SYSCALL(name) \
.globl name; \
.globl name; \
name: \
name: \
pushq %r9; \
pushq %r8; \
pushq %rcx; \
pushq %rdx; \
pushq %rsi; \
pushq %rdi; \
pushq $0; \
movq $SYS_ ## name, %rax; \
movq $SYS_ ## name, %rax; \
int $T_SYSCALL; \
int $T_SYSCALL; \
addq $(7 * 8), %rsp; \
ret
ret
SYSCALL(fork)
SYSCALL(fork)
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论