Skip to content

garbsam97/ARM_OS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARM_OS

ARM_OS is a small educational operating system for ARM, currently targeting the QEMU vexpress-a9 machine with a Cortex-A9 CPU.

The project is built from scratch and includes a custom boot path, high-half kernel, basic memory management, user-space process support, syscalls, a framebuffer-backed TTY, an initramfs, and an early VFS/filesystem layer.

Current Features

  • ARMv7 Cortex-A9 target
  • QEMU vexpress-a9 support
  • Custom bootloader
  • High-half kernel mapping
  • MMU setup
  • Physical and virtual memory management
  • Kernel heap
  • User task loading and scheduling
  • Basic syscall layer
  • User-space programs
  • Initramfs support
  • Early VFS layer
  • Dummy filesystem and dummy disk image
  • Console backend abstraction
  • Framebuffer console using PL111
  • TTY-backed standard input/output/error
  • UART RX interrupt-driven input
  • Kernel log output through UART
  • Kernel log ring buffer exposed through /dev/klog
  • User-space dmesg-style log reader
  • Timer-based scheduling
  • Sleep syscalls
  • Basic kernel watchdog
  • Minimal libc-like user library

Repository Layout

bootloader/        Early boot code
kernel/arch/arm/   ARM-specific startup, vectors, IRQ, MMU code
kernel/core/       Kernel entry, scheduler, panic, watchdog, boot info
kernel/mm/         Physical memory, virtual memory, heap, user access
kernel/proc/       User task and program loader support
kernel/sys/        Syscall dispatch and syscall implementations
kernel/fs/         VFS, initramfs, dummy filesystem, dummy disk
kernel/drivers/    UART, framebuffer and low-level device drivers
kernel/console/    Kernel/user-visible console support
kernel/time/       Kernel time and sleep support
userlib/           Minimal libc-like user-space library
user/programs/     User-space programs
tools/             Host-side image generation tools

Requirements

You need an ARM bare-metal toolchain and QEMU:

arm-none-eabi-gcc
arm-none-eabi-as
arm-none-eabi-ld
arm-none-eabi-objcopy
qemu-system-arm
python3
make

On macOS, these are typically available through Homebrew.

Build

make

This builds:

  • the bootloader
  • the kernel
  • user-space programs
  • the initramfs image
  • the final boot image

Run

Serial-only mode:

make run

Framebuffer mode:

make run-fb

On macOS, run-fb uses QEMU Cocoa fullscreen mode because the PL111 window may otherwise open too small.

Debug

Start QEMU paused with a GDB server:

make debug

Then connect with an ARM-capable GDB:

arm-none-eabi-gdb build_kernel/kernel.elf
target remote :1234

User-Space

The system currently builds a small set of user-space programs into the initramfs:

  • /init
  • /bin/console
  • /bin/cp
  • /bin/echo
  • /bin/mv
  • /bin/print
  • /bin/dmesg

User-space is linked against userlib, a small libc-like library adapted for this OS.

Roadmap

Planned work includes:

  • Cleaner kernel subsystem boundaries
  • Better boot diagnostics and hardware reporting
  • Device abstraction for character and block devices
  • Block device abstraction
  • FAT12 and FAT16 filesystem support
  • exFAT support
  • Network device abstraction
  • Ethernet, ARP, IPv4 and ICMP
  • UDP support
  • TCP/IP stack
  • More complete userland

Status

This is an experimental operating system under active development. Interfaces and internal structure are expected to change frequently.

About

A tiny ARMv7 educational operating system for QEMU vexpress-a9, with a high-half kernel, MMU, scheduler, syscalls, userland, initramfs, VFS experiments, and framebuffer console.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors