MicrOS
|
Go to the source code of this file.
Classes | |
struct | micros_process_user_info |
Process information retrieved from the kernel. More... | |
struct | micros_signal_registers_state |
Process registers state. More... | |
struct | micros_signal_fpu_state |
Process FPU state. More... | |
struct | micros_signal_params |
Structure containig data passed when the signal is executed (from the point where the last instruction was executed before signal) More... | |
Enumerations | |
enum | micros_process_status { micros_process_status_ready, micros_process_status_working, micros_process_status_waiting_sleep, micros_process_status_waiting_key_press, micros_process_status_waiting_for_process } |
Process status retrieved from the kernel. More... | |
Functions | |
void | micros_process_exit_process (int status) |
Forces current process to exit. More... | |
uint32_t | micros_process_get_processes_count () |
Returns number of processes. More... | |
void | micros_process_get_current_process_info (micros_process_user_info *user_info) |
Retrieves from the kernel information about the current process. More... | |
bool | micros_process_get_process_info (uint32_t id, micros_process_user_info *user_info) |
Retrieves from the kernel information about the process with the specified id. More... | |
void | micros_process_get_all_processes_info (micros_process_user_info *user_info) |
Retrieves from the kernel information about all processes. More... | |
void | micros_process_set_current_process_name (char *name) |
Sets name of the current process. More... | |
void | micros_process_current_process_sleep (uint32_t milliseconds) |
Stops process for the specified amount of time. More... | |
uint32_t | micros_process_start_process (char *path, char *arguments, bool child, bool active) |
Creates new process. More... | |
void | micros_process_set_current_process_signal_handler (void(*signal_handler)(micros_signal_params *)) |
Sets function which will be called on the signal raise. More... | |
void | micros_process_finish_signal_handler (micros_signal_params *old_state) |
Confirms the end of signal handler execution. More... | |
void | micros_process_wait_for_process (uint32_t process_id_to_wait) |
Stops process until the end of the another process. More... | |
uint32_t | micros_process_start_thread (void *entry_point, void *param) |
Creates new thread. More... | |
void | micros_process_abort_thread () |
Forces current thread to exit. More... | |
Process status retrieved from the kernel.
void micros_process_abort_thread | ( | ) |
Forces current thread to exit.
Forces current thread to exit.
void micros_process_current_process_sleep | ( | uint32_t | milliseconds | ) |
Stops process for the specified amount of time.
Stops process for the specified amount of time. Kernel won't jump to this process until the time will pass.
milliseconds | Milliseconds to wait. |
void micros_process_exit_process | ( | int | status | ) |
Forces current process to exit.
Forces current process to exit with the specified status code (typically 0 means success).
status | Exit status code. |
void micros_process_finish_signal_handler | ( | micros_signal_params * | old_state | ) |
Confirms the end of signal handler execution.
Confirms the end of signal handler execution. Kernel will return to the last instruction before signal was raised.
old_state | Signal state retrieved from the kernel. |
void micros_process_get_all_processes_info | ( | micros_process_user_info * | user_info | ) |
Retrieves from the kernel information about all processes.
Retrieves from the kernel information about all processes id and saves them to the passed structure.
user_info | Pointer to the structure where the information about all processes will be stored. |
void micros_process_get_current_process_info | ( | micros_process_user_info * | user_info | ) |
Retrieves from the kernel information about the current process.
Retrieves from the kernel information about the current process and saves it to the passed structure.
user_info | Pointer to the structure where the information about the current process will be stored. |
bool micros_process_get_process_info | ( | uint32_t | id, |
micros_process_user_info * | user_info | ||
) |
Retrieves from the kernel information about the process with the specified id.
Retrieves from the kernel information about the process with the specified id and saves it to the passed structure.
user_info | Pointer to the structure where the information about the process with the specified id will be stored. |
uint32_t micros_process_get_processes_count | ( | ) |
Returns number of processes.
Returns number of processes working in the operating system.
void micros_process_set_current_process_name | ( | char * | name | ) |
Sets name of the current process.
Sets name of the current process. Name cannot be longer than 32 chars.
name | New name of the current process. |
void micros_process_set_current_process_signal_handler | ( | void(*)(micros_signal_params *) | signal_handler | ) |
Sets function which will be called on the signal raise.
Sets function which will be called on the signal raise. Should be called by the standard library before entering to the main function of the program.
micros_signal_params | Pointer to the function. |
uint32_t micros_process_start_process | ( | char * | path, |
char * | arguments, | ||
bool | child, | ||
bool | active | ||
) |
Creates new process.
Creates new process from the specified path with parameters.
path | Path to the executable file. |
arguments | Arguments passed to the main function of the new process. |
child | Flag indicates it the newly created process will be child of the current process. |
active | Flag indicates if the newly created process will become active (on foreground). |
uint32_t micros_process_start_thread | ( | void * | entry_point, |
void * | param | ||
) |
Creates new thread.
Creates new thread with the specified parameters.
entry_point | Address of the entry point from which thread will start. |
param | Parameter which will be passed to the thread function. |
void micros_process_wait_for_process | ( | uint32_t | process_id_to_wait | ) |
Stops process until the end of the another process.
Stops process until the end of the another process with the specified ID.
process_id_to_wait | Process ID to wait. |