|
Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
|
Diagnostic and emergency error handling routines. More...

Functions | |
| void | print_uart0 (const char *str) |
| Transmits a null-terminated string over UART0. | |
| void | print_hex_digit (uint8_t digit) |
| Converts a 4-bit nibble to a hex character and prints it. | |
| void | print_hex (uint64_t val) |
| Prints a 64-bit unsigned integer in hexadecimal format. | |
| void | panic_print_c (long code) |
| Primary C-level panic entry point. | |
Variables | |
| volatile unsigned int *const | uart0_dr = (unsigned int *)0x09000000 |
| UART0 Data Register (MMIO). | |
Diagnostic and emergency error handling routines.
Provides low-level UART output and panic handling routines used when the kernel encounters unrecoverable failures.
| void panic_print_c | ( | long | code | ) |
Primary C-level panic entry point.
This function is typically called by the assembly panic_print macro. It outputs the numeric error code, resolves the human-readable error string, and indicates system halt.
| code | The numeric error code representing the failure type. |
| void print_hex | ( | uint64_t | val | ) |
Prints a 64-bit unsigned integer in hexadecimal format.
Iterates through the 64-bit value 4 bits at a time from most significant bit to least significant bit.
| val | The 64-bit value to be printed. |
| void print_hex_digit | ( | uint8_t | digit | ) |
Converts a 4-bit nibble to a hex character and prints it.
| digit | The digit to print (0-15). |
| void print_uart0 | ( | const char * | str | ) |
Transmits a null-terminated string over UART0.
This function performs a simple polling-based write. It does not check for FIFO status (TX Full), assuming the baud rate/buffer is sufficient for early boot strings.
| str | A pointer to the null-terminated ASCII string to be printed. |
| volatile unsigned int* const uart0_dr = (unsigned int *)0x09000000 |
UART0 Data Register (MMIO).
This pointer accesses the hardware's transmit/receive buffer. It is marked 'volatile' to prevent the compiler from optimizing out repeated writes to the same memory location, which are necessary for hardware communication.