Crescent is a custom operating system distribution, that is going to come with its own set of userspace applications and a desktop environment.
This repository hosts the Crescent kernel and apps.
- Multithreaded pre-emptive custom kernel
- A set of custom userspace applications including a terminal, file manager, desktop environment, browser, media player and some games. (TODO, currently the only userspace application is a very basic desktop environment)
- Works on real hardware and supports different kinds of devices
- Architectures supported: X86-64, AArch64
Building the whole distribution is best done using qpkg, the required tools for that are:
- Clang >= 19
- qpkg
- CMake/Meson/Ninja/Make depending on which packages are built
Clone the crescent bootstrap repository using --single-branch
git option to avoid pulling in binaries from the other branches,
and proceed with the instructions below in that directory.
- Run
make
. This will build the distribution for x86_64, you can optionally select an architecture witharch
e.g.make ARCH=aarch64
. - Create an empty image once by running
make create_image
- Update the image using
make update_image
. This needs to be done for any changes to the installed packages or the system root to take effect. - Run the resulting image in qemu using
make run
Installing other packages is done using qpkg install <name>
and running qpkg sync <name>
to sync the package to the sysroot.
In case you need to rebuild a package you can use qpkg rebuild <name>
,
it is an alias to qpkg build install sync --force <name>
.
It is also possible to build the plain kernel, for that you need the following tools:
- C++ compiler
- CMake
- Ninja (or Make, but the steps below assume Ninja is used)
Note: If you want to cross-compile to a different architecture,
there are some pre-defined cmake toolchain files in cmake
folder
that you can use by adding -DCMAKE_TOOLCHAIN_FILE=<path to toolchain file>
to the cmake command line.
If there isn't an existing toolchain file for the target that you want to build for
then refer to the existing toolchains and CMake documentation on toolchain files
and create a new one.
mkdir build
cd build
cmake -G Ninja .. -DBUILD_APPS=OFF
ninja
Note: BUILD_APPS
needs to be off when not using a Crescent cross toolchain.
- Basic logging
- Memory
- Page frame allocator
- Page table manager
- General purpose memory allocator
- Interrupt handling
- APIC
- Exceptions
- IO-APIC
- Kernel module loading
- Per-cpu multilevel feedback queue scheduler
- ACPI
- FADT
- MADT
- MCFG
- Reboot + shutdown
- Power management
- Shutdown
- Reboot
- Sleep (partially done)
- Filesystems
- TAR initramfs
- FAT32
- Ext4 read
- Ext4 write
- Drivers
- SMP
- AHCI SATA
- NVMe
- Audio
- Intel High Definition Audio (mostly done)
- PS2
- Keyboard
- Mouse
- Generic PCI device interface
- Ethernet
- Realtek RTL8169/RTL8139
- Network stack
- Ethernet
- ARP
- IPv4
- IPv6
- UDP v4
- UDP v6
- TCP v4 (mostly done)
- TCP v6
- USB
- Generic HCI interface abstraction
- HCI
- UHCI
- OHCI
- EHCI
- XHCI
- Keyboard
- Mouse
- Mass storage
- RNDIS (used eg. for tethering internet from a phone)
- Apps
- Desktop environment (very basic one with almost no functionality is done)
- Web browser
- Terminal
- File manager
- Media player