blob: 33e2d685ce7dd4b6d224e2f642ea159eb352571d [file] [log] [blame] [view]
# Process
process - Process abstraction
A magenta process is an instance of a program in the traditional
sense: a set of instructions which will be executed by one or more
threads, along with a collection of resources.
The process object is a container of the following resources:
+ [Handles](../
+ [Virtual Memory Address Regions](
+ [Threads](
In general, it is associated with code which it is executing until it is
forcefully terminated or the program exits.
Processes are owned by [jobs]( and allow an application that is
composed by more than one process to be treated as a single entity, from the
perspective of resource and permission limits, as well as lifetime control.
### Lifetime
A process is created via `sys_process_create()` which take no parameters.
The process starts destruction when main thread terminates or the last handle
is closed. [⚠ not implemented].
Next, the main binary is loaded into the process via `sys_process_load()` and
its execution begins with `sys_process_start()`.
+ [process_create](../syscalls/ - create a new process within a job
+ [process_read_memory](../syscalls/ - read from a process's address space
+ [process_start](../syscalls/ - cause a new process to start executing
+ [process_write_memory](../syscalls/ - write to a process's address space
+ [process_exit](../syscalls/ - exit the current process
+ [job_create](../syscalls/ - create a new job within a parent job
+ [vmar_map](../syscalls/ - Map memory into an address space range
+ [vmar_protect](../syscalls/ - Change permissions on an address space range
+ [vmar_unmap](../syscalls/ - Unmap memory from an address space range