From 3ed38744de1a7ac7dc1a78bdf9e6cd2d117c8687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kyle=20J=C2=A0Cardoza?= Date: Mon, 8 Jul 2024 23:45:26 -0400 Subject: [PATCH] Documentation of kernel API --- doc/syscalls.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/syscalls.md b/doc/syscalls.md index 4606715..8e3b80b 100644 --- a/doc/syscalls.md +++ b/doc/syscalls.md @@ -15,7 +15,7 @@ Most calls return a status code in C. This code has one value, `STATUS_OK`, which applies to all such calls; this value indicates that the call was successful. Any other value will indicate some specific error. -## 0x00: Terminate with Error Code +## `0x00`: Terminate with Error Code Arguments: @@ -29,7 +29,7 @@ This call exits the calling program, setting the exit status code for the system on its way out. Program control will be returned to the command shell. -## 0x01: Console Input +## `0x01`: Console Input Arguments: - `C`: `0x01` @@ -46,7 +46,7 @@ This call traps certain sequences of characters for "terminal control" purposes. When this call traps such a character, it outputs nothing an continues waiting for another character to be ready. -## 0x02: Console Output +## `0x02`: Console Output Arguments: - `C`: `0x02` @@ -59,7 +59,7 @@ This call sends a single chracter to the standard output, which is usually the terminal emulator. The character will be parsed by the terminal emulator to handle control characters and escape sequences. -## 0x03: Direct Console Input +## `0x03`: Direct Console Input Arguments: - `C`: `0x03` @@ -70,7 +70,7 @@ Return Values: This call does direct (raw) console input; if there is a character ready, it will be read, and if not, `NULL` will be returned. -## 0x04: Direct Console Output +## `0x04`: Direct Console Output Arguments: - `C`: `0x04` @@ -83,7 +83,7 @@ This call does direct (raw) console output; the value supplied will be treated as the value to write to screen memory, and will not be interpreted for terminal control. -## 0x05: String Output +## `0x05`: String Output Arguments: - `C`: `0x05` @@ -96,7 +96,7 @@ Return Values: This call uses the 0x02 call "Console Output" above to send a `NULL`-terminated string to stdout. -## 0x06: Buffered Line Input +## `0x06`: Buffered Line Input Arguments: - `C`: `0x06` @@ -114,7 +114,7 @@ input will be ignored until a newline is entered. The newline in the resulting buffer will be replaced with a `NULL` to terminate the string. -## 0x07: Console Status +## `0x07`: Console Status Arguments: - `C`: `0x07` @@ -125,7 +125,7 @@ Return Values: This call checks stdin for a character to read. If there is none, this call will return zero in C; if there is a character ready, it will return nonzero in C. -## 0x08: Return Version Number +## `0x08`: Return Version Number Arguments: - `C`: `0x08` @@ -137,7 +137,7 @@ Return Values: This call returns the version number of the kernel. -## 0x09: Get Date +## `0x09`: Get Date Arguments: - `C`: `0x09` @@ -159,7 +159,7 @@ in the following format: } ``` -## 0x0A: Set Date +## `0x0A`: Set Date Arguments: - `C`: `0x0A` @@ -182,7 +182,7 @@ Argument Structure: This call sets the system date from the data in the argument structure. -## 0x0B: Get Time +## `0x0B`: Get Time Arguments: - `C`: `0x0B` @@ -204,7 +204,7 @@ Argument Structure: This call fills in the specified argument structure with the current time. -## 0x0C: Set Time +## `0x0C`: Set Time Arguments: - `C`: `0x0C` @@ -226,7 +226,7 @@ Argument Structure: This call sets the current time from the provided argument structure. -## 0x0D: Open File +## `0x0D`: Open File Arguments: - `C`: `0x0D` @@ -245,7 +245,7 @@ If the file is successfully opened, the C accumulator will contain `STATUS_OK`, the X register will contain the file handle. On error, the C accumulator will contain a negative value indicating which error has occured. -## 0x0E: Close File Handle +## `0x0E`: Close File Handle Arguments: - `C`: `0x0E` @@ -258,7 +258,7 @@ This call attempts to close the file referred to by the provided file handle. On success, the C accumulator will contain a status code of `STATUS_OK`. On error, the C accumulator will contain a negative value, indicating an error has occured. -## 0x0F: Duplicate File Handle +## `0x0F`: Duplicate File Handle Arguments: - `C`: `0x0F` @@ -274,7 +274,7 @@ On success, the C accumulator will contain a status code of `STATUS_OK`, and th register will contain the duplicate file handle. On error, the C accumulator will contain a negative value, indicating an error has occured. -## 0x10: Read from File +## `0x10`: Read from File Arguments: - `C`: `0x10` @@ -301,7 +301,7 @@ and the X register will contain the number of bytes actually read. On error, the accumulator will contain a negative value indicating the specific error, and the X register will contain the number of bytes actually read. -## 0x11: Write to File +## `0x11`: Write to File Arguments: - `C`: `0x11` @@ -328,7 +328,7 @@ and the X register will contain the number of bytes actually written. On error, accumulator will contain a negative value indicating the specific error, and the X register will contain the number of bytes actually written. -## 0x12: Seek in File +## `0x12`: Seek in File Arguments: - `C`: `0x12` @@ -348,11 +348,11 @@ which data can be read or to which data can be written. On success, this call re `STATUS_OK` in C, and the new file position in X and Y. On error, C will contain a negative value indicating the specific error, and the new file position in X and Y. -## 0x13: Device I/O Control +## `0x13`: Device I/O Control This call performs driver-specific functions. -## 0x14: Delete File +## `0x14`: Delete File Arguments: - `C`: `0x14`