|
XenevaOS
|


Go to the source code of this file.
Functions | |
| XE_LIB int | _KePauseThread () |
| _KePauseThread – pause currently running thread | |
| XE_LIB uint16_t | _KeGetThreadID () |
| _KeGetThreadID – get currently running thread id | |
| XE_LIB int | _KeGetProcessID () |
| _KeGetProcessID – get currently running process id | |
| XE_LIB int | _KeProcessExit () |
| _KeProcessExit – exits current process | |
| XE_LIB int | _KeProcessWaitForTermination (int pid) |
| _KeProcessWaitForTermination – suspends currently running process until another process state changes | |
| XE_LIB int | _KeCreateProcess (int parent_id, char *name) |
| _KeCreateProcess – create a new process slot by taking | |
| XE_LIB int | _KeProcessLoadExec (int proc_id, char *filename, int argc, char **argv) |
| _KeProcessLoadExec – loads an executable to a process slot | |
| XE_LIB uint64_t | _KeGetProcessHeapMem (size_t sz) |
| _KeGetProcessHeapMem – Grabs some memory from heap memory of current process slot | |
| XE_LIB int | _KeProcessSleep (uint64_t ms) |
| _KeProcessSleep – put the current process main thread to sleep mode 1s = 10000 ms | |
| XE_LIB int | _KeSetSignal (int signo, XESigHandler handler) |
| _KeSetSignal – register a new signal handler for this process | |
| XE_LIB size_t | _KeGetSystemTimerTick () |
| _KeGetSystemTimerTick – returns the current system timer tick | |
| XE_LIB int | _KeCreateThread (void(*entry)(), char *name) |
| _KeCreateThread – creates a new thread inside current process slot | |
| XE_LIB int | _KeSetFileToProcess (int fileno, int dest_fidx, int proc_id) |
| _KeSetFileToProcess – copies a file from one process to other | |
| XE_LIB int | _KeSendSignal (int pid, int signum) |
| _KeSendSignal – send a signal to desired process | |
| XE_LIB int | _KeProcessGetFileDesc (const char *filename) |
| XE_LIB uint64_t | _KeGetEnvironmentBlock () |
| _KeGetEnvironmentBlock – returns the current environment block of the process | |
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| XE_LIB int _KeCreateProcess | ( | int | parent_id, |
| char * | name | ||
| ) |
_KeCreateProcess – create a new process slot by taking
| parent_id | – process parent id |
| name | – process name |
| XE_LIB int _KeCreateThread | ( | void(*)() | entry, |
| char * | name | ||
| ) |
_KeCreateThread – creates a new thread inside current process slot
_KeGetEnvironmentBlock – returns the current environment block of the process
_KeGetProcessHeapMem – Grabs some memory from heap memory of current process slot
| sz | – size that is needed, should be page-aligned |
| XE_LIB int _KeGetProcessID | ( | ) |
_KeGetProcessID – get currently running process id
_KeGetSystemTimerTick – returns the current system timer tick
| XE_LIB int _KePauseThread | ( | ) |
_KePauseThread – pause currently running thread
| XE_LIB int _KeProcessExit | ( | ) |
_KeProcessExit – exits current process
| XE_LIB int _KeProcessGetFileDesc | ( | const char * | filename | ) |
2brief _KeProcessGetFileDesc – returns file descriptor for given filename
| filename | – name of the file if it's already opened |
| XE_LIB int _KeProcessLoadExec | ( | int | proc_id, |
| char * | filename, | ||
| int | argc, | ||
| char ** | argv | ||
| ) |
_KeProcessLoadExec – loads an executable to a process slot
| proc_id | – process slot id |
| filename | – filename of the process |
| argc | – number of arguments |
| argv | – argument array to pass |
_KeProcessSleep – put the current process main thread to sleep mode 1s = 10000 ms
| ms | – millisecond to sleep |
| XE_LIB int _KeProcessWaitForTermination | ( | int | pid | ) |
_KeProcessWaitForTermination – suspends currently running process until another process state changes
| pid | – process id,-1 for all |
| XE_LIB int _KeSendSignal | ( | int | pid, |
| int | signum | ||
| ) |
_KeSendSignal – send a signal to desired process
| pid | – thread id |
| signum | – signal number |
| XE_LIB int _KeSetFileToProcess | ( | int | fileno, |
| int | dest_fidx, | ||
| int | proc_id | ||
| ) |
_KeSetFileToProcess – copies a file from one process to other
| fileno | – file number of the current process |
| dest_fdidx | – destination process file index |
| proc_id | – destination process id |
| XE_LIB int _KeSetSignal | ( | int | signo, |
| XESigHandler | handler | ||
| ) |
_KeSetSignal – register a new signal handler for this process
| signo | – signal number |
| handler | – handler function |