Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
fbaf1074
提交
fbaf1074
10月 22, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaks to kill 1 GB identity mapping before entering C code.
上级
eb71d140
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
12 行删除
+19
-12
boot.S
boot.S
+18
-11
main.c
main.c
+1
-1
没有找到文件。
boot.S
浏览文件 @
fbaf1074
...
...
@@ -172,12 +172,14 @@ start64hi:
jz 1f
PANIC("Data segment is not loaded correctly.")
1:
# Load VA stack pointer
movabsq $(stack+STACK), %rsp
# Kill 1GB identity mapping
movq $0, pml4
# Clear frame pointer for stack walks, and call into C code.
mov
l $0, %e
bp
mov
q $0, %r
bp
call cmain
PANIC("Unexpected return from main.")
1: jmp 1b
.code32
.globl bootpanic
...
...
@@ -260,27 +262,32 @@ colorbar:
.comm stack, STACK
# Page tables. See section 4.5 of 253668.pdf.
# We map the first GB of physical memory at 0 and at
1 TB (not GB)
before
# the end of physical memory. At boot time we are using the mapping at 0
# We map the first GB of physical memory at 0 and at
-2 GB (or 2 GB
before
# the end of physical memory
)
. At boot time we are using the mapping at 0
# but during ordinary execution we use the high mapping.
# The intent is that after bootstrap the kernel can expand this mapping
# to cover all the available physical memory.
# This would be easier if we could use the PS bit to create GB-sized entries
# and skip the pdt table, but not all chips support it, and QEMU doesn't.
.align 4096
.global pml4
pml4:
.quad PADDR(pdpt) + (1<<0) + (1<<1) // present, read/write
.quad PADDR(pdpt
0
) + (1<<0) + (1<<1) // present, read/write
.space 4096 - 16
.quad PADDR(pdpt) + (1<<0) + (1<<1) // present, read/write
.quad PADDR(pdpt
1
) + (1<<0) + (1<<1) // present, read/write
.align 4096
pdpt:
pdpt
0
:
.quad PADDR(pdt) + (1<<0) + (1<<1) // present, read/write
.quad 0
.space 4096 - 2*16
.space 4096 - 16
.align 4096
pdpt1:
.space 4096 - 16
.quad PADDR(pdt) + (1<<0) + (1<<1) // present, read/write
.quad 0
.align 4096
pdt:
// Filled in below.
...
...
main.c
浏览文件 @
fbaf1074
#include "
vmx
.h"
#include "
types
.h"
#include "multiboot.h"
extern
void
uartinit
(
void
);
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论