Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
ef62aebd
提交
ef62aebd
10月 25, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
trapasm.S fixes.
上级
c883a275
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
7 行删除
+21
-7
Makefile
Makefile
+1
-1
proc.c
proc.c
+4
-1
trapasm.S
trapasm.S
+6
-5
x86.h
x86.h
+10
-0
没有找到文件。
Makefile
浏览文件 @
ef62aebd
...
...
@@ -76,7 +76,7 @@ clean:
QEMUOPTS
=
-smp
$(CPUS)
-m
512
-nographic
qemu
:
kernel
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
#-S -s
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
ud0
:
kernel
rsync
-avP
kernel amsterdam.csail.mit.edu:/tftpboot/ud0/kernel.xv6
proc.c
浏览文件 @
ef62aebd
...
...
@@ -179,9 +179,12 @@ inituser(void)
if
(
copyout
(
p
->
vmap
,
0
,
_binary_initcode_start
,
(
uptr
)
_binary_initcode_size
)
<
0
)
panic
(
"userinit: copyout"
);
memset
(
p
->
tf
,
0
,
sizeof
(
*
p
->
tf
));
p
->
tf
->
cs
=
UCSEG
|
0x3
;
p
->
tf
->
ds
=
UDSEG
|
0x3
;
p
->
tf
->
ss
=
p
->
tf
->
ds
;
p
->
tf
->
rflags
=
FL_IF
;
p
->
tf
->
rsp
=
PGSIZE
;
p
->
tf
->
rip
=
0
;
// beginning of initcode.S
p
->
tf
->
rip
=
0
x0
;
// beginning of initcode.S
safestrcpy
(
p
->
name
,
"initcode"
,
sizeof
(
p
->
name
));
p
->
cwd
=
0
;
// forkret will fix in the process's context
...
...
trapasm.S
浏览文件 @
ef62aebd
...
...
@@ -34,7 +34,9 @@ trapcommon:
pushq %r13
pushq %r14
pushq %r15
movw %ds, %ax
pushw %ax
# Set up data and per-cpu segments.
movw $KDSEG, %ax
movw %ax, %ds
...
...
@@ -47,10 +49,9 @@ trapcommon:
.globl trapret
.align 8
trapret:
movw $UDSEG,
%ax
popw
%ax
movw %ax, %ds
movw %ax, %es
movw %ax, %ss
// XXX(sbw) we should do something with fs, gs, gs.base
popq %r15
...
...
@@ -68,8 +69,8 @@ trapret:
popq %rdx
popq %rsi
popq %rdi
addq $0x1
2
, %rsp // trapno, err
iret
addq $0x1
6
, %rsp // trapno, err
iret
q
.data
.align 8
...
...
x86.h
浏览文件 @
ef62aebd
...
...
@@ -127,9 +127,19 @@ static inline void lcr3(u64 val)
__asm
volatile
(
"movq %0,%%cr3"
:
:
"r"
(
val
));
}
static
inline
uptr
rcr2
(
void
)
{
uptr
val
;
__asm
volatile
(
"movq %%cr2,%0"
:
"=r"
(
val
));
return
val
;
}
// Layout of the trap frame built on the stack by the
// hardware and by trapasm.S, and passed to trap().
struct
trapframe
{
u16
ds
;
// amd64 ABI callee saved registers
u64
r15
;
u64
r14
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论