Skip to content
Lightweight & operational Linux-inspired OS.
C Assembly Python Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
filesystem Remove legacy testing code Oct 28, 2018
kernel Add BLOCKING_WAIT macro to simplify manual sleep loops Aug 1, 2019
userspace Use is_memory_accessible instead of checking KERNEL_PAGE May 4, 2019
.gitattributes Add detailed evil test output Aug 26, 2017
.gitignore Logically refactor directory hierarchy Sep 23, 2018
README Update readme Jan 23, 2019
build.sh Fix fseek with readahead Apr 7, 2019
createfs.py Add zero and random files Oct 25, 2018
diskgen.sh
elfconvert Start working on taux + serial driver Aug 14, 2017
filesys_img Logically refactor directory hierarchy Sep 23, 2018
music.sh Rename scripts Sep 23, 2018
orig.img Logically refactor directory hierarchy Sep 23, 2018

README

    __      ________  _____
   / /___  / /_/ __ \/ ___/
  / / __ \/ / / / / /\__ \
 / / /_/ / / / /_/ /___/ /
/_/\____/_/_/\____//____/
A small + lightweight OS

This is a Linux-like x86 operating system built from scratch.
It was originally a course project at the University of Illinois
at Urbana-Champaign. The original release included support for:

- virtual memory
- PS/2 keyboard
- real-time clock
- read-only filesystem
- terminal I/O
- userspace execution
- preemptive multitasking

Since then, the following additional features have been added:

- signals
- PS/2 mouse
- serial I/O (Taux controller)
- userspace libc
- audio playback (Sound Blaster 16)
- malloc (both kernel and userspace)
- networking (NE2000 + ARP + IP + UDP + TCP + DNS)
- fork, exec, wait
- pipes
- writable in-memory filesystem

Note that this is a Linux-like operating system, not a Linux-compatible
operating system. It is neither API nor ABI compatible with Linux, and
the userspace libc is not standards-compliant either. This OS is not
intended to be used in a production environment; it is for educational
purposes only. Notable differences from Linux are:

- minimal filesystem (no subdirectories, permissions, attributes, etc.)
- no users or groups (essentially, everyone is root)
- some APIs take different arguments (e.g. gets takes a buffer size)
- syscalls return errors directly as negative values instead of via errno
- floating point (x87, SSE, etc.) is not supported by the ABI
- math.h, wchar.h, time.h, and a few other libraries are not implemented

To compile the OS, boot a Linux system and run the build.sh script. To add
userspace programs to the filesystem, add the source code to the userspace
directory and they will automatically be compiled into the filesystem image.
For static (non-code) files, just add them directly to the filesystem
directory. Note that the total size of this directory should not exceed
~3MB, or else the OS will fail to boot.

Do not attempt to boot the OS on real hardware - it will almost certainly
not work, and might even set your computer on fire. It has only been tested
in QEMU.

Below is a short description of the source tree contents:

filesystem/
    This directory contains the base filesystem files (excluding the ones
    generated by compiling the userspace programs).

kernel/
    This directory contains the kernel source code.

userspace/
    This directory contains the source code for the userspace programs.
    The lolibc subdirectory contains the userspace libc implementation.

build.sh
    This script builds the entire project, including the kernel and all
    userspace programs. Run it with the optional "clean" argument to
    delete all object files. Run it with "run" to also boot QEMU after a
    successful build. The "-c" (compat) flag can be used to boot the
    original filesystem image (filesys_img). The "-n" (nobuild) flag
    can be used to prevent the script from recompiling the OS.

music.sh
    This script runs a TCP music streaming server. It takes the path to
    an audio file as an argument, converts it into WAV format, and serves
    it at port 7878 on the host. To play the music within the VM, connect
    to 10.0.2.2:7878 using the nc program and pipe the output to the music
    program.
You can’t perform that action at this time.