Home

Awesome

<img style="float:left" src="res/logo.png" width="80" > <h1 style="float:right; display:inline-block">Mimosa</h1> <div style="clear:both"></div> <img src="res/mimosa-screenshot.png" width="600">

Introduction

The Mimosa operating system consists of a minimal kernel built on C++ and Scheme. It contains a Scheme implementation of a hard drive (ATA) driver, keyboard (PS2), serial (8250 UART), FAT32 filesystem and a small real time clock manager. The project was built to experiment with developement of operating system using a high level functional language to study the developement process and the use of Scheme to build a fairly complex system.

Organisation

The projet is divided in the following folder structure:

Required tooling

Currently, Mimosa builds with GCC 9.2.1. You will need the 32 bit tools in order to build the system (g++-multilib) as well as GNU make. Right now, the system only builds on Linux. If you want to run the OS on an emulator, the makefile provides support for qemu, in particular qemu-system-i386.

Quick-install and run instructions

Assuming you have the correct compiler setup, the following steps will build and run mimosa:

    make clean
    make single-archive # creates a booting archive in floppy.img
    make run  # requires qemu

Multiple debugging make commands are also available:

The createimg.sh script is used to create a FAT32 image that can be mounted and add necessary Scheme driver files to the archive. However, the folder archive-items will be entirely replicated on the image and so you can add other files to be accessible at boot.

You will need to have a special Gambit program compiled for the Mimosa operating system. See the next section for instructions on how to prepare the Gambit executable.

Compiled v.s interpreted Scheme drivers

Mimosa provides support for both interpreted and compiled Scheme drivers and a mix and match as you desired. The scheme folder is divided in two subfolders, where files can be moved, to determine wether the drivers (or sources of various types) are to be compiled or interpreted.

Compiled files are loaded as Gambit-provided modules and thus a new compiled version of the Gambit runtime is required everytime a change to the method of execution of a file is changed. The ./build-and-copy-gambit-to-vm.sh script will correctly build the runtime. Creating the runtime can take some time, as it requires building Gambit, compiling the Scheme sources to file with the built Gambit, and then rebuild (completely) the Gambit runtime, this time with the compiled C sources as part of the runtime.

Including a compiled file is done differently than an interpreted one.

You also need to execute make clean before starting Mimosa, as otherwise you will end up with duplicated drivers.

Dependencies

The kernel requires a compatible Gambit runtime. Currently, the modified Gambit runtime is located here. In order to build a compatible runtime, you will need the Ubuntu VM provided in this repository. Once running, you can execute the following command to create a working Gambit environement.

./build-and-copy-gambit-to-vm.sh build

This will automatically place the built executable in the right folder, so a compile cycle will then execute properly.

modifiedgambit.h

This header file is issued from the include/gambit.h.in from the custom Gambit implementation. It will require an update if the header file from the Gambit fork changes.

Developement

The project has seen many codestyles and so some parts of the code are not formatted the same. The C++ code tries to use the "llvm" format (mainly in driver and kernel files), using the clang-format utility. The Scheme code does not follow a style that has a name that I know of.

Papers & Presentations