|
RPV Event driven kernel
|
Kernel can run on any binary system platfrom and compile using target platform toolchain e.g. any gcc variant alike. There are APIs require implementation within the concrete target platform project. There are several compile instance profiles available each defines the number of APIs need in implementation. More...

Modules | |
| Kernel lite profile | |
| Kernel lite variant. Includes a core with basic commands. | |
| Kernel full profile | |
| Kernel full variant. Includes a core and all currently available subsystems. | |
Files | |
| file | console.h |
| Console interface used by the Kernel Shell. | |
| file | disk.h |
| Disk low level I/O interface called by file I/O subsystem. | |
| file | fat.h |
| File system middleware interface called by file I/O subsystem. | |
| file | prompt.h |
| System prompt constructor interface used by the Kernel Shell. | |
Functions | |
| void | con_ln (void) |
| Moves cursor to the next line. | |
| void | con_tab (void) |
| Inserts a horizontal tab. | |
| void | con_clear (void) |
| Clears the console display. | |
| void | con_char (const char code) |
| Writes a single character to the console. | |
| void | con_string (const char *str) |
| Writes a null-terminated string to the console. | |
| void | con_xy (size_t cx, size_t cy) |
| Sets the cursor position. | |
| size_t | con_getx (void) |
| Retrieves the current cursor X position. | |
| size_t | con_gety (void) |
| Retrieves the current cursor Y position. | |
| void | set_con (void) |
| Initializes the console subsystem. | |
| void | disk_io (void) |
| Initializes the disk I/O module be a part of a file I/O subsystem. | |
| size_t | get_disks (void) |
| Returns the number of detected disks. | |
| void | get_disk (size_t did, disk_t *disk) |
| Retrieves disk descriptor by identifier. | |
| void | get_diskInfo (size_t did, char *dsk_info, size_t dsk_infoLen) |
| Retrieves human-readable disk information string. | |
| uint8_t | flush_disk (size_t did) |
| Flushes pending write operations to disk. | |
| uint8_t | read_disk (void *buffer, size_t did, size_t blck, size_t blocks) |
| Reads blocks from disk. | |
| uint8_t | write_disk (void const *buffer, size_t did, size_t blck, size_t blocks) |
| Writes blocks to disk. | |
| void | fat_getcwd (char *cwd) |
| Retrieves current working directory path. | |
| bool | fat_exists (char const *path) |
| Checks whether a file or directory exists. | |
| bool | fat_chdir (char const *cwd) |
| Changes current working directory. | |
| bool | fat_mkdir (char const *path) |
| Creates a new directory. | |
| bool | fat_unlink (char const *path) |
| Removes a file or directory. | |
| bool | fat_mount (char const *path) |
| Mounts a FAT filesystem. | |
| bool | fat_unmount (char const *path) |
| Unmounts a FAT filesystem. | |
| bool | fat_stat (char const *path, filinfo_t *fno) |
| Retrieves file or directory metadata. | |
| fat_error_code_t | fat_getcode (void) |
| Returns last FAT error code. | |
| void | fat_fclose (int fd) |
| Closes an open file descriptor. | |
| int | fat_fopen (char const *path, file_access_t mode) |
| Opens a file. | |
| size_t | fat_fsize (int fd) |
| Returns file size. | |
| size_t | fat_fread (int fd, void *buffer, size_t nread) |
| Reads data from file. | |
| size_t | fat_fwrite (int fd, void const *buffer, size_t nwrite) |
| Writes data to file. | |
| void | fat_ls (char const *path, void const *ls_ctx, void(*nxt_file)(void const *ls_ctx, filinfo_t const *fi)) |
| Lists directory contents. | |
| void | _shell_prompt (char *prompt, const size_t p_len) |
| Generates or retrieves the current shell prompt string. | |
Variables | |
| size_t | MAX_X |
| Maximum horizontal coordinate of the console. | |
| size_t | MAX_Y |
| Maximum vertical coordinate of the console. | |
Kernel can run on any binary system platfrom and compile using target platform toolchain e.g. any gcc variant alike. There are APIs require implementation within the concrete target platform project. There are several compile instance profiles available each defines the number of APIs need in implementation.
| void _shell_prompt | ( | char * | prompt, |
| const size_t | p_len | ||
| ) |
Generates or retrieves the current shell prompt string.
| [out] | prompt | Output buffer receiving the prompt string. |
| [in] | p_len | Length of the output buffer in bytes. |
Writes the current shell prompt into the provided buffer. The prompt format is implementation-defined and may include contextual information such as:
The function guarantees null-termination provided p_len > 0.
| void con_char | ( | const char | code | ) |
Writes a single character to the console.
| [in] | code | Character to display. |
Writes the specified character at the current cursor position and advances the cursor according to implementation rules.
| void con_clear | ( | void | ) |
Clears the console display.
Clears the entire screen buffer and resets the cursor to the origin position (0,0).
| size_t con_getx | ( | void | ) |
Retrieves the current cursor X position.
Returns a value in the range [0, MAX_X - 1].
| size_t con_gety | ( | void | ) |
Retrieves the current cursor Y position.
Returns a value in the range [0, MAX_Y - 1].
| void con_ln | ( | void | ) |
Moves cursor to the next line.
Advances the cursor to the beginning of the next line. Scrolling behavior is implementation-defined if the cursor is currently on the last line.
| void con_string | ( | const char * | str | ) |
Writes a null-terminated string to the console.
| [in] | str | Pointer to null-terminated character string. |
Writes characters sequentially starting at the current cursor position. Cursor advancement and wrapping behavior are implementation-defined.
| void con_tab | ( | void | ) |
Inserts a horizontal tab.
Advances the cursor to the next tab stop. Tab width is implementation-defined.
| void con_xy | ( | size_t | cx, |
| size_t | cy | ||
| ) |
Sets the cursor position.
| [in] | cx | Horizontal position (column index). |
| [in] | cy | Vertical position (row index). |
Moves the cursor to the specified coordinates. Behavior is undefined if parameters exceed console bounds unless explicitly handled by implementation.
| void disk_io | ( | void | ) |
Initializes the disk I/O module be a part of a file I/O subsystem.
Performs hardware detection, driver initialization, and prepares internal file I/O subsystem disk tables.
Must be called before invoking other disk API functions.
| bool fat_chdir | ( | char const * | cwd | ) |
Changes current working directory.
| [in] | cwd | Target directory path. |
| true | Directory change successful. |
| false | Failure (see fat_getcode()). |
| bool fat_exists | ( | char const * | path | ) |
Checks whether a file or directory exists.
| [in] | path | Path to file or directory. |
| void fat_fclose | ( | int | fd | ) |
Closes an open file descriptor.
| [in] | fd | File descriptor. |
| int fat_fopen | ( | char const * | path, |
| file_access_t | mode | ||
| ) |
Opens a file.
| [in] | path | File path. |
| [in] | mode | File access mode flags. |
| size_t fat_fread | ( | int | fd, |
| void * | buffer, | ||
| size_t | nread | ||
| ) |
Reads data from file.
| [in] | fd | File descriptor. |
| [out] | buffer | Destination buffer. |
| [in] | nread | Number of bytes to read. |
| size_t fat_fsize | ( | int | fd | ) |
Returns file size.
| [in] | fd | File descriptor. |
| size_t fat_fwrite | ( | int | fd, |
| void const * | buffer, | ||
| size_t | nwrite | ||
| ) |
Writes data to file.
| [in] | fd | File descriptor. |
| [in] | buffer | Source buffer. |
| [in] | nwrite | Number of bytes to write. |
| fat_error_code_t fat_getcode | ( | void | ) |
Returns last FAT error code.
| void fat_getcwd | ( | char * | cwd | ) |
Retrieves current working directory path.
| [out] | cwd | Output buffer for path string. |
| void fat_ls | ( | char const * | path, |
| void const * | ls_ctx, | ||
| void(*)(void const *ls_ctx, filinfo_t const *fi) | nxt_file | ||
| ) |
Lists directory contents.
| [in] | path | Directory path. |
| [in] | ls_ctx | User-defined data context pointer. |
| [in] | nxt_file | Callback invoked for each directory entry. |
Iterates through directory entries and invokes the callback for each discovered file passing user defined data context object pointer
| bool fat_mkdir | ( | char const * | path | ) |
Creates a new directory.
| [in] | path | Directory path. |
| true | Directory created successfully. |
| false | Failure (see fat_getcode()). |
| bool fat_mount | ( | char const * | path | ) |
Mounts a FAT filesystem.
| [in] | path | Mount source (device path). |
| true | Mount successful. |
| false | Mount failed (see fat_getcode()). |
| bool fat_stat | ( | char const * | path, |
| filinfo_t * | fno | ||
| ) |
Retrieves file or directory metadata.
| [in] | path | Target path. |
| [out] | fno | Output file information structure. |
| true | Information retrieved successfully. |
| false | Failure (see fat_getcode()). |
| bool fat_unlink | ( | char const * | path | ) |
Removes a file or directory.
| [in] | path | Target path. |
| true | Removal successful. |
| false | Failure (see fat_getcode()). |
| bool fat_unmount | ( | char const * | path | ) |
Unmounts a FAT filesystem.
| [in] | path | Mount source. |
| true | Unmount successful. |
| false | Unmount failed (see fat_getcode()). |
| uint8_t flush_disk | ( | size_t | did | ) |
Flushes pending write operations to disk.
| [in] | did | Disk identifier. |
| DISK_IO_OK | Flush successful. |
| DISK_INVALID | Invalid disk identifier parameter |
| DISK_NOT_READY | Disk not initialized. |
| DISK_IO_ERR | Hardware error occurred. |
| void get_disk | ( | size_t | did, |
| disk_t * | disk | ||
| ) |
Retrieves disk descriptor by identifier.
| [in] | did | Disk identifier. |
| [out] | disk | Pointer to disk descriptor structure. |
| void get_diskInfo | ( | size_t | did, |
| char * | dsk_info, | ||
| size_t | dsk_infoLen | ||
| ) |
Retrieves human-readable disk information string.
| [in] | did | Disk identifier. |
| [out] | dsk_info | Output buffer for disk information string. |
| [in] | dsk_infoLen | Length of output buffer in bytes. |
Writes a null-terminated string describing the disk. Output is truncated if buffer is insufficient.
| size_t get_disks | ( | void | ) |
Returns the number of detected disks.
| 0 | No disks detected or module not initialized. |
| uint8_t read_disk | ( | void * | buffer, |
| size_t | did, | ||
| size_t | blck, | ||
| size_t | blocks | ||
| ) |
Reads blocks from disk.
| [out] | buffer | Destination buffer. |
| [in] | did | Disk identifier. |
| [in] | blck | Starting block index. |
| [in] | blocks | Number of blocks to read. |
| DISK_IO_OK | Read successful. |
| DISK_INVALID | Invalid parameters. |
| DISK_NOT_READY | Disk not initialized. |
| DISK_IO_ERR | Hardware read failure. |
| void set_con | ( | void | ) |
Initializes the console subsystem.
Performs required hardware or buffer initialization and prepares the console for output operations.
Must be called before using any other console function.
| uint8_t write_disk | ( | void const * | buffer, |
| size_t | did, | ||
| size_t | blck, | ||
| size_t | blocks | ||
| ) |
Writes blocks to disk.
| [in] | buffer | Source buffer. |
| [in] | did | Disk identifier. |
| [in] | blck | Starting block index. |
| [in] | blocks | Number of blocks to write. |
| DISK_IO_OK | Write successful. |
| DISK_WRITE_PROTECT | Media is write-protected. |
| DISK_INVALID | Invalid parameters. |
| DISK_NOT_READY | Disk not initialized or media not ready |
| DISK_IO_ERR | Hardware write failure. |
|
extern |
Maximum horizontal coordinate of the console.
Represents the maximum valid X coordinate (column index). Valid cursor X positions range from 0 to (MAX_X - 1).
|
extern |
Maximum vertical coordinate of the console.
Represents the maximum valid Y coordinate (row index). Valid cursor Y positions range from 0 to (MAX_Y - 1).