[−][src]Function sunrise_kernel::syscalls::create_process
pub fn create_process(
procinfo: UserSpacePtr<ProcInfo>,
caps: UserSpacePtr<[u8]>
) -> Result<usize, UserspaceError>
Creates a new process. This will create an empty address space without any
thread yet. The size of this address space is controlled through
the ProcInfoAddrSpace found in procinfo.
It will create an empty memory region at code_addr spanning
code_num_pages pages. This region will initially not have any user
permissions - the user is expected to call set_process_memory_permissions.
The code region needs to fall within a region called the code allowed region, which depends on the address space:
For 32-bit address space: 0x00200000-0x003FFFFFFF
For 36-bit address space: 0x08000000-0x007FFFFFFF
For 39-bit address space: 0x08000000-0x7FFFFFFFFF
Errors
InvalidEnum- ProcInfo contains invalid bitfields
InvalidAddress- ProcInfo's
code_addris not 21-bit aligned.
- ProcInfo's
InvalidMemRange- ProcInfo's
code_addris not within the allowed code region.
- ProcInfo's
- All the errors from crate::process::capabilities::ProcessCapabilities#parse_kacs