The Sapphire Operating System
- C++ compiler (GCC or equivalent) that supports the
-no-PIE
flag - NASM assembler
- If you're using Windows...
- To build ensure that NASM is installed by running
winget install nasm
and add it to your PATH variable - Also, to get the GCC binaries required to build and use the Makefile, you can install MinGW-w64 or download them from FPC Pascal binaries.
- WSL (Windows Subsystem for Linux) is used by the Makefile for some commands
- To build ensure that NASM is installed by running
The latest Makefile will always be the Windows one. So you can
cd
into/src/boot
and just runmake
andmake boot
without any issues.
# For Linux environments, install dependencies
sudo apt-get update && sudo apt-get install nasm binutils dosfstools make qemu qemu-utils qemu-system-x86 qemu-system-gui build-essential g++
# Build and run
cd src/boot
make # Build the kernel
make boot # Run in QEMU
The Sapphire OS is a freestanding C++ kernel with the following features:
- Custom bootloader with VBE graphics mode initialization
- Text rendering with IBM VGA fonts
- Basic graphics primitives for drawing shapes and UI elements
- Support for multiple color depths
The codebase is organized as follows:
src/boot
- Contains bootloader and build systemsrc/graphics
- Graphics rendering code including fonts and text displaysrc/main.cpp
- Kernel entry point
- Build
- Locking
- GFX (flanterm)
- PMM
- Paging
- Some heap
- GDT
- IDT
- TSS
- ACPI
- HPET
- LAPIC
- MP
- IOAPIC
- Initrd support
- ELF parsing
- Scheduling
- End of x86 pain
- Syscalls
- Start libc porting
- End libc porting
- bash
- coreutils
- doom2
- nasm
- gcc
- lua
- python
- etc. apps
- IO
- Serial
- PCI
- CMOS
- PS2 Keyboard
- Speaker
- AHCI
- XHCI/HID/USB
- NVME
- Networking
- Intel HDA
- End of driver pain
- FAT32
- VFS
- EXT4
- TMPFS
- End of filesystem pain
- TBP