Hobby kernel + userspace, built mostly from scratch. Composited GUI, dynamically linked ELF binaries, networking, Python applications, and more. https://toaruos.org/
|K. Lange 62e9138e5d readme: More updates.||1 month ago|
|.github||1 month ago|
|apps||1 month ago|
|base||1 month ago|
|boot||1 month ago|
|build||1 month ago|
|kernel||1 month ago|
|kuroko @ d859ac5092||1 month ago|
|lib||1 month ago|
|libc||1 month ago|
|linker||1 month ago|
|modules||1 month ago|
|util||1 month ago|
|.gitignore||1 month ago|
|.gitmodules||1 month ago|
|AUTHORS||2 years ago|
|LICENSE||1 month ago|
|Makefile||1 month ago|
|README.md||1 month ago|
ToaruOS is a 64-bit, hobbyist, educational, Unix-like operating system built entirely from scratch. It includes a kernel, bootloader, dynamic linker, C standard library, composited windowing system, and several utilities and applications. All components of the core operating system are original, providing a complete environment in approximately 80,000 lines of C and assembly, all of which is included in this repository.
The ToaruOS project began in December 2010 and has its roots in an independent student project. The goals of the project have changed throughout its history, initially as a learning experience for the authors, and more recently as a complete, from-scratch ecosystem.
ToaruOS 1.0 was released in January, 2017, and featured a Python userspace built on Newlib. Since 1.6.x, ToaruOS has had its own C library, dependencies on third-party libraries have been removed, and most of the Python userspace has been rewritten in C. More recent releases have focused on improving the C library support, providing more ports in our package repository, and adding new features.
In April, 2021, work began on ToaruOS 2.0, which brings a rewritten kernel for x86-64 (and potentially other architectures) and support for SMP. The new "Misaka" kernel was merged upstream at the end of May. Completion of ToaruOS 2.0 is currently ongoing.
dlopening of additional libraries.
The following projects are currently in progress:
This section is being updated to reflect changes in ToaruOS 2.0 and may be outdated or incorrect.
To build ToaruOS from source, it is currently recommended you use a recent Debian- or Ubuntu-derived Linux host environment. Our build machines generally run Ubuntu 20.04 (the current LTS as of writing).
Several packages are necessary for the build system:
build-essential (to build the cross-compiler),
xorriso (to create CD images),
python3 (various build scripts),
mtools (for building FAT EFI system partitions),
gnu-efi (for building the EFI loaders).
Beyond package installation, no part of the build needs root privileges.
The build process has two parts: building a cross-compiler, and building the operating system. The cross-compiler uses GCC 10.3 and can be built by pulling the submodules
util/gcc and running
util/build-toolchain.sh. Generally, this only needs to be done once, and the cross-compiler does not depend on any of the components built for the operating system itself, though some components may have soft dependencies on the libc. Once the cross-compiler has been built,
make will continue to build the operating system itself.
You can skip the process of building the cross-compiler toolchain (which doesn't get updated very often anyway) by using our pre-built toolchain through Docker:
git clone --recursive https://github.com/klange/toaruos cd toaruos docker pull toaruos/build-tools:1.99.x docker run -v `pwd`:/root/misaka -w /root/misaka -e LANG=C.UTF-8 -t toaruos/build-tools:1.8.x util/build-in-docker.sh
After building like this, you can run the various utility targets (
make run, etc.). Try
make shell to run a ToaruOS shell (using QEMU and a network socket - you'll need netcat for this to work).
Makefile uses a Kuroko tool,
auto-dep.krk, to generate additional Makefiles for the userspace applications libraries, automatically resolving dependencies based on
In an indeterminate order, the C library, kernel, userspace librares and applications are built.
base/usr/include, as well as graphical resources for the compositor and window decorator.
Currently, the build tools in this repository will produce a kernel binary and a compressed ramdisk, which can be used with a Multiboot-compliant loader such as GRUB. QEMU also provides direct support for loading Multiboot kernels:
qemu-system-x86_64 -M q35 -kernel misaka-kernel -initrd ramdisk.igz -append "root=/dev/ram0 start=live-session migrate" -enable-kvm -m 1G
Until the native bootloaders are ready for ToaruOS 2.0, testing in other virtual machines can be done with GRUB.
ToaruOS is regularly mirrored to multiple Git hosting sites.
#toaruos on Libera (
Currently, in the development of ToaruOS 2.0, self-hosting builds have not been tested and some utilities may be missing.
Previously, with a capable compiler toolchain, ToaruOS 1.x was able to build its own kernel, userspace, libraries, and bootloader, and turn these into a working ISO CD image.
ToaruOS is not currently capable of building most of its ports, due to a lack of a proper POSIX shell and Make implementation. These are eventual goals of the project.
ToaruOS is a completely independent project, and all code in this repository - which is the entire codebase of the operating system, including its kernel, bootloaders, libraries, and applications - is original, written by the ToaruOS developers over the course of eight years. The complete source history, going back to when ToaruOS was nothing more than a baremetal "hello world" can be tracked through this git repository.
ToaruOS has taken inspiration from Linux in its choice of binary formats, filesystems, and its approach to kernel modules, but is not derived in any way from Linux code. ToaruOS's userspace is also influenced by the GNU utilities, but does not incorporate any GNU code.