2012-03-10 18:57:56 -05:00
|
|
|
The Sortix Operating System
|
|
|
|
===========================
|
|
|
|
Sortix is a hobby operating system. It was originally created as a tool to learn
|
2012-08-05 10:28:25 -04:00
|
|
|
more about kernel and operating system design and implementation. Today it is
|
|
|
|
gradually transforming into a real operating system. The standard library and
|
|
|
|
kernel is rich enough that some third party software can and has been ported to
|
|
|
|
Sortix. While the system remains limited, there have been added support for
|
2012-09-10 06:28:29 -04:00
|
|
|
bitmap graphics and proper filesystem support is being worked on. Unfortunately
|
2012-08-05 10:28:25 -04:00
|
|
|
there is no support for networking yet. The current release ships with various
|
|
|
|
test programs, utility programs and a few games and has support for rendering
|
|
|
|
the console in graphics mode.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
The system aims to be an Unix-clone and is heavily based on POSIX. However, I've
|
2012-08-05 10:28:25 -04:00
|
|
|
drawn much inspiration from systems such as Plan 9, GNU/Hurd and MINIX. While
|
|
|
|
the system doesn't strive to be a microkernel (and today isn't), the plan is to
|
|
|
|
have user-space filesystems, per-process namespaces, subusers, and generally
|
|
|
|
give regular users more power that traditional Unix systems. If you are
|
|
|
|
interested, you can read about my design decisions at http://maxsi.org/blog/.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
System Requirements
|
|
|
|
-------------------
|
|
|
|
Sortix has very low system requirements. It also works well under virtual
|
|
|
|
machines such as VirtualBox and Qemu.
|
|
|
|
|
2012-08-05 10:28:25 -04:00
|
|
|
* A 32-bit x86 (with SSE) or 64-bit x86_64 CPU.
|
2012-03-14 10:14:21 -04:00
|
|
|
* A dozen megabytes of RAM.
|
2012-03-10 18:57:56 -05:00
|
|
|
* 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.
|
|
|
|
|
|
|
|
Features
|
|
|
|
--------
|
|
|
|
The current development version of Sortix offers a traditional multi-process
|
|
|
|
protected environment with round-robin scheduling. A quick and dirty shell is
|
|
|
|
able to execute programs in foreground or background mode, handle IO redirection
|
|
|
|
and piping the standard output of a process into the standard input of another.
|
|
|
|
A real shell will be added as the system matures and I get around to finish the
|
2012-08-05 10:28:25 -04:00
|
|
|
work-in-progress shell.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
2012-09-10 06:28:29 -04:00
|
|
|
The official distribution contains a number of small utilities one would expect
|
|
|
|
on a unix system, such as cp, cat, ls, and so on. There are a lot of common
|
|
|
|
utilities missing as I haven't coded them yet. The purpose of the current
|
|
|
|
userspace is simply to test the system so don't expect too much.
|
|
|
|
|
|
|
|
Unfortunately, for technical reasons, I don't distribute ported third party
|
|
|
|
software along with Sortix. This is largely because the build system sucks but
|
|
|
|
also that statically linked libraries are big and the initrd is already big
|
|
|
|
enough as it is. However, I have successfully ported binutils, gcc, gzip, zlib,
|
|
|
|
freetype, GNU hello, and more. Once proper filesystem support is merged, I can
|
|
|
|
distribute third party software separately and it can be mounted during boot.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
A number of small games is present and uses the VGA textmode to render ASCII
|
|
|
|
graphics. Notably you can play two-player Pong, or single-player Snake, or the
|
2012-08-05 10:28:25 -04:00
|
|
|
nice and Turing-complete Conway's Game of Life. There is also a small remake of
|
2012-09-10 06:28:29 -04:00
|
|
|
the asteroids game which uses 32-bit bitmap graphics. These are probably the
|
|
|
|
main attraction of the system for non-technical people.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
The Sortix kernel has very basic filesystem support. The root filesystem / is
|
|
|
|
simply a single-directory RAM filesystem. The init ramdisk is mounted read-only
|
2012-03-18 16:36:11 -04:00
|
|
|
on /bin and various devices are accessible through the /dev filesystem. Work is
|
2012-03-14 10:14:21 -04:00
|
|
|
underway to create an ext2 filesystem server, but it won't be of much use until
|
2012-08-05 10:28:25 -04:00
|
|
|
the kernel virtual filesystem is completed in the 0.8dev development cycle.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
2012-08-05 10:28:25 -04:00
|
|
|
There currently is no concept of users in the system (only the root user
|
|
|
|
exists). I decided to delay making a multi-user system until the base system is
|
|
|
|
in place. Note that there is only a single terminal - even though the system is
|
|
|
|
a multi-process system, there is only a single graphics framebuffer and there is
|
|
|
|
no framework for sharing it.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
2012-08-05 10:28:25 -04:00
|
|
|
Improvements in Sortix 0.7
|
2012-03-18 16:36:11 -04:00
|
|
|
--------------------------
|
2012-08-05 10:28:25 -04:00
|
|
|
The 0.7 release improves greatly upon Sortix 0.6.
|
|
|
|
|
|
|
|
* Multithreaded and fully preemptive kernel.
|
2012-09-10 06:28:29 -04:00
|
|
|
* Support for Streaming SIMD Extensions (SSE) and floating point numbers.
|
2012-08-05 10:28:25 -04:00
|
|
|
* Support for bitmap graphics through new /dev/video/ framework.
|
|
|
|
* Environmental variables.
|
|
|
|
* Rewritten and powerful initrd format.
|
|
|
|
* Init restarts the shell if it crashes.
|
|
|
|
* BGA graphics driver.
|
|
|
|
* Console rendering in graphics mode.
|
|
|
|
* Asteroids remake.
|
|
|
|
* Improved signal handling.
|
|
|
|
* VEOF support in terminal driver and shell.
|
2012-09-10 06:28:29 -04:00
|
|
|
* Various shell improvements.
|
|
|
|
* Implement scanf function family.
|
|
|
|
* Support for using PAT and MTRR to speed up video memory access.
|
|
|
|
* Countless improvements to the kernel and the standard library.
|
|
|
|
|
|
|
|
In addition, a BIOS call driver was created during the 0.7 cycle as well as a
|
|
|
|
VBE graphics driver. However, the BIOS driver only worked on 32-bit CPUs and
|
|
|
|
hence wasn't merged in time. As the VBE driver depended on it, it was cut too.
|
2012-03-18 16:36:11 -04:00
|
|
|
|
|
|
|
Known bugs
|
|
|
|
----------
|
|
|
|
There is currently a lot of bugs and small quirks in Sortix. They are caused by
|
|
|
|
the system being young and incomplete. They will gradually be fixed as the base
|
|
|
|
system improves. They are tolerated in the releases because they are not
|
|
|
|
critical and improvement situation from the last release.
|
|
|
|
|
|
|
|
The shell only looks at whitespace when parsing input lines. This means that
|
|
|
|
operators such as & ; and | must be surrounded by whitespace on both sides.
|
2012-09-10 06:28:29 -04:00
|
|
|
While quotes aren't implemented, you can work around this by using backslahes
|
|
|
|
to escape all characters except newlines. The shell does not accept very long
|
|
|
|
lines yet.
|
2012-03-18 16:36:11 -04:00
|
|
|
|
|
|
|
Some programs change the format of the terminal standard input delivered to
|
|
|
|
them. For instance, the pong game needs to capture every keyboard event. However
|
|
|
|
running such programs at the same time as programs that need proper line-
|
|
|
|
buffered input (such as the shell) causes conflicts and neither program gets
|
|
|
|
what it needs causing programs to exit or crash. Note that if the shell fails
|
2012-08-05 10:28:25 -04:00
|
|
|
to read in its expected format, it exits with an error code. This issue is
|
|
|
|
caused by the design of the terminal system and can't be fixed until it is
|
|
|
|
rewritten.
|
|
|
|
|
|
|
|
The editor can only run in 80x25 terminal resolutions. This is because it is
|
|
|
|
very hacky and was written before malloc worked. This will be fixed when the
|
|
|
|
editor is rewritten.
|
2012-03-18 16:36:11 -04:00
|
|
|
|
|
|
|
The filesystem is currently hacked together in the kernel. When things go wrong
|
|
|
|
you may experience the utilities returning the wrong error codes. This is
|
|
|
|
harmless but confusing. All the current kernel filesystem code will be replaced
|
|
|
|
a user-space filesystem framework and will be present in the next release.
|
|
|
|
|
2012-09-10 06:28:29 -04:00
|
|
|
The system can partially deadlock if a process exits and zombie children are not
|
|
|
|
collected yet.
|
|
|
|
|
2012-08-05 10:28:25 -04:00
|
|
|
Improvements scheduled for Sortix 0.8
|
2012-03-18 16:36:11 -04:00
|
|
|
-------------------------------------
|
2012-08-05 10:28:25 -04:00
|
|
|
* New build system based on cross compilation and package management.
|
2012-09-10 06:28:29 -04:00
|
|
|
* Merge BIOS and VBE drivers.
|
2012-03-18 16:36:11 -04:00
|
|
|
* Kernel virtual filesystem.
|
|
|
|
* User-space filesystem framework.
|
|
|
|
* User-space ext2 filesystem driver.
|
|
|
|
* Refactor and extend the standard library.
|
|
|
|
* Mount-points.
|
|
|
|
* Improved terminal framework.
|
|
|
|
* New and improved shell.
|
|
|
|
* Copy-on-write in fork(2) and mmap(2).
|
2012-09-10 06:28:29 -04:00
|
|
|
* Pointer-safe system calls.
|
2012-08-05 10:28:25 -04:00
|
|
|
* And various misc. improvements.
|
2012-03-18 16:36:11 -04:00
|
|
|
|
2012-03-10 18:57:56 -05:00
|
|
|
Technical details
|
|
|
|
----------------
|
|
|
|
The system is mostly coded in C++, but also contains a few files in C. However,
|
|
|
|
the user-land experiences a normal C programming interface as per POSIX.
|
|
|
|
Executable files natively uses the ELF format used on GNU/Linux and other
|
|
|
|
systems. There is no shared library support yet, but it'll be possible when I
|
|
|
|
get around to implement copy-on-write memory, mmap(2) and swapping to disk.
|
|
|
|
|
2012-03-10 19:42:03 -05:00
|
|
|
Building
|
|
|
|
--------
|
|
|
|
To build the Sortix source code you need to install a few dependencies. First of
|
|
|
|
all you need the GNU Compiler Collection (C and C++), GNU Make, and GNU
|
|
|
|
Binutils. You then need to build and install the included macro preprocessor
|
2012-10-12 05:56:51 -04:00
|
|
|
(mxmpp) somewhere in your PATH such as /usr/bin. You need a GNU/Linux build
|
|
|
|
system to build Sortix, although, it wouldn't be difficult to port the build
|
|
|
|
system to other platforms. You can then build the Sortix kernel and user-space
|
|
|
|
utilities by running make in the Sortix root source directory. By default it
|
|
|
|
will build to your CPU architecture (64-bit on 64-bit systems, 32-bit otherwise).
|
|
|
|
Use CPU=x86 or CPU=x64 as arguments to make to control which target is built.
|
2012-03-10 19:42:03 -05:00
|
|
|
|
|
|
|
To build a bootable ISO you need GNU GRUB 2, as that is used by "make iso" to
|
|
|
|
generate the iso. In turn, GNU GRUB relies on xorriso to create the iso file.
|
|
|
|
|
|
|
|
You can burn the ISO to a cdrom or dvd, or even dd(1) it onto a USB memory stick
|
|
|
|
and boot from if it your BIOS supports it. You can also provide it to a virtual
|
|
|
|
machine. Alternatively you can install the kernel binary and initrd in your
|
|
|
|
/boot directory and configure GRUB to boot Sortix.
|
|
|
|
|
2012-03-10 18:57:56 -05:00
|
|
|
Links
|
|
|
|
-----
|
|
|
|
You can visit the official website at http://www.maxsi.org/software/sortix/ for
|
|
|
|
more information and news. You can also download the newest release and cutting
|
2012-08-05 10:28:25 -04:00
|
|
|
edge nightly builds from https://cs.au.dk/~sortie/sortix/release/.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
You can retrieve the current git master from our gitorious project page from
|
|
|
|
https://gitorious.org/sortix/.
|
|
|
|
|
2012-08-05 10:28:25 -04:00
|
|
|
You can read my blog where I discuss various design decisions in Sortix at
|
|
|
|
http://maxsi.org/blog/.
|
|
|
|
|
2012-03-10 18:57:56 -05:00
|
|
|
License
|
|
|
|
-------
|
2012-03-10 19:42:03 -05:00
|
|
|
Copyright(C) Jonas 'Sortie' Termansen <sortie@maxsi.org> and contributors 2011,
|
|
|
|
2012.
|
2012-03-10 18:57:56 -05:00
|
|
|
|
|
|
|
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 gpl.html and lgpl.html files for more information.
|
2012-08-05 10:28:25 -04:00
|
|
|
|
|
|
|
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 didn't add copyright statements.
|
|
|
|
|
|
|
|
Unless the license header in the source code states otherwise, the Sortix
|
|
|
|
kernel, the filesystem servers, the initrd tools, the utilities, the games, and
|
|
|
|
the benchmark programs are licensed under the GNU General Public License, either
|
|
|
|
version 3 or (at your option) any later version.
|
|
|
|
|
2012-09-28 18:53:50 -04:00
|
|
|
Unless the license header in the source code states otherwise, the libc library
|
|
|
|
s licensed under the GNU Lesser General Public License, either version 3 or (at
|
|
|
|
your option) any later version.
|