Skip to content
/ os Public

A simple operating system for raspberry pi

Notifications You must be signed in to change notification settings

A1Liu/os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

os

  • Architecture Target: 64-bit ARMv8, i.e. aarch64/arm64
  • Hardware Target: Michelle's Pi 3 Model B
  • RAM: 1GB

Build Dependencies

  • Zig Compiler
  • LLVM for llvm-objdump and lldb
  • QEMU for running in a virtual machine

Useful Commands

  • Dump out the kernel ELF file:

    llvm-objdump --arch-name=aarch64 -D ./zig-out/bin/kernel.elf > ./obj.txt
    
    # Or use Zig:
    zig build dump
    
  • Run the kernel in QEMU:

    qemu-system-aarch64 -M raspi3b -serial null -chardev stdio,id=uart1 -serial chardev:uart1 -kernel ./zig-out/bin/kernel8.img
    
    # Or use Zig:
    zig build run
    

Useful Resources

Doc Sources

Code Organization

Concept Location
Boot-up src/boot.S
System Timer src/interrupts.zig
Interrupt Vectors src/interrrupts.zig
Page Table Init src/boot.S
MMU Protections src/memory.zig
Page Allocator src/memory.zig
Task Scheduler src/scheduler.zig
Mini-UART Handler src/mmio.zig
Linker Script src/link.ld
Frame Buffer src/framebuffer.zig
Mailboxes src/mmio.zig

To Do

  • Safety
    • Fix timer overflow
  • Allocator
    • safety checks in allocator
    • handle GPU memory addresses in the allocator
  • Debugging
    • switch from mini-uart to uart
    • receive data in UART
    • Debug shell
  • Userspace Exe
    • remove identity mapping
    • FAT32 handler
    • syscalls and user-space executables
    • page mapping utilities
    • various IPC queues at different levels of overhead
  • File storage as an extension of 64-bit memory
    • The kernel sees file data as basically just an extended page table
    • We can build file tree stuff on top, but the underlying implementation allows you to access pages of a file at a time by simply accessing memory normally.

About

A simple operating system for raspberry pi

Resources

Stars

Watchers

Forks