The CROCOS kernel

What is CROCOS ?
Implementation philosophy
Documentation
Download

What is CROCOS ?

CROCOS is a small UNIX-like kernel for x86/x86_64 systems, distributed under the GNU General Public License version 3, designed with simplicity in mind, for educational purposes. It is developed in several steps to allow people to understand how a tiny operating system can be built from scratch.

CROCOS is written in C and assembly language when needed. GNU gcc and make are used for compilation, as well as some others traditional UNIX tools.

For the moment, CROCOS is only a tasks manager, running inside a Linux process. In the future, other important kernel modules may be added (like a file system, a memory manager or an applications loader...), as well as the ability to boot CROCOS on a real machine (or an emulator).

CROCOS development is cut into disctinct phases. A main phase can include sub-phases. By comparing the code between two successive phases, it is possible to extract the subset of code implementing a given feature. As of the current development, CROCOS implementation follows the following phases:

• phase 1: libc for the kernel

• phase 2: tasks manager

• phase 3: read only file system

A description of each phases can be found in the documentation ( Description of development phases in CROCOS ).

Implementation philosophy

Handmade kernels are often implemented by starting with the boot sequence, and then, building and debugging the different kernel components on a "naked" machine or emulator.

I don’t find this approach convenient at all. I agree it is very exciting to boot a small program from an external drive, and print a message on the screen by writing characters directly into the video memory. The main issue with that is that implementing sensitive kernel components require robust and reliable debugging facilities, which one do not have at this point.

What could provide better debugging facilities than Linux itself ? The main idea used in CROCOS in early development phases is to run a multiprocesses environment inside one Linux process. This is achieved by using the standard setjmp and longjmp functions to perform task switching. This way, it is possible to implement a maximum of features with the comfort of Linux for debugging and tests. CROCOS will be run on a "naked" box only when it will be absolutely needed to go further.

Documentation

CROCOS documentation is available in plain text or HTML files. Here is the list of all available documents:

Description of development phases in CROCOS

This document describes the features implemented in each development phase and sub-phase.

How to build, test and use CROCOS

Understanding CROCOS source code

This document explains how the CROCOS source code is organized and gives hints to port CROCOS on others architectures.

Description of CROCOS system calls and conventions

All the system calls provided by CROCOS are detailed in this document, as well as conventions needed to develop user space programs run by CROCOS.

Download

CROCOS is hosted on SourceForge. The source code can be downloaded from the project page