From ceac93e3d93eeaf14b2472be26fe354ce4445e7b Mon Sep 17 00:00:00 2001 From: ZIYAN137 Date: Thu, 16 Oct 2025 08:54:23 +0000 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E5=88=9B=E5=BB=BA=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E6=96=87=E4=BB=B6=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/src/mm/address/.gitkeep | 0 os/src/mm/allocation/.gitkeep | 0 os/src/mm/global_allocator/.gitkeep | 0 os/src/mm/pagetable/.gitkeep | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 os/src/mm/address/.gitkeep create mode 100644 os/src/mm/allocation/.gitkeep create mode 100644 os/src/mm/global_allocator/.gitkeep create mode 100644 os/src/mm/pagetable/.gitkeep diff --git a/os/src/mm/address/.gitkeep b/os/src/mm/address/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/os/src/mm/allocation/.gitkeep b/os/src/mm/allocation/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/os/src/mm/global_allocator/.gitkeep b/os/src/mm/global_allocator/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/os/src/mm/pagetable/.gitkeep b/os/src/mm/pagetable/.gitkeep new file mode 100644 index 00000000..e69de29b From 86831625ad508b8c7f3c9faed2cde65e998daf27 Mon Sep 17 00:00:00 2001 From: ZIYAN137 Date: Thu, 16 Oct 2025 09:02:06 +0000 Subject: [PATCH 2/2] =?UTF-8?q?feat(mm):=20=E6=B7=BB=E5=8A=A0mm=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E9=85=8D=E7=BD=AE=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/src/config.rs | 7 +++++++ os/src/main.rs | 1 + 2 files changed, 8 insertions(+) create mode 100644 os/src/config.rs diff --git a/os/src/config.rs b/os/src/config.rs new file mode 100644 index 00000000..ea43a373 --- /dev/null +++ b/os/src/config.rs @@ -0,0 +1,7 @@ +// constants for the operating system +#![allow(unused)] + +// about memory management +pub const PAGE_SIZE: usize = 4096; +pub const KERNEL_HEAP_SIZE: usize = 16 * 1024 * 1024; // 16MB +pub const USER_STACK_SIZE: usize = 4 * 1024 * 1024; // 4MB \ No newline at end of file diff --git a/os/src/main.rs b/os/src/main.rs index 6686807e..e4bcce04 100644 --- a/os/src/main.rs +++ b/os/src/main.rs @@ -7,6 +7,7 @@ #[macro_use] mod console; mod sbi; +mod config; use core::arch::global_asm; use core::panic::PanicInfo;