Skip to content

Commit 06f1d5c

Browse files
committed
add memory identity mapping when booting
1 parent 4002db5 commit 06f1d5c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

linux-object/src/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl LinuxProcess {
230230
files.insert(2.into(), stdout);
231231

232232
LinuxProcess {
233-
root_inode: create_root_fs(rootfs),
233+
root_inode: create_root_fs(rootfs), //Arc::clone(&ROOT_INODE),访问磁盘可能更快?
234234
parent: Weak::default(),
235235
inner: Mutex::new(LinuxProcessInner {
236236
files,

zCore/src/arch/riscv/boot/entry64.asm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ bootstacktop:
4545
.section .data
4646
.align 12 #12位对齐
4747
boot_page_table_sv39:
48-
#1G的一个大页: 0xffffffff_00000000 --> 0x00000000
48+
#1G的一个大页: 0x00000000_80000000 --> 0x80000000
4949
#1G的一个大页: 0xffffffff_80000000 --> 0x80000000
5050

5151
#前510项置0
52-
.zero 8 * 508
53-
54-
.quad (0x00000 << 10) | 0xef
5552
.zero 8
53+
.zero 8
54+
.quad (0x80000 << 10) | 0xef #0x80000000 --> 0x80000000
55+
56+
.zero 8 * 507
5657
#倒数第二项,PPN=0x80000(当转换为物理地址时还需左移12位), 标志位DAG_XWRV置1
5758
.quad (0x80000 << 10) | 0xef
5859
.zero 8

0 commit comments

Comments
 (0)