Skip to content

BlueFalconHD/gizmOS

Repository files navigation

gizmOS

A RISC-V 64-bit kernel written in C

gizmOS is a minimal RISC-V 64 kernel that provides foundational OS capabilities with a focus on hardware abstraction and memory management.

Features

  • Hardware interfaces

    • UART for serial communication
    • Framebuffer support with flanterm terminal emulation
    • Real-time clock (RTC)
    • Platform-Level Interrupt Controller (PLIC)
  • Memory management

    • Physical page allocator
    • Virtual memory with SV39 paging
    • MMIO mapping
  • System facilities

    • Formatted output (printf-like functionality)
    • String manipulation
    • Time functions with sleep capabilities
    • Basic math functions
  • Exception and interrupt handling

    • Trap framework
    • External interrupts
  • Device Tree Blob (DTB) parsing

    • Initial loading and parsing via smoldtb
    • Hardware detection support
  • Testing framework

    • Physical allocator tests
    • Trap/exception tests

Building

Prerequisites

  • LLVM/Clang toolchain (with RISC-V support)
  • GNU Make
  • LLD linker

First, download the dependencies:

cd kernel/
chmod u+x get-deps
./get-deps

Note

You may need to adjust the compiler path in kernel/GNUmakefile to match your system configuration.

To build the kernel:

make

To build the kernel and run it in QEMU:

make run

If you desire to enable debugging features, uncomment the DEBUG := 1 line in kernel/GNUmakefile and GNUmakefile. Then, you can use make run and also use ./dbg.sh to automatically attach LLDB to gizmOS and set a breakpoint on the trap handler.

Project Structure

  • kernel/ - Kernel source code
    • src/ - Main source files
      • device/ - Device drivers (UART, framebuffer, console, PLIC, RTC)
      • dtb/ - Device Tree Blob parsing
      • lib/ - Core libraries (memory, strings, time, math, formatting)
      • extern/ - External libraries
        • flanterm/ - Framebuffer terminal
        • smoldtb/ - Device tree parser
      • tests/ - Test suites for various components
      • *.c/*.h - Core kernel implementation (memory management, paging, etc.)

Development

gizmOS is a work in progress. Key areas for future development include:

  • Advanced memory allocation (beyond basic page allocation)
  • Process management
  • Filesystem support
  • More comprehensive device drivers
  • User-space support

Contributions are welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published