Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
7e019461
提交
7e019461
9月 07, 2006
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix build
上级
a64cd813
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
Makefile
Makefile
+4
-4
main.c
main.c
+4
-4
没有找到文件。
Makefile
浏览文件 @
7e019461
...
@@ -49,22 +49,22 @@ bootblock : bootasm.S bootmain.c
...
@@ -49,22 +49,22 @@ bootblock : bootasm.S bootmain.c
$(OBJCOPY)
-S
-O
binary bootblock.o bootblock
$(OBJCOPY)
-S
-O
binary bootblock.o bootblock
./sign.pl bootblock
./sign.pl bootblock
kernel
:
$(OBJS) bootother.S init
kernel
:
$(OBJS) bootother.S
_
init
$(CC)
-nostdinc
-I
.
-c
bootother.S
$(CC)
-nostdinc
-I
.
-c
bootother.S
$(LD)
-N
-e
start
-Ttext
0x7000
-o
bootother.out bootother.o
$(LD)
-N
-e
start
-Ttext
0x7000
-o
bootother.out bootother.o
$(OBJCOPY)
-S
-O
binary bootother.out bootother
$(OBJCOPY)
-S
-O
binary bootother.out bootother
$(OBJDUMP)
-S
bootother.o
>
bootother.asm
$(OBJDUMP)
-S
bootother.o
>
bootother.asm
$(LD)
-Ttext
0x100000
-e
main0
-o
kernel
$(OBJS)
-b
binary bootother init
$(LD)
-Ttext
0x100000
-e
main0
-o
kernel
$(OBJS)
-b
binary bootother
_
init
$(OBJDUMP)
-S
kernel
>
kernel.asm
$(OBJDUMP)
-S
kernel
>
kernel.asm
tags
:
$(OBJS) bootother.S init
tags
:
$(OBJS) bootother.S
_
init
etags
*
.S
*
.c
etags
*
.S
*
.c
PRINT
=
\
PRINT
=
\
runoff.list
\
runoff.list
\
README
\
README
\
types.h param.h defs.h x86.h asm.h elf.h mmu.h spinlock.h
\
types.h param.h defs.h x86.h asm.h elf.h mmu.h spinlock.h
\
bootasm.S bootother.S main.c init.c spinlock.c
\
bootasm.S bootother.S main.c
_
init.c spinlock.c
\
proc.h proc.c setjmp.S kalloc.c
\
proc.h proc.c setjmp.S kalloc.c
\
syscall.h trapasm.S traps.h trap.c vectors.pl syscall.c sysproc.c
\
syscall.h trapasm.S traps.h trap.c vectors.pl syscall.c sysproc.c
\
buf.h dev.h fcntl.h stat.h file.h fs.h fsvar.h fd.c fs.c bio.c ide.c sysfile.c
\
buf.h dev.h fcntl.h stat.h file.h fs.h fsvar.h fd.c fs.c bio.c ide.c sysfile.c
\
...
...
main.c
浏览文件 @
7e019461
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include "spinlock.h"
#include "spinlock.h"
extern
char
edata
[],
end
[];
extern
char
edata
[],
end
[];
extern
uchar
_binary_
init_start
[],
_binary
_init_size
[];
extern
uchar
_binary_
_init_start
[],
_binary_
_init_size
[];
void
process0
();
void
process0
();
...
@@ -140,7 +140,7 @@ process0()
...
@@ -140,7 +140,7 @@ process0()
p1
=
copyproc
(
p0
);
p1
=
copyproc
(
p0
);
load_icode
(
p1
,
_binary_
init_start
,
(
uint
)
_binary
_init_size
);
load_icode
(
p1
,
_binary_
_init_start
,
(
uint
)
_binary_
_init_size
);
p1
->
state
=
RUNNABLE
;
p1
->
state
=
RUNNABLE
;
proc_wait
();
proc_wait
();
...
@@ -166,9 +166,9 @@ load_icode(struct proc *p, uchar *binary, uint size)
...
@@ -166,9 +166,9 @@ load_icode(struct proc *p, uchar *binary, uint size)
if
(
ph
->
type
!=
ELF_PROG_LOAD
)
if
(
ph
->
type
!=
ELF_PROG_LOAD
)
continue
;
continue
;
if
(
ph
->
va
+
ph
->
memsz
<
ph
->
va
)
if
(
ph
->
va
+
ph
->
memsz
<
ph
->
va
)
panic
(
"load_icode: overflow in
elf header segment
"
);
panic
(
"load_icode: overflow in
proghdr
"
);
if
(
ph
->
va
+
ph
->
memsz
>=
p
->
sz
)
if
(
ph
->
va
+
ph
->
memsz
>=
p
->
sz
)
panic
(
"load_icode: icode
wants to be above UTOP
"
);
panic
(
"load_icode: icode
too large
"
);
// Load/clear the segment
// Load/clear the segment
memmove
(
p
->
mem
+
ph
->
va
,
binary
+
ph
->
offset
,
ph
->
filesz
);
memmove
(
p
->
mem
+
ph
->
va
,
binary
+
ph
->
offset
,
ph
->
filesz
);
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论