diff --git a/Usermode/loader/bin/src/interface.rs b/Usermode/loader/bin/src/interface.rs index 65b3def458c951540f44bf7fbba9b8d556736e53..ef483be5ab6af33c339dab315db288b099f59add 100644 --- a/Usermode/loader/bin/src/interface.rs +++ b/Usermode/loader/bin/src/interface.rs @@ -26,8 +26,7 @@ impl_from! { pub extern "C" fn new_process(executable_handle: ::syscalls::vfs::File, process_name: &[u8], args: &[&[u8]]) -> Result<::syscalls::threads::ProtoProcess,loader::Error> { extern "C" { - static BASE: [u8; 0]; - static LIMIT: [u8; 0]; + static limit_and_base: (u64, u64); } kernel_log!("new_process({:?}, ...)", ::std::ffi::OsStr::new(process_name)); @@ -62,7 +61,7 @@ pub extern "C" fn new_process(executable_handle: ::syscalls::vfs::File, process_ // Spawn new process // SAFE: Just takes the address of the externs statics - match ::syscalls::threads::start_process(name, unsafe { BASE.as_ptr() as usize }, unsafe { LIMIT.as_ptr() as usize }) + match ::syscalls::threads::start_process(name, unsafe { limit_and_base.0 as usize }, unsafe { limit_and_base.1 as usize }) { Ok(v) => v, Err(e) => panic!("TODO: new_process - Error '{:?}'", e), diff --git a/Usermode/loader/bin/start.S b/Usermode/loader/bin/start.S index 2bc014bd73901e0170a327e6366686422b859efe..ac97ea2bee6880d44c516dbb33262ebfe2644a20 100644 --- a/Usermode/loader/bin/start.S +++ b/Usermode/loader/bin/start.S @@ -199,6 +199,11 @@ GLOBAL(image_header) .long init_path_end - init_path DEFPTR start +.section .data +GLOBAL(limit_and_base) + .quad BASE + .quad LIMIT + .section .bss .space 0x1000 /* Guard page */ GLOBAL(init_stack_base)