SYSCALL addition

This commit is contained in:
Able 2021-11-11 23:47:19 -06:00
parent 01c0c118dd
commit 62099ff635
2 changed files with 102 additions and 77 deletions

View file

@ -34,6 +34,12 @@ impl Externals for HostFunctions {
Ok(Some(RuntimeValue::I32(result as i32)))
}
SysCall::CONSOLE_RESET => {}
SysCall::CONSOLE_IN => {}
SysCall::CONSOLE_OUT => {}
SysCall::CONSOLE_GET_TITLE => {}
SysCall::CONSOLE_SET_TITLE => {}
_ => panic!("Unimplemented function at {}", index),
}
}

View file

@ -8,7 +8,8 @@ declum! {
CONSOLE_OUT = 3, // Console output
CONSOLE_GET_TITLE = 4, // Get the console title
CONSOLE_SET_TITLE = 5, // Set the console title
GET_PID = 6; // Get the proccess ID
PROCESS_INFO = 7; // Get information about the process
//scheduler Related Syscals
GET_PRIORITY = 10, // Get scheduler priority
SET_PRIORITY = 11, // Set scheduler priority
@ -33,6 +34,24 @@ declum! {
FILE_READ = 30,
FILE_WRITE = 31,
SLEEP=32, // Sleep in milliseconds
SLEEP_UNTIL=33, // Sleep until this time in milliseconds (if this is below the current time return)
NANOSLEEP=34, // Sleep in nanoseconds
NANOSLEEP_UNTIL=35, // Sleep until this time nanoseconds (if this is below the current time return)
GET_TIME = 36, // Gets the system time (some derivitive of seconds)
SET_TIME = 37, // Sets the system time (some derivitive of seconds)
// Socket SysCall
SOCKET_BIND=39, // Used by servers to lock a port
SOCKET_CONNECT=40,
SOCKET_DISCONNECT=41,
SOCKET_SEND=42,
SOCKET_RECIEVE=43,
// Security Syscalls
ENCRYPT = 50;
EMPTY = u32::MAX as usize