AzathOS, the Linux OS from scratch
Find a file
LevitatingBusinessMan (Rein Fernhout) c70e235584
All checks were successful
Cargo Build & Test / Rust Build & Test (push) Successful in 44s
add bin and sbin dirs and don't build cpio per default
2025-10-25 18:21:47 +02:00
.bundle ls: show major/minor 2023-11-02 22:09:49 +01:00
.cargo my own init 2023-10-30 23:08:38 +01:00
.github/workflows specify toolchain on cargo in action 2025-07-09 08:58:38 +02:00
cat wip cat program 2025-09-09 14:40:56 +02:00
color work on ls 2023-11-02 03:26:34 +01:00
coreutils@615b562b64 make use of uutils 2023-10-31 17:49:54 +01:00
display display 2024-04-10 05:13:35 +02:00
echo move guest programs to /guest 2024-05-28 02:31:43 +02:00
fb ability to read cursor 2023-11-03 05:35:34 +01:00
id work on ls 2023-11-02 03:26:34 +01:00
init improve error handling in init 2025-07-09 06:55:56 +02:00
input input: worked on mouse detection 2023-11-07 14:27:15 +01:00
ls sort ls output 2023-11-06 20:16:15 +01:00
ps ps: small fix 2023-11-07 15:00:31 +01:00
root add bin and sbin dirs and don't build cpio per default 2025-10-25 18:21:47 +02:00
schelp bump schelp to edition 2024 2025-07-09 07:47:49 +02:00
segfault show signals 2023-11-04 20:10:55 +01:00
.config new kernel 2025-07-10 03:08:55 +02:00
.config.source Tested built-in initrds 2023-11-04 03:36:40 +01:00
.gitignore mess with the display 2023-11-04 19:11:36 +01:00
Cargo.lock wip cat program 2025-09-09 14:40:56 +02:00
Cargo.toml wip cat program 2025-09-09 14:40:56 +02:00
default_cpio_list Tested built-in initrds 2023-11-04 03:36:40 +01:00
drmnotes drmnotes 2024-05-28 12:11:40 +02:00
linux new kernel 2025-07-10 03:08:55 +02:00
linux_bakery schelp now has PATHs 2023-11-06 22:10:37 +01:00
Makefile add bin and sbin dirs and don't build cpio per default 2025-10-25 18:21:47 +02:00
no_root.patch debug kernel used and remove /root creation 2023-11-04 02:32:30 +01:00
README.md update readme again 2025-07-10 02:54:33 +02:00

AzathOS

AzathOS (previously called Real Linux From Scratch) is userland for Linux written from scratch. I started this project to get a better understanding of the kernel. My goal is to create a usable UNIX environment with my own init, shell and utilities.

All code is written in Rust and limited to just a few common libraries like libc, chrono, clap and serde.

Boot using systemd containers

make && make rootfs
sudo systemd-nspawn -D rootfs -b

It should be noted that systemd-nspawn can alter the permissions on the directory.

Alternatively, you can import the image.

make && make tar
importctl import-tar azathos.tar.xz --class=machine
sudo systemd-nspawn -M azathos -b

However, because there is no system bus in AzathOS, machinectl is limited.

Intramfs (old method)

Currently AzathOS works by creating a tiny filesystem in a cpio archive. This is then used as the initramfs for the kernel supplied with -initrd flag in qemu. The kernel will then decompress my filesystem on top of the initramfs already baked into the kernel.

The kernel creates that initramfs during compilation according to default_cpio_list, it creates the /dev/console device and also the /root mountpoint. Because AzathOS does not actually intend to mount a root disk and doesn't use a /root directory you can patch the kernel to not create that directory. See no_root.patch.

See also Qemu Direct Linux Boot.

Build into the kernel

It is possible to build the initrd into the kernel itself. This is done by specifying the filesystem files, rootfs in CONFIG_INITRAMFS_SOURCE.

You also want to include default_cpio_list which will ensure a console device is created. CONFIG_INITRAMFS_SOURCE="azathos/rootfs azathos/default_cpio_list"

If you also want to have some decent size, I recommend turning off all the debug options I configured and set CONFIG_CC_OPTIMIZE_FOR_SIZE.