Skip to content

Index

Functions

amd64_syscall

uintptr_t amd64_syscall(int syscall_num, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6)

Performs a syscall for the AMD64

quit

int quit()

Quit the current running process

test

int test(char c)

Test syscall

sched

int sched()

Give the CPU to another process

map

void * map(uintptr_t vaddr, size_t pages, uint32_t flags)

map memory into this procgrou[

unmap

int unmap(uintptr_t vaddr, size_t pages)

unmap memory from this procgrou[

clone

int clone(uintptr_t vstack_top, void ()(void) entry, void * argument_ptr)*

Clone process with argument and entry point

mutex_create

int mutex_create()

Create a mutex

mutex_delete

int mutex_delete(int mutex_rid)

Delete a mutex. Will wake up waiters

mutex_lock

int mutex_lock(int mutex_rid)

Lock a mutex

mutex_unlock

int mutex_unlock(int mutex_rid)

Unlock a mutex

argument_ptr

void * argument_ptr()

get current process argument pointer

device_do

int device_do(const char * device_key, int cmd, void * a1, void * a2, void * a3, void * a4)

Call a device command

exec

int exec(const char * volume, const char * path)

Run external ELF program

volume_open

int volume_open(const char * volume)

Open a file

volume_close

int volume_close()

Close a file

read_file

int read_file(const char * path, size_t off, uint8_t * buffer, size_t size)

Read a file

describe

int describe(const char * path, struct desc * desc)

describe a file

mail_send

int mail_send(int pgid, void * mesg, size_t mesg_size)

send a message to a procgroup's mail

mail_receive

int mail_receive(void * mesg, size_t mesg_size)

receive a message from mail

get_procgroup

int get_procgroup(int pid)

get procgroup id of a perticular process

get_exec_pid

int get_exec_pid()

get PID of process, which exec'ed the current process

read_dir_entry

int read_dir_entry(const char * path, struct dir_entry * entry, size_t entry_num)

Read directory entry

create_file

int create_file(const char * path)

create a file

write_file

int write_file(const char * path, size_t off, uint8_t * buffer, size_t size)

write to a file

wait_for_pid

int wait_for_pid(int pid)

wait for process

kill

int kill(int pid)

Kill process