Skip to content

A bare metal ARM OS for the Raspberry Pi Zero written from scratch

Notifications You must be signed in to change notification settings

UphillD/ARMadillo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARMadillo logo

status: working build: passing

arch: armv6 cpu: arm1176jzf-s platform: raspberry pi zero

A minimal ARM OS for the Raspberry Pi Zero.

This is my personal bonus project for the course "Embedded Systems Design" [ECE1258].

Table of Contents

  1. Features
  2. Demo Console
  3. Requirements
  4. Installation
  5. Project Tree
  6. References
  7. Resources
  8. Miscellaneous

Features

Currently, it:

  • Boots,
  • Communicates using the serial port UART0,
  • Utilizes peripherals (ARM/64-bit Timer, LED),
  • Utilizes the floating point coprocessor,
  • Serves interrupts,
  • Manages the memory,
  • Implements Virtual Memory,
  • Performs context switches,
  • Utilizes spinlocks and mutex.

Demo Console

Once the OS is launched and everything is initialized, execution is passed to a demonstration console that can be accessed through /dev/ttyUSB0.

The demo console accepts a few commands:

help
	Displays a list of available commands
intr
	Setups a repeatable IRQ interrupt that blinks the LED light of
	the Pi once every second.
proc
	Setups the scheduler, launches a kernel and a user process and
	switches between them seamlessly.
lock
	Same as proc, but also utilizes mutex locks.
	Control is still switched continuously between the two processes;
	however, they share a lock, and they sequentially un/lock it.
fpuo
	Performs a floating point operation using the floating point coprocessor.
	Proof can be found in the kernel.list file that is produced during
	compilation if one looks for the fpu_mult details.
	Note that separate function must be used to produce the result
	(fpu_mult in common/stdlib.c), otherwise the compiler just
	precalculates the result.

Requirements

  1. A Raspberry Pi Zero (stock, W or WH model),
  2. A USB-to-TTL Serial Cable,
  3. A properly formatted SD Card,
  4. A Serial Console (dterm, minicom, screen).

Installation

Manual

  1. Clone the repository.
  2. cd build
  3. make
  4. Copy the resulting kernel.img to the first partition of your SD Card.

Automatic

  1. Clone the repository.
  2. Plug your SD Card in.
  3. cd scripts
  4. ./makerLoader.sh

Project Tree

$root
├ build
├ common
├ docs
├ drivers
├ include
│    ├ common
│    └ drivers
├ kernel
└ scripts

References

ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition

ARM1176JZF-S Technical Reference Manual, revision r0p7

BCM2835 ARM Peripherals

Resources

OSDev.org RaspberryPi Tutorial

RaspberryPi Zero BareMetal Examples by dwelch67

Building an OS for the RaspberryPi by jsandler18

Miscellaneous

Coding style mostly follows the linux kernel coding style.

Shield badges provided by Shields.io.

⇯ Back to Top