Documentation of kernel API

This commit is contained in:
Kyle J Cardoza 2024-07-08 23:45:26 -04:00
parent b9e5eb097c
commit 3ed38744de
1 changed files with 21 additions and 21 deletions

View File

@ -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 which applies to all such calls; this value indicates that the call was
successful. Any other value will indicate some specific error. successful. Any other value will indicate some specific error.
## 0x00: Terminate with Error Code ## `0x00`: Terminate with Error Code
Arguments: 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 for the system on its way out. Program control will be returned to
the command shell. the command shell.
## 0x01: Console Input ## `0x01`: Console Input
Arguments: Arguments:
- `C`: `0x01` - `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 purposes. When this call traps such a character, it outputs nothing an
continues waiting for another character to be ready. continues waiting for another character to be ready.
## 0x02: Console Output ## `0x02`: Console Output
Arguments: Arguments:
- `C`: `0x02` - `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 the terminal emulator. The character will be parsed by the terminal emulator
to handle control characters and escape sequences. to handle control characters and escape sequences.
## 0x03: Direct Console Input ## `0x03`: Direct Console Input
Arguments: Arguments:
- `C`: `0x03` - `C`: `0x03`
@ -70,7 +70,7 @@ Return Values:
This call does direct (raw) console input; if there is a character ready, it This call does direct (raw) console input; if there is a character ready, it
will be read, and if not, `NULL` will be returned. will be read, and if not, `NULL` will be returned.
## 0x04: Direct Console Output ## `0x04`: Direct Console Output
Arguments: Arguments:
- `C`: `0x04` - `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 as the value to write to screen memory, and will not be interpreted for terminal
control. control.
## 0x05: String Output ## `0x05`: String Output
Arguments: Arguments:
- `C`: `0x05` - `C`: `0x05`
@ -96,7 +96,7 @@ Return Values:
This call uses the 0x02 call "Console Output" above to send a `NULL`-terminated This call uses the 0x02 call "Console Output" above to send a `NULL`-terminated
string to stdout. string to stdout.
## 0x06: Buffered Line Input ## `0x06`: Buffered Line Input
Arguments: Arguments:
- `C`: `0x06` - `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 The newline in the resulting buffer will be replaced with a `NULL` to terminate the
string. string.
## 0x07: Console Status ## `0x07`: Console Status
Arguments: Arguments:
- `C`: `0x07` - `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 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. zero in C; if there is a character ready, it will return nonzero in C.
## 0x08: Return Version Number ## `0x08`: Return Version Number
Arguments: Arguments:
- `C`: `0x08` - `C`: `0x08`
@ -137,7 +137,7 @@ Return Values:
This call returns the version number of the kernel. This call returns the version number of the kernel.
## 0x09: Get Date ## `0x09`: Get Date
Arguments: Arguments:
- `C`: `0x09` - `C`: `0x09`
@ -159,7 +159,7 @@ in the following format:
} }
``` ```
## 0x0A: Set Date ## `0x0A`: Set Date
Arguments: Arguments:
- `C`: `0x0A` - `C`: `0x0A`
@ -182,7 +182,7 @@ Argument Structure:
This call sets the system date from the data in the argument structure. This call sets the system date from the data in the argument structure.
## 0x0B: Get Time ## `0x0B`: Get Time
Arguments: Arguments:
- `C`: `0x0B` - `C`: `0x0B`
@ -204,7 +204,7 @@ Argument Structure:
This call fills in the specified argument structure with the current time. This call fills in the specified argument structure with the current time.
## 0x0C: Set Time ## `0x0C`: Set Time
Arguments: Arguments:
- `C`: `0x0C` - `C`: `0x0C`
@ -226,7 +226,7 @@ Argument Structure:
This call sets the current time from the provided argument structure. This call sets the current time from the provided argument structure.
## 0x0D: Open File ## `0x0D`: Open File
Arguments: Arguments:
- `C`: `0x0D` - `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 the X register will contain the file handle. On error, the C accumulator will contain
a negative value indicating which error has occured. a negative value indicating which error has occured.
## 0x0E: Close File Handle ## `0x0E`: Close File Handle
Arguments: Arguments:
- `C`: `0x0E` - `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, 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. the C accumulator will contain a negative value, indicating an error has occured.
## 0x0F: Duplicate File Handle ## `0x0F`: Duplicate File Handle
Arguments: Arguments:
- `C`: `0x0F` - `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 register will contain the duplicate file handle. On error, the C accumulator will
contain a negative value, indicating an error has occured. contain a negative value, indicating an error has occured.
## 0x10: Read from File ## `0x10`: Read from File
Arguments: Arguments:
- `C`: `0x10` - `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 accumulator will contain a negative value indicating the specific error, and the X
register will contain the number of bytes actually read. register will contain the number of bytes actually read.
## 0x11: Write to File ## `0x11`: Write to File
Arguments: Arguments:
- `C`: `0x11` - `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 accumulator will contain a negative value indicating the specific error, and the X
register will contain the number of bytes actually written. register will contain the number of bytes actually written.
## 0x12: Seek in File ## `0x12`: Seek in File
Arguments: Arguments:
- `C`: `0x12` - `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 `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. 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. This call performs driver-specific functions.
## 0x14: Delete File ## `0x14`: Delete File
Arguments: Arguments:
- `C`: `0x14` - `C`: `0x14`