forked from chenzhiy2001/code-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrCore-mod.diff
More file actions
executable file
·117 lines (107 loc) · 3.25 KB
/
rCore-mod.diff
File metadata and controls
executable file
·117 lines (107 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
diff --git a/easy-fs-fuse/src/main.rs b/easy-fs-fuse/src/main.rs
index bb9ff761..e1dd2683 100644
--- a/easy-fs-fuse/src/main.rs
+++ b/easy-fs-fuse/src/main.rs
@@ -59,11 +59,11 @@ fn easy_fs_pack() -> std::io::Result<()> {
.write(true)
.create(true)
.open(format!("{}{}", target_path, "fs.img"))?;
- f.set_len(16 * 2048 * 512).unwrap();
+ f.set_len(1600 * 2048 * 512).unwrap();
f
})));
- // 16MiB, at most 4095 files
- let efs = EasyFileSystem::create(block_file, 16 * 2048, 1);
+ // 1600MiB, at most 409500 files
+ let efs = EasyFileSystem::create(block_file, 1600 * 2048, 1);
let root_inode = Arc::new(EasyFileSystem::root_inode(&efs));
let apps: Vec<_> = read_dir(src_path)
.unwrap()
diff --git a/os/Cargo.toml b/os/Cargo.toml
index fde4b6cb..e756e6d9 100644
--- a/os/Cargo.toml
+++ b/os/Cargo.toml
@@ -23,3 +23,8 @@ sbi-rt = { version = "0.0.2", features = ["legacy"] }
[profile.release]
debug = true
+opt-level=0
+# debuginfo-level = 1
+
+# Debuginfo level for the compiler.
+# debuginfo-level-rustc = 2
diff --git a/os/src/config.rs b/os/src/config.rs
index 8f8b709a..cb668f62 100644
--- a/os/src/config.rs
+++ b/os/src/config.rs
@@ -1,7 +1,7 @@
#[allow(unused)]
pub const USER_STACK_SIZE: usize = 4096 * 2;
-pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
+pub const KERNEL_STACK_SIZE: usize = 4096 * 20;
pub const KERNEL_HEAP_SIZE: usize = 0x100_0000;
pub const MEMORY_END: usize = 0x88000000;
pub const PAGE_SIZE: usize = 0x1000;
diff --git a/user/.cargo/config b/user/.cargo/config
index 334d01e2..4c8362eb 100644
--- a/user/.cargo/config
+++ b/user/.cargo/config
@@ -3,5 +3,5 @@ target = "riscv64gc-unknown-none-elf"
[target.riscv64gc-unknown-none-elf]
rustflags = [
- "-Clink-args=-Tsrc/linker.ld", "-Cforce-frame-pointers=yes"
+ "-Clink-args=-Tsrc/linker.ld", "-Cforce-frame-pointers=yes","-Zunstable-options",
]
diff --git a/user/Cargo.toml b/user/Cargo.toml
index 1d7b2efc..194edad0 100644
--- a/user/Cargo.toml
+++ b/user/Cargo.toml
@@ -16,4 +16,6 @@ oorandom ="11"
virtio-input-decoder = "0.1.4"
[profile.release]
-debug = true
+debug=true
+debuginfo-level = 1
+debuginfo-level-rustc = 2
diff --git a/user/src/bin/initproc.rs b/user/src/bin/initproc.rs
index d25aee14..d49f05d3 100644
--- a/user/src/bin/initproc.rs
+++ b/user/src/bin/initproc.rs
@@ -3,10 +3,20 @@
extern crate user_lib;
+use user_lib::{println, getpid};
+
use user_lib::{exec, fork, wait, yield_};
#[no_mangle]
fn main() -> i32 {
+
+
+ println!("aaaaaaaaaaaaaa");
+ let a = getpid();
+ println!("pid is {}",a);
+
+
+
if fork() == 0 {
exec("user_shell\0", &[core::ptr::null::<u8>()]);
} else {
diff --git a/user/src/lib.rs b/user/src/lib.rs
index bda0e8b6..1668cba1 100644
--- a/user/src/lib.rs
+++ b/user/src/lib.rs
@@ -27,7 +27,7 @@ pub use sync::*;
use syscall::*;
pub use task::*;
-const USER_HEAP_SIZE: usize = 32768;
+const USER_HEAP_SIZE: usize = 32768*4;
static mut HEAP_SPACE: [u8; USER_HEAP_SIZE] = [0; USER_HEAP_SIZE];
diff --git a/user/src/linker.ld b/user/src/linker.ld
index 02f7b6bf..1df4e67e 100644
--- a/user/src/linker.ld
+++ b/user/src/linker.ld
@@ -27,6 +27,5 @@ SECTIONS
}
/DISCARD/ : {
*(.eh_frame)
- *(.debug*)
}
}