11#ifndef MAXOS_SYSTEM_SYSCALLS_H
12#define MAXOS_SYSTEM_SYSCALLS_H
24namespace MaxOS::system {
Enables a resource to be used by only one instance at a time through locking and unlocking.
Handles a certain interrupt number.
virtual void handle_interrupt()
Handles an interrupt.
Provides an API for userspace applications to interact with the kernel.
static syscall_args_t * syscall_thread_sleep(syscall_args_t *args)
System call to sleep the current process.
static syscall_args_t * syscall_klog(syscall_args_t *args)
System call to log a message to the kernel log.
static syscall_args_t * syscall_resource_create(syscall_args_t *args)
System call to create a resource.
static syscall_args_t * syscall_resource_close(syscall_args_t *args)
System call to close a resource.
static syscall_args_t * syscall_close_process(syscall_args_t *args)
System call to close a process.
static syscall_args_t * syscall_resource_open(syscall_args_t *args)
System call to open a resource.
static syscall_args_t * syscall_thread_close(syscall_args_t *args)
System call to close a thread.
static syscall_args_t * syscall_thread_yield(syscall_args_t *args)
System call to yield the current process.
SyscallManager()
Construct a new Syscall Manager object and register the syscall handlers. Registers to interrupt 0x80...
void remove_syscall_handler(::syscore::SyscallType syscall)
Removes a syscall handler from the manager.
void set_syscall_handler(::syscore::SyscallType syscall, syscall_func_t handler)
Loads a syscall handler into the manager.
static syscall_args_t * syscall_free_memory(syscall_args_t *args)
System call to free a block of memory.
static syscall_args_t * syscall_resource_write(syscall_args_t *args)
System call to write to a resource.
static syscall_args_t * syscall_allocate_memory(syscall_args_t *args)
System call to allocate a block of memory.
static syscall_args_t * syscall_resource_read(syscall_args_t *args)
System call to read from a resource.
Defines a Colour class for representing colours in RGBA format, along with ANSI and console colour en...
struct PACKED MaxOS::system::CPUStatus cpu_status_t
Alias for CPUStatus struct.
Defines a InterruptManager and InterruptHandler for managing hardware and software interrupts.
Defines a MemoryManager class for handling memory allocation and deallocation.
Defines a GlobalScheduler and Scheduler for managing processes and threads.
The arguments passed to a syscall (simplified representation of values in registers)
uint64_t arg0
First argument (in rdi)
uint64_t arg1
Second argument (in rsi)
uint64_t return_value
The return value of the syscall (in rax)
uint64_t arg4
Fifth argument (in r8)
uint64_t arg3
Fourth argument (in rcx)
uint64_t arg2
Third argument (in rdx)
cpu_status_t * return_state
The CPU state to return to after the syscall.
uint64_t arg5
Sixth argument (in r9)
Defines the SyscallManager class for handling system calls from userspace applications.
syscall_args_t *(* syscall_func_t)(syscall_args_t *args)
Defines a Vector class for dynamically storing an array of elements.