Skip to content

Gazolik/OS-RaspberryPi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RaspberryPi OS : Momo-OS

This humble operating system is designed for ARM architectured CPU on RaspberryPi. This project has been realised at INSA Lyon, France for the Operating Systems class during the fourth year in the Computer Science department. It is called Momo-OS because of our group mascot @Mohamed :D

Current progress

Implemented functionalities :

  • System calls
  • Process dispatching
  • Scheduling (with different schedulers : Round Robin, Fixed priorities, Dynamic prorities and Random)
  • Virtual memory
  • Process isolation
  • Dynamic memory allocation (malloc, realloc, free)
  • Semaphores
  • Sound driver (pwm)
  • Framebuffer (display driver), by displaying text
  • fork, wait, waitpid system calls (actually doesn't really work, no heap and stack copying. More difficult than expected)
  • Keyboard driver
  • Little shell, combining a lot of the implemented mecanisms

Usage

You can either use our OS on a real RPi or on an emulator

On qemu

You will need to install qemu :

  • git clone https://github.com/Torlus/qemu.git
  • cd qemu
  • git checkout -b raspberry origin/rpi
  • ./configure --target-list="arm-softmmu"
  • make
  • The binary is now in arm-softmmu/qemu-system-arm. Add this folder to your PATH.

The corresponding compilor : gcc-arm-none-eabi

And gdb-arm-none-eabi for debugging (at least 7.10 version) :

  • Download the 7.10 arm gdb package from the gnu package website
  • tar xzf gdb-7.10.tar.gz
  • cd gdb-7.10
  • ./configure –prefix=<install_dir> –target=arm-none-eabi –enable-tui
  • make
  • make install
  • Add <install_dir>/bin to your PATH

To launch the kernel, go to tools/.

./make_qemu.sh will compile the kernel and launch qemu

While qemu is running, launch, from another terminal, ./run-gdb.sh

You can now, step by step, go through the kernel execution. We recommand to be on the shell-fb branch, which doesn't need contain the keyboard (which is quite difficult to work with in qemu)

On RaspberryPi

Compile the kernel using make kernel_for_sdcard. Make sure the RPI constant in include/config.h is set to 1.

Then copy the generated kernel.img file on a bootable SD card.

Plug it in your RaspberryPi, plug a keyboard, a monitor and some headphones. And get started by powering the RPi.

To-do

If we had more time and not other projects, we would have done

  • Correct the fork system call
  • Make semaphore functions system calls
  • A "real" shell (with a customizable prompt, stream redirection, command chaining (pipe and stuff), shell variables, commands that are real executables, etc)
  • A file sytem
  • And a lot more

Tests

We have a no-regression framework, which is actually a simple python file which executes a list of tests and say if they pass or not.

A test is composed of a C source file (kmain...) and a gdb file (which asserts the resulting values).

You can execute a single test with tools/run-test.sh test/kmain-bidule.c test/bidule-called-twice.gdb

Credits

Made by Hexabinome H4105 2015-2016

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 87.6%
  • C++ 6.4%
  • Makefile 4.1%
  • Assembly 1.9%