Coder Social home page Coder Social logo

stjepanpoljak / raspios Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 112 KB

A DIY operating system for the Raspberry Pi bootable from Supervisor or Hypervisor (tested on U-Boot). Featuring MMU and memory (heap) allocator.

Makefile 0.68% Assembly 14.97% Shell 0.66% C 63.02% Python 5.44% CMake 2.64% Haskell 12.58%
aarch64 operating-system operating-system-learning uart raspberry-pi memory-allocator mmu

raspios's Introduction

RaspiOS

This is a little playground for AArch64 assembly on Raspberry Pi 3B+ (BCM2837B0 ARM Cortex A-53). It can be used and tweaked to bootstrap development on the chip. Current features are:

  • run from U-boot
  • run from EL3 or EL2
  • UART functionality
  • print string and hex with customizable callbacks (here as UART)
  • exception / interrupt vector table
  • timer functionality
  • memory heap allocation
  • basic MMU mapping
  • basic GPU interface

Cross Compiler

RaspiOS uses the aarch64-none-elf cross compiler available on ARM toolchain download site. This should be installed automatically by the build system. However, you can always try and avoid installation anxieties by running ./install-cc.sh before starting the build.

Configuration

You can use various options to build the OS, and the default values are already defined in config.txt file. Options for early start:

CONFIG_STACK_SIZE=0x1000
CONFIG_VA_BITS=39
CONFIG_SECURE=0
CONFIG_GRANULE_SIZE=4KB

The CONFIG_SECURE is about to be obsolete, and CONFIG_VA_BITS and CONFIG_GRANULE_SIZE aren't yet properly adapted to other values. There are also two more options for memory allocator debug:

  • CONFIG_MEM_TESTS - run some basic unit tests on memory initialization
  • CONFIG_MEM_TRACE - print detailed debug information on memory operations
  • CONFIG_MBOX_TRACE - trace mailbox functionality

Note: You can disable these last options simply by commenting them out with # sign.

Build

To build RaspiOS, simply run:

mkdir build
cd build
ARCH=aarch64 cmake ..
make

Known issues

  • GPU drivers are not working in QEMU (could be just temperature sensor, though)
  • timer triggers IRQ handler twice

raspios's People

Contributors

stjepanpoljak avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.