Skip to content
/ loliOS Public

Lightweight & operational Linux-inspired OS.

Notifications You must be signed in to change notification settings

apsun/loliOS

Repository files navigation

    __      ________  _____
   / /___  / /_/ __ \/ ___/
  / / __ \/ / / / / /\__ \
 / / /_/ / / / /_/ /___/ /
/_/\____/_/_/\____//____/
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. Since then, numerous additional features have been
implemented, including:

- signals
- audio playback
- dynamic memory allocator
- TCP/IP network stack
- pipelines (fork/exec/wait/pipe)
- writable in-memory filesystem
- graphical framebuffer
- ... and more!

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)
- 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. Run it with "debug" to launch GDB and attach to a
    running QEMU instance.

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.

video.sh
    This script runs a TCP video streaming server. It takes the path to
    a video file as an argument, converts it to our homebrew ELVI format,
    and serves it at port 8989 on the host. On the VM side, use the
    `video` program to watch the video.

About

Lightweight & operational Linux-inspired OS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published