mirror of https://github.com/vinc/moros.git
Alloc stack directly
This commit is contained in:
parent
0559b9075f
commit
bfdaac2d2d
|
@ -253,10 +253,10 @@ impl Process {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create(bin: &[u8]) -> Result<usize, ()> {
|
fn create(bin: &[u8]) -> Result<usize, ()> {
|
||||||
|
// Allocate some memory for the code and the stack of the program
|
||||||
let code_size = 1 * PAGE_SIZE;
|
let code_size = 1 * PAGE_SIZE;
|
||||||
let code_addr = CODE_ADDR.fetch_add(code_size, Ordering::SeqCst);
|
let code_addr = CODE_ADDR.fetch_add(code_size, Ordering::SeqCst);
|
||||||
|
sys::allocator::alloc_pages(code_addr, code_size);
|
||||||
//sys::allocator::alloc_pages(code_addr, code_size);
|
|
||||||
|
|
||||||
let mut entry_point = 0;
|
let mut entry_point = 0;
|
||||||
let code_ptr = code_addr as *mut u8;
|
let code_ptr = code_addr as *mut u8;
|
||||||
|
|
Loading…
Reference in New Issue