Skip to content
This repository was archived by the owner on May 28, 2026. It is now read-only.

thelitzproject/litzfw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

litzfw

A freestanding hardware abstraction library for LitziumOS, providing portable access to UART, GPIO, timers, display, and interrupt handling across multiple platforms.

Platform Support

litzfw currently supports:

  • x86-64 — UART (16550), Timers (PIT)
  • Raspberry Pi 3/4 — UART (PL011), GPIO (BCM), Timers (BCM), Display (VideoCore mailbox)

Features

  • 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

Getting Started

Prerequisites

  • CMake 3.10+
  • C compiler (GCC, Clang, or compatible)
  • Make or Ninja build system

Building

cmake -B build
cmake --build build

The library produces a static archive that can be linked into your baremetal or kernel project.

Architecture

litzfw is organized into three main components:

HAL (Hardware Abstraction Layer)

Defined in hal/, these headers provide platform-agnostic interfaces:

  • hal_uart.h — Serial communication
  • hal_gpio.h — General-purpose I/O
  • hal_timer.h — Timing and periodic interrupts
  • hal_display.h — Display output
  • hal_irq.h — Interrupt handling
  • hal_i2c.h — I2C bus (planned)
  • hal_spi.h — SPI bus (planned)

Drivers

Implementations in drivers/ and bsp/:

  • drivers/ — Device drivers (UART, GPIO, timer implementations)
  • bsp/ — Board Support Package with platform-specific initialization

Core

Infrastructure in include/:

  • litzfw_types.h — Common types
  • litzfw_mmio.h — Memory-mapped I/O utilities
  • litzfw_compiler.h — Compiler-specific macros and attributes

Porting to a New Platform

To port litzfw to a new platform:

  1. Create a new BSP directory in bsp/
  2. Implement platform initialization (bsp_*.c)
  3. Implement or reuse device drivers in drivers/
  4. Update CMakeLists.txt to include new platform

License

See LICENSE for details.

About

DEPRECATED: Freestanding hardware abstraction library for LitziumOS: UART, GPIO, timer, display, and IRQ HAL with drivers for x86-64 (16550/PIT) and Raspberry Pi 3/4 (PL011/BCM/VideoCore mailbox)

Resources

License

Stars

Watchers

Forks

Contributors