Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
5c948d49
提交
5c948d49
4月 08, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'scale-amd64' of
git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
into scale-amd64
上级
c79b80a7
d7a33310
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
8 行增加
和
28 行删除
+8
-28
traps.h
include/traps.h
+0
-1
initcode.S
kernel/initcode.S
+2
-2
sysfile.cc
kernel/sysfile.cc
+1
-1
trap.cc
kernel/trap.cc
+0
-17
syscalls.py
tools/syscalls.py
+5
-7
没有找到文件。
include/traps.h
浏览文件 @
5c948d49
...
...
@@ -24,7 +24,6 @@
// These are arbitrarily chosen, but with care not to overlap
// processor defined exceptions or interrupt vectors.
#define T_SYSCALL 64 // system call
#define T_TLBFLUSH 65 // flush TLB
#define T_SAMPCONF 66 // configure event counters
#define T_DEFAULT 500 // catchall
...
...
kernel/initcode.S
浏览文件 @
5c948d49
...
...
@@ -8,12 +8,12 @@ start:
movq $argv, %rsi
movq $init, %rdi
movq $SYS_exec, %rax
int $T_SYSCALL
syscall
# for(;;) exit();
exit:
movq $SYS_exit, %rax
int $T_SYSCALL
syscall
jmp exit
# char init[] = "/init\0";
...
...
kernel/sysfile.cc
浏览文件 @
5c948d49
...
...
@@ -431,7 +431,7 @@ sys_chdir(const char *path)
return
0
;
}
//SYSCALL
INT
//SYSCALL
int
sys_exec
(
const
char
*
upath
,
userptr
<
userptr
<
const
char
>
>
uargv
)
{
...
...
kernel/trap.cc
浏览文件 @
5c948d49
...
...
@@ -89,21 +89,6 @@ trap(struct trapframe *tf)
panic
(
"NMI"
);
}
if
(
tf
->
trapno
==
T_SYSCALL
){
sti
();
if
(
myproc
()
->
killed
)
{
mtstart
(
trap
,
myproc
());
exit
();
}
myproc
()
->
tf
=
tf
;
tf
->
rax
=
syscall
(
tf
->
rdi
,
tf
->
rsi
,
tf
->
rdx
,
tf
->
rcx
,
tf
->
r8
,
tf
->
rax
);
if
(
myproc
()
->
killed
)
{
mtstart
(
trap
,
myproc
());
exit
();
}
return
;
}
#if MTRACE
if
(
myproc
()
->
mtrace_stacks
.
curr
>=
0
)
mtpause
(
myproc
());
...
...
@@ -226,8 +211,6 @@ inittrap(void)
entry
=
trapentry
[
i
];
idt
[
i
]
=
INTDESC
(
KCSEG
,
entry
,
bits
);
}
entry
=
trapentry
[
T_SYSCALL
];
idt
[
T_SYSCALL
]
=
INTDESC
(
KCSEG
,
entry
,
SEG_DPL
(
3
)
|
SEG_INTR64
|
INT_P
);
}
void
...
...
tools/syscalls.py
浏览文件 @
5c948d49
...
...
@@ -55,13 +55,11 @@ SYS_%(uname)s = %(num)d
.globl
%(uname)
s
%(uname)
s:
movq $
%(num)
d,
%%
rax"""
%
syscall
.
__dict__
if
"INT"
in
syscall
.
flags
:
print
" int $T_SYSCALL"
else
:
print
" movq
%
rcx,
%
r10
\n
syscall"
print
" ret"
print
movq $
%(num)
d,
%%
rax
movq
%%
rcx,
%%
r10
syscall
ret
"""
%
syscall
.
__dict__
if
options
.
udecls
:
for
syscall
in
syscalls
:
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论