Sortix

Sortix

Sortix is a small Unix-like operating system developed since 2011 with emphasis on cleaning up traditional Unix design mistakes while retaining compatibility with third party software. Much third party software has been ported to Sortix and the system is now self-building. The Sortix kernel, standard libraries, and most utilities were written entirely from scratch.

Sortix 0.8 was released on December 19, 2013. This is the first release that is self-building: All system components (except third party ports) can be fully rebuilt and installed under the system itself. Additionally the entire filesystem support have been rewritten and there is now support for mounting and booting ext2 filesystems. Finally, a large body of third party software have been ported with varying degrees of stability.

The source code of version 0.8 has 117k lines of source code (released 19 Dec 2013), version 0.7 has 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.
  • NetBSD's libm.
  • Homemade shell utility programs.
  • Mostly POSIX compatible.
  • Shell environment with common Unix programs.
  • Documentation and user guides.
  • Games (pong, snake, asteroids, quake).
  • C and C++ compilers.
  • Development headers and libraries are included.
  • Text editor.
  • 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.
  • Memory mapped IO.
  • Unix sockets.
  • Kernel debugger.
  • Non-blocking IO.
  • Date and time support.
  • Process groups.
  • chroot.
  • BGA graphics driver for virtual machines.

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.

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.
  • No mouse driver.
  • There is only a single terminal.
  • No proper line editing in the shell.
  • No SATA harddisk driver.
  • No sound drivers.
  • No graphic drivers for real hardware.
  • No shared memory mapping mappings.
  • No networking except Unix sockets.
  • No pthreads implementation.
  • No #! magic sequence supported.
  • No Unicode font rendering.
  • No proper terminal implementation (curses is not possible yet).
  • No proper signal implementation.
  • 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. SATA is not supported 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.
  • There's no line editing or tab-completion implemented yet.
  • Pong, Snake and Conway doesn't work graphics mode and require VGA text mode.
  • Changing the screen resolution too much may cause the system to lock up.
  • Quake save games doesn't work as printf doesn't support floating point numbers yet, you will be unable to load saved games.
  • Quake may crash with a bad free message during normal exit - but this doesn't matter much as you were exiting the game anyway.

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 use a pre-built Debian-compatible package (may not work), 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://cs.au.dk/~sortie/sortix/release/0.8/builds/.

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

Development Code

You can retrieve the current git master from our gitorious project page, or rather, the Sortix repository. You can find the source for the latest release in the sortix-0.8 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://cs.au.dk/~sortie/sortix/release/nightly/.

Previous releases

You can download older releases of Sortix from https://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.8_x86_64.iso.xz &&
sudo dd if=sortix_0.8_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.8_x86_64.iso.xz &&
qemu-system-x86_64 -m 1024 -vga std -cdrom sortix_0.8_x86_64.iso

Or:

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

Technical details

The system is written in C++ and C-like C++ and uses the System V ABI with minor modifications. Programs are statically linked as dynamic linking has not yet been implemented. Threads support has not yet been merged. 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://cs.au.dk/~sortie/sortix/release/0.8/doc/.

Participation in Development

You can either attempt to develop the system using itself (not recommended) 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.

Screenshots

You can view the collection of odd screenshots of Sortix at https://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://cs.au.dk/~sortie/sortix/crazy-os/.

License

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

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 Gitorious: 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, and the tix package management programs are licensed under the GNU General Public License, either version 3 or (at your option) any later version.

Unless the license header in the source code states otherwise, the libc 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.