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.
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
uart.h File Reference

PL011 UART hardware abstraction layer. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for uart.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uart_device
 Hardware abstraction for a UART device. More...
 

Typedefs

typedef struct uart_device uart_device_t
 Hardware abstraction for a UART device.
 

Functions

void pl011_init (uart_device_t *dev, uintptr_t base)
 Initialize a UART device struct.
 
bool pl011_register_handler (uart_device_t *dev)
 Register the PL011 UART receive interrupt handler with the ICU.
 

Detailed Description

PL011 UART hardware abstraction layer.

Declares the device struct and initialisation function for the ARM PL011 UART used as the kernel's early serial console.

Author
Abhin Parekadan Jose
Date
2026-04-25

Function Documentation

◆ pl011_init()

void pl011_init ( uart_device_t dev,
uintptr_t  base 
)

Initialize a UART device struct.

Parameters
devPointer to the device struct to initialize.
baseMMIO base address.

◆ pl011_register_handler()

bool pl011_register_handler ( uart_device_t dev)

Register the PL011 UART receive interrupt handler with the ICU.

Installs pl011_rx_handler into the ICU dispatch table for INTID 33 (the UART SPI on QEMU virt) and enables the interrupt in the GIC. After this call, any character received on the UART will trigger pl011_rx_handler which echoes it back.

Parameters
devPointer to the PL011 UART device struct to register. Passed as private_data to the handler on each invocation.
Returns
true if the handler was registered successfully, false if INTID 33 is already registered or GIC configuration failed.