Skip to content

aahlborg/MiOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiOS - A Raspberry Pi bare metal system

This code was written by me while trying to learn about the inner secrets of the Raspberry Pi, ARM assembler and embedded programming in general. It serves as a help for me to describe the most fundamental parts of embedded software, and I hope that it can be of use to others trying to learn about these subjects.

Building

To build this code you need an ARM bare metal toolchain. I use the gcc-arm-none-eabi toolchain that comes with Ubuntu but other versions should work just fine.

Simply running make will create a build/kernel7.img that can be copied to an SD card which has been prepared with a boot partition and the Raspberry Pi bootloader.

Emulation

Run qemu-system-arm with machine raspi2 and UART1 mapped to stdio:

qemu-system-arm -M raspi2 -serial null -serial stdio -bios build/kernel7.img

To debug the system, add -s -S to the qemu command and connect gdb-multiarch to the gdbserver

# gdb-multiarch build/kernel7.img.elf
(gdb) set arch arm
(gdb) target remote :1234

Or set up VS Code to connect using

"miDebuggerPath": "/usr/bin/gdb-multiarch",
"miDebuggerServerAddress": ":1234"

Licence

The code is provided as-is and you are free to use it for any purpose. I will provide a more formal licence soon, probably BSD.

References

Tutorials

Documentation

Multicore

Interrupts

JTAG

Similar projects

About

A Raspberry Pi bare metal system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published