Sortix

Sortix

Sortix is a small self-hosting Unix-like operating system developed since 2011 aiming to be a clean and modern POSIX implementation. There's a lot of technical debt that needs to be paid, but it's getting better. Traditional design mistakes are avoided or aggressively deprecated by updating the base system and ports as needed. The Sortix kernel, standard libraries, and most utilities were written entirely from scratch. The system is halfway through becoming multi-user and while security vulnerabilities are recognized as bugs, it should be considered insecure at this time.

Sortix 0.9 was released on December 30, 2014. It is a very considerable improvement upon Sortix 0.8 and contains significant improvements all over the base system and ports. The previous release made Sortix self-building and this release works hard towards becoming fully self-hosting and installable. Several real-life prototype self-hosting installations of Sortix exists right now, I expect the following 1.0 release to make real Sortix installations available to the general public.

The Sortix 0.9 release has 144k lines of source code (released 30 Dec 2014), version 0.8 had 117k lines of source code (released 19 Dec 2013), version 0.7 had 43k lines of source code (released 10 Sep 2012), version 0.6 had 30k lines of source code (released 18 Mar 2012), version 0.5 had 23k lines of source code (released 06 Dec 2011), while 0.4 had 16k (released 08 Sep 2011), and version 0.3 only had 8k (released 28 May 2011). Development of Sortix began around 8 Feb 2011.

Sortix is available for ix86 and x86_64 systems.

Features

Here is an overview of some of the features in Sortix:

  • Everything is part of an coherent whole.
  • Homemade kernel.
  • Homemade libc.
  • POSIX implementation.
  • NetBSD's libm (will likely be replaced by musl's libm).
  • Homemade shell utility programs.
  • Shell environment with common Unix programs.
  • Documentation and user guides.
  • Games (asteroids, quake).
  • C and C++ compilers.
  • Development headers and libraries are included.
  • Text editor.
  • Unicode support.
  • System source code is included.
  • Ports of third party programs and libraries.
  • User-space filesystems.
  • ext2 filesystem support.
  • mbr partition table support.
  • PATA PIO harddisk driver (AHCI driver not merged yet).
  • Memory mapped IO.
  • Unix sockets.
  • Kernel debugger.
  • Non-blocking IO.
  • Date and time support.
  • Process groups.
  • chroot.
  • Line editing in the shell.
  • Pthreads.
  • #! magic sequence supported.
  • Unix Signals.
  • Symbolic links.
  • Regression tests.
  • BGA graphics driver for virtual machines.
  • Incorporates Sortix libz, a clean fork of zlib.

Naturally, this is hardly all of the features. You should read the user guide for a list of features and how to use the system.

The latest release includes these ports of third party software: binutils, bison, bzip2, dash, diffutils, gawk, gcc, git, grep (GNU), gzip (GNU), hello (GNU), libffi, libgmp, libiconv, libmpc, libmpfr, libSDL, libstdc++, libz (GNU), make (GNU), patch (GNU), quake, sed (GNU), tar (GNU), and xz. More ports are available in source form only.

Missing Features

It's important to understand what limitations Sortix has. Most of these areas are being worked on, but their completion was cut from this release.

  • Lots of missing features in the shell.
  • No desktop environment with a graphical user interface.
  • No man pages (next release will use mdocml).
  • No mouse driver.
  • There is only a single terminal.
  • No SATA harddisk driver (driver not merged yet).
  • No sound drivers.
  • No graphic drivers for real hardware.
  • No shared memory mapping mappings.
  • No networking except Unix sockets.
  • No Unicode font rendering (outside code page 437).
  • No proper terminal implementation (curses is not possible yet).
  • No real users and groups implementation.
  • No dynamic linking.
  • And a bunch of bugs.

Nonetheless, the underlying system is advanced and the standard library implements enough standard interfaces that has been possible to port a large amount of third party software.

System Requirements

Sortix has low system requirements. It also works well under virtual machines such as VirtualBox and Qemu - however Bochs is not officially supported:

  • A 32-bit x86 (with SSE) or 64-bit x86_64 CPU.
  • You likely need twice as much RAM as the size of the initrd, i.g. the size of the bootable disk. 1 GiB RAM is recommended.
  • A harddisk or cdrom drive or support for booting from USB.
  • A multiboot compliant bootloader if booting from harddisk.
  • A Parallel ATA harddisk, if you wish to access it from Sortix. The AHCI driver has not been merged yet.

Known Problems

There's a few important problems that you should know of:

  • GRUB may simply lock up with no message if you don't provide enough memory.
  • Quake save games doesn't work as printf doesn't support floating point numbers yet, you will be unable to load saved games.

Builds and Downloads

You can boot Sortix from a CD-ROM ISO (recommended), install the kernel manually by extracing a tarball and configuring the bootloader manually, or compile the source code yourself. I recommend burning Sortix to a CD/DVD/USB or booting it using a virtual machine such as VirtualBox or Qemu. The builds are compressed using the xz algorithm and needs to be decompressed before use.

Be sure to consult the system requirements and the known problems above.

You can download the latest stable release of Sortix from https://users-cs.au.dk/~sortie/sortix/release/0.9/builds/.

You can download the full source code of the latest stable release from https://users-cs.au.dk/~sortie/sortix/release/0.9/.

Development Code

You can retrieve the current git master from our project page. You can find the source for the latest release in the sortix-0.9 tag or the current development status in the master branch.

Unstable Nightly Builds

These builds are development snapshots towards the next release of Sortix. They often contain more features and better code than the stable versions, but may be unstable and may not work correctly.

You can download the nightly builds from https://users-cs.au.dk/~sortie/sortix/release/nightly/.

Previous releases

You can download older releases of Sortix from https://users-cs.au.dk/~sortie/sortix/release/. Please note that these are no longer supported.

Running Sortix from a CD

Simply download the bootable CD image, decompress it, burn it to a CD/DVD/USB, set up your BIOS to boot from CDs/DVDs/USBs first, put the medium in your computer and reboot.

On GNU/Linux you can burn the CD image directly to an USB stick by running:

unxz sortix_0.9_x86_64.iso.xz &&
sudo dd if=sortix_0.9_x86_64.iso of=/dev/sdx

where sdx is the device name of your USB stick. This will wipe the file system on the device and replace it with the CD filesystem. To recover your USB, simply format a new filesystem upon it. Please note that this process will destroy all the current data on the USB, but it does save you from using a recordable CD.

Running Sortix with QEMU

You can easily run a bootable disk image with the qemu virtual machine. Depending on which CPU you wish to emulate, run something like:

unxz sortix_0.9_x86_64.iso.xz &&
qemu-system-x86_64 -m 1024 -vga std -cdrom sortix_0.9_x86_64.iso

Or:

unxz sortix_0.9_i486.iso.xz &&
qemu-system-i386 -m 1024 -vga std -cdrom sortix_0.9_i486.iso

Pass the -enable-kvm option if supported for performance. Boot time may improve if you pass -drive file=sortix.iso,if=virtio,cached=off instead of the -cdrom option.

Technical details

The system is written in C++ and C-like C++ and uses the System V ABI with some improvements. Programs are statically linked as dynamic linking has not yet been implemented. The system is developed using the GNU compiler toolchain. The kernel complies with the multiboot standard and is easily bootable using GRUB.

Documentation

The basic usage of the Sortix system has been carefully documented in the official User Guide.

You can read the entire documentation library for the latest release at https://users-cs.au.dk/~sortie/sortix/release/0.9/doc/.

Participation in Development

You can either attempt to develop the system using itself (not recommended yet) or by following the cross-development tutorial (recommended). You need a reasonably GNU-like operating system as the build system liberally uses useful GNU extensions planned for inclusion in Sortix.

Development is coordinated in the #sortix IRC channel at irc.freenode.net.

See also the official task list at the Sortix Wiki.

Ports Collection

Sortix has a collection of 50+ pieces of ported third party software. These ports are maintained as upstream tarballs plus patches, packed up in its own tarball and stored in a git repository. The Sortix Wiki has a page detailing every port.

You can download port tixes, tarballs of upstream tarballs and patches, for the development version at the porttix repository. See the release directory for port tixes matching a particular release.

You can download source tixes, tarballs of upstream code with patches applied, for the development version at the srctix repository. See the release directory for sources tixes matching a particular release. These tarballs are designed to be extracted into ports/ and will be automatically built along with the rest of the system.

Patches are extracted nightly from the port tix repository and dumped into the nightly patch directory.

Screenshots

You can view the collection of odd screenshots of Sortix at https://users-cs.au.dk/~sortie/sortix/screenshots/. Please keep in mind this collection has grown over the years and many screenshots accurately represent the current state of things - some screenshots show experimental features that might never have been released or finished.

See also the screenshots of crashes and things gone terribly wrong at https://users-cs.au.dk/~sortie/sortix/crazy-os/.

License

Copyright(C) Jonas 'Sortie' Termansen sortie@maxsi.org and contributors 2011, 2012, 2013, 2014.

Sortix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING-GPL and COPYING-LGPL files for more information.

See the individual files for copyright terms. If a file does not contain a license header, you can assume it is released under the GNU General Public Licenser, either version 3 or (at your option) any later version. This includes Sortix-related experimental branches and repositories found on GitLab: these things are so experimental that I might not have added copyright statements.

The build scripts might not contain a copyright license in which case they are covered by the standard license for the software component they relate to.

Unless the license header in the source code states otherwise, the Sortix kernel, the filesystem servers, the initrd tools, the utilities, the games, the benchmark programs, regression tests, base programs, editors, shell, init, and the tix package management programs are licensed under the GNU General Public License, either version 3 or (at youroption) any later version.

Unless the license header in the source code states otherwise, the libc library, the libpthread library, and the libdispd library are licensed under the GNU Lesser General Public License, either version 3 or (at your option) any later version.

The Sortix math library (libm) is licensed as described in the libm/LEGAL file.