Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
dd4438b4
提交
dd4438b4
9月 02, 2011
创建
作者:
Austin Clements
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Nuke data.S, since we do have a custom linker script.
上级
ce6dd9de
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
31 行删除
+13
-31
Makefile
Makefile
+4
-4
data.S
data.S
+0
-26
kernel.ld
kernel.ld
+8
-0
vm.c
vm.c
+1
-1
没有找到文件。
Makefile
浏览文件 @
dd4438b4
...
...
@@ -109,8 +109,8 @@ initcode: initcode.S
$(OBJCOPY)
-S
-O
binary initcode.out initcode
$(OBJDUMP)
-S
initcode.o
>
initcode.asm
kernel
:
$(OBJS) entry.o
data.o
entryother initcode
$(LD)
$(LDFLAGS)
-T
kernel.ld
-e
entry
-o
kernel entry.o
data.o
$(OBJS)
-b
binary initcode entryother
kernel
:
$(OBJS) entry.o entryother initcode
$(LD)
$(LDFLAGS)
-T
kernel.ld
-e
entry
-o
kernel entry.o
$(OBJS)
-b
binary initcode entryother
$(OBJDUMP)
-S
kernel
>
kernel.asm
$(OBJDUMP)
-t
kernel |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernel.sym
...
...
@@ -121,8 +121,8 @@ kernel: $(OBJS) entry.o data.o entryother initcode
# great for testing the kernel on real hardware without
# needing a scratch disk.
MEMFSOBJS
=
$
(
filter-out ide.o,
$(OBJS)
)
memide.o
kernelmemfs
:
$(MEMFSOBJS) entry.o
data.o
entryother initcode fs.img
$(LD)
$(LDFLAGS)
-Ttext
0x100000
-e
main
-o
kernelmemfs entry.o
data.o
$(MEMFSOBJS)
-b
binary initcode entryother fs.img
kernelmemfs
:
$(MEMFSOBJS) entry.o entryother initcode fs.img
$(LD)
$(LDFLAGS)
-Ttext
0x100000
-e
main
-o
kernelmemfs entry.o
$(MEMFSOBJS)
-b
binary initcode entryother fs.img
$(OBJDUMP)
-S
kernelmemfs
>
kernelmemfs.asm
$(OBJDUMP)
-t
kernelmemfs |
sed
'1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d'
>
kernelmemfs.sym
...
...
data.S
deleted
100644 → 0
浏览文件 @
ce6dd9de
// The kernel layout is:
//
// text
// rodata
// data
// bss
//
// Conventionally, Unix linkers provide pseudo-symbols
// etext, edata, and end, at the end of the text, data, and bss.
// For the kernel mapping, we need the address at the beginning
// of the data section, but that's not one of the conventional
// symbols, because the convention started before there was a
// read-only rodata section between text and data.
//
// To get the address of the data section, we define a symbol
// named data and make sure this is the first object passed to
// the linker, so that it will be the first symbol in the data section.
//
// Alternative approaches would be to parse our own ELF header
// or to write a linker script, but this is simplest.
.data
.align 4096
.globl data
data:
.word 1
kernel.ld
浏览文件 @
dd4438b4
...
...
@@ -41,6 +41,14 @@ SECTIONS
/* Adjust the address for the data segment to the next page */
. = ALIGN(0x1000);
/* Conventionally, Unix linkers provide pseudo-symbols
* etext, edata, and end, at the end of the text, data, and bss.
* For the kernel mapping, we need the address at the beginning
* of the data section, but that's not one of the conventional
* symbols, because the convention started before there was a
* read-only rodata section between text and data. */
PROVIDE(data = .);
/* The data segment */
.data : {
*(.data)
...
...
vm.c
浏览文件 @
dd4438b4
...
...
@@ -7,7 +7,7 @@
#include "proc.h"
#include "elf.h"
extern
char
data
[];
// defined
in data.S
extern
char
data
[];
// defined
by kernel.ld
pde_t
*
kpgdir
;
// for use in scheduler()
struct
segdesc
gdt
[
NSEGS
];
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论