docs: documented child processes

This commit is contained in:
antifallobst 2023-03-04 00:02:47 +01:00
parent 1ab3a2bd22
commit 854bef0d4e
1 changed files with 19 additions and 8 deletions

View File

@ -1141,19 +1141,26 @@ These are standard pids
#### `process_T` - struct #### `process_T` - struct
| Name | Type | Description | | Name | Type | Description |
|----------|------------|--------------------------------------------------------| |-------------|------------|-----------------------------------------------------------|
| name | char[128] | The processes' name | | name | char[128] | The processes' name |
| id | pid_t | The process-identification number | | id | pid_t | The process-identification number |
| chunk | void* | A pointer to the chunk, where the process is stored in | | chunk | void* | A pointer to the chunk, where the process is stored in |
| chunk_id | uint32_t | The processes id inside of its chunk | | chunk_id | uint32_t | The processes id inside of its chunk |
| parent | process_T* | The process, that spawned this process | | num_threads | uint32_t | The amount of spawned threads, that belong to the process |
| threads | void* | A pointer to the processes' first thread | | threads | void* | A pointer to the processes' first thread |
| parent | process_T* | The process, that spawned this process |
| childs | process_T* | A pointer to the processes' first child process |
| prev | process_T* | The previous process |
| next | process_T* | The next process |
#### `process_spawn(parent, name)` - function (pid_t) #### `process_spawn(parent, name)` - function (pid_t)
Spawns a process named **_name_** as child of **_parent_** and returns its pid. Spawns a process named **_name_** as child of **_parent_** and returns its pid.
#### `process_kill_pid(pid)` - function (void)
Kills the process connected with **_pid_** and all of its threads and child processes.
#### `process_kill(process)` - function (void) #### `process_kill(process)` - function (void)
Kills **_process_** and all of its threads and child processes. Kills **_process_** and all of its threads and child processes.
@ -1194,6 +1201,10 @@ This is basically the backend for the `scheduler_start` kernel syscall.
#### `scheduler_is_initialized()` - function (bool) #### `scheduler_is_initialized()` - function (bool)
Returns if the scheduler is initialized (and running) or not. Returns if the scheduler is initialized (and running) or not.
#### `scheduler_dump_info(process, indent)` - function (void)
This recursively lists information(pid, name, threads) for all child processes of **_process_**.
**_indent_** is used intern for the recursive calls and should be set to 0 initially.
#### `scheduler_register_thread(thread)` - function (thread_T*) #### `scheduler_register_thread(thread)` - function (thread_T*)
Registers **_thread_** in the scheduler. Registers **_thread_** in the scheduler.