k210 only can use 6M before configuring sdcard.

This commit is contained in:
Yifan Wu 2020-12-11 18:04:57 +08:00
parent 84b10893d4
commit f5c029d3db
6 changed files with 11 additions and 13 deletions

View File

@ -1,7 +1,7 @@
pub const USER_STACK_SIZE: usize = 4096 * 2;
pub const KERNEL_STACK_SIZE: usize = 4096 * 2;
pub const KERNEL_HEAP_SIZE: usize = 0x30_0000;
pub const MEMORY_END: usize = 0x80800000;
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
pub const MEMORY_END: usize = 0x80600000;
pub const PAGE_SIZE: usize = 0x1000;
pub const PAGE_SIZE_BITS: usize = 0xc;

View File

@ -6,7 +6,7 @@ extern crate user_lib;
use user_lib::{fork, wait, exit};
const MAX_CHILD: usize = 20;
const MAX_CHILD: usize = 40;
#[no_mangle]
pub fn main() -> i32 {

View File

@ -4,9 +4,9 @@
#[macro_use]
extern crate user_lib;
use user_lib::{fork, wait, get_time, getpid, exit, yield_,};
use user_lib::{fork, wait, getpid, exit, sleep, get_time};
static NUM: usize = 13;
static NUM: usize = 30;
#[no_mangle]
pub fn main() -> i32 {
@ -15,11 +15,9 @@ pub fn main() -> i32 {
if pid == 0 {
let current_time = get_time();
let sleep_length = (current_time as i32 as isize) * (current_time as i32 as isize) % 1000 + 1000;
println!("Subprocess {} sleep for {} ms", getpid(), sleep_length);
while get_time() < current_time + sleep_length {
yield_();
}
println!("Subprocess {} OK!", getpid());
println!("pid {} sleep for {} ms", getpid(), sleep_length);
sleep(sleep_length as usize);
println!("pid {} OK!", getpid());
exit(0);
}
}

View File

@ -6,7 +6,7 @@ extern crate user_lib;
use user_lib::{sleep, getpid, fork, exit, yield_};
const DEPTH: usize = 3;
const DEPTH: usize = 4;
fn fork_child(cur: &str, branch: char) {
let mut next = [0u8; DEPTH + 1];

View File

@ -6,7 +6,7 @@ extern crate user_lib;
use user_lib::{fork, wait, yield_, exit, getpid, get_time};
static NUM: usize = 20;
static NUM: usize = 35;
const N: usize = 10;
static P: i32 = 10007;
type Arr = [[i32; N]; N];

View File

@ -32,7 +32,7 @@ pub fn main() -> i32 {
// child process
if exec(line.as_str()) == -1 {
println!("Error when executing!");
return 0;
return -4;
}
unreachable!();
} else {