Drew DeVault, the author of the Sway user environment, the Aerc email client, the SourceHut collaborative development platform, and the Hare programming language, reported that he was able to write his own implementation of a UNIX clone in just 27 days. He named his operating system Bunnix.
The system is a monolithic Unix-like operating system written in Hare with some small inclusions of C language.
In user space, the following tools have been built:
- dash (/bin/sh)
- gzip
- less (pager)
- lok (/bin/awk)
- lolcat
- mandoc (man pages)
- sbase (core utils)1
- tcc (C compiler)
- Vim 5.7
Additionally, to demonstrate the system's capabilities, the games Doom and Colossal Cave Adventure were compiled.
The system can be booted using QEmu or written to a USB drive. Working with the USB itself is not supported, so real hardware must use a PS2/keyboard. The kernel supports drivers for:
- PCI,
- AHCI devices,
- GPT and MBR partition tables,
- PS/2 keyboard,
- platform serial ports,
- CMOS clocks,
- framebuffer,
- ext4 and memfs file systems (via lwext4).
Kernel functions include:
- virtual file system,
- /dev, /dev/kbd и /dev/fb0,
- serial and VideoTTY,
- controlling terminal /dev/tty,
- terminal emulator,
- termios,
- about 40 system calls (clock_gettime, poll, openat, fork, exec, pipe, dup, dup2, ioctl, etc.)
The author created this project out of personal interest and does not plan to further develop it. He was curious about how simply a kernel could be written and how to port third-party software using modern tools. As the developer states, third-party software was relatively easy to port because his libc was based on musl libc, thus the mechanisms of libc were easily adapted to work on Bunnix.
Source: linux.org.ru
