A freestanding hardware abstraction library for LitziumOS, providing portable access to UART, GPIO, timers, display, and interrupt handling across multiple platforms.
litzfw currently supports:
- x86-64 — UART (16550), Timers (PIT)
- Raspberry Pi 3/4 — UART (PL011), GPIO (BCM), Timers (BCM), Display (VideoCore mailbox)
- Hardware Abstraction Layer (HAL) — Clean interfaces for common peripherals
- Freestanding — No dependencies on standard library or operating system services
- Modular drivers — Pluggable implementations for different SoCs and platforms
- Interrupt handling — IRQ management and routing
- Multi-platform — Shared abstractions across ARM and x86 architectures
- CMake 3.10+
- C compiler (GCC, Clang, or compatible)
- Make or Ninja build system
cmake -B build
cmake --build buildThe library produces a static archive that can be linked into your baremetal or kernel project.
litzfw is organized into three main components:
Defined in hal/, these headers provide platform-agnostic interfaces:
hal_uart.h— Serial communicationhal_gpio.h— General-purpose I/Ohal_timer.h— Timing and periodic interruptshal_display.h— Display outputhal_irq.h— Interrupt handlinghal_i2c.h— I2C bus (planned)hal_spi.h— SPI bus (planned)
Implementations in drivers/ and bsp/:
- drivers/ — Device drivers (UART, GPIO, timer implementations)
- bsp/ — Board Support Package with platform-specific initialization
Infrastructure in include/:
litzfw_types.h— Common typeslitzfw_mmio.h— Memory-mapped I/O utilitieslitzfw_compiler.h— Compiler-specific macros and attributes
To port litzfw to a new platform:
- Create a new BSP directory in
bsp/ - Implement platform initialization (
bsp_*.c) - Implement or reuse device drivers in
drivers/ - Update CMakeLists.txt to include new platform
See LICENSE for details.