Back to Projects

Bare-Metal Embedded OS for Mango Pi

Low-level embedded system stack for the Mango Pi MQ-Pro.

Winter 2026|
CRISC-V AssemblyDriversGraphicsInterrupts
Bare-Metal Embedded OS for Mango Pi

Overview

Built a bare-metal system stack for the Mango Pi MQ-Pro, implementing low-level drivers, memory management, console I/O, graphics, and input devices.

What I Built

  • GPIO and timer support
  • UART/console I/O
  • Custom printf and string libraries
  • Heap allocation and memory-management routines
  • Framebuffer graphics library
  • PS/2 keyboard and mouse drivers
  • Interrupt-driven input
  • Shell commands and command history
  • Hardware floating-point support
  • Mouse-controlled paint application

Technical Details

The project involved writing C and RISC-V assembly for bare-metal hardware. The system interacted directly with memory-mapped peripherals, implemented low-level I/O, supported framebuffer graphics, and handled keyboard/mouse input. The stack eventually supported higher-level interactive programs such as a shell and paint application.

My Role

Daniel implemented the core drivers, graphics pieces, memory utilities, shell functionality, interrupt-driven input, and debugging workflows.

Challenges and Debugging

  • Debugging custom printf behavior
  • Debugging malloc/heap behavior
  • Working directly with memory layout and startup code
  • Interfacing with PS/2 keyboard and mouse protocols
  • Using signal/data analysis to debug return signals from external input devices
  • Optimizing graphics routines and rendering behavior

Results

  • Functional bare-metal embedded stack
  • Interactive console shell
  • Framebuffer graphics and mouse-controlled paint app
  • Interrupt-driven input support

Tools and Skills

CRISC-V AssemblyMango Pi MQ-ProUARTGPIOInterruptsFramebuffer GraphicsPS/2MakefilesVim