Documentation of kernel API

This commit is contained in:
Kyle J Cardoza 2024-07-09 11:49:08 -04:00
parent 77b197786d
commit 4582df8946
1 changed files with 50 additions and 1 deletions

View File

@ -486,4 +486,53 @@ any device alias, or if the `alias` argument value is already in use
as a device alias. as a device alias.
On success, `C` will contain `STATUS_OK`. On error, `C` will contain On success, `C` will contain `STATUS_OK`. On error, `C` will contain
a negative value which indicates the specific error type. a negative value which indicates the specific error type.
## `0x1A`: Get Environment Variable
Arguments:
- `C`: `0x1A`
- `X`: Bank of argument structure
- `Y`: Address of argument structure
Return Values:
- `C`: Status code
Argument Structure:
```
struct {
char *name; // The name of the variable to read
char *value; // Buffer for the value of the variable
};
```
This call gets the value of an environment variable specified by the
`name` field of the argument structure, and copies it into the buffer
pointed to by the `value` field. If the variable is not set, the value
will be set to `NULL`, and the status code will be `ERR_ENV_UNSET`; otherwise
the status code will be `STATUS_OK`.
## `0x1B`: Set Environment Variable
Arguments:
- `C`: `0x1A`
- `X`: Bank of argument structure
- `Y`: Address of argument structure
Return Values:
- `C`: Status code
Argument Structure:
```
struct {
char *name; // The name of the variable to set
char *value; // Buffer for the new value of the variable
};
```
This call sets the value of an environment variable specified by the
`name` field of the argument structure by copying the string pointed
to by the `value` field. To unset a variable, pass `NULL` in the `value`
field. This call always returns `STATUS_OK`.