Alloc stack directly

This commit is contained in:
Vincent Ollivier 2022-04-12 10:05:28 +02:00
parent 0559b9075f
commit bfdaac2d2d
1 changed files with 2 additions and 2 deletions

View File

@ -253,10 +253,10 @@ impl Process {
}
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_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 code_ptr = code_addr as *mut u8;