- C 88.5%
- Python 7.7%
- Rust 3%
- Assembly 0.4%
- Batchfile 0.3%
| boot/limine | ||
| docs | ||
| static | ||
| tools | ||
| user | ||
| .gitignore | ||
| build.py | ||
| project.md | ||
| README.md | ||
| run.bat | ||
FlacOS
An educational x86-64 operating system. The kernel is called static (static.sys, C + Rust); the system itself is FlacOS.
It boots via UEFI with Limine and runs in QEMU (main path) or VMware Workstation (script provided, not tested on a live install).
Features
- Kernel: scheduler, ring 3, system calls, virtual memory, object namespace, ATA with bus-master DMA, GPT, VFS + FAT32 (in Rust), network stack (e1000, ARP, IPv4, ICMP, UDP, DNS, DHCP, TCP, sockets), TLS 1.2 client with certificate verification, zsh-like shell.
- Graphics: Bochs VGA and virtio-gpu; a desktop compositor and window manager with a floating top bar, dock, animations,
wallpaper blur and a lock screen; four generated picture wallpapers (Aurora, Dunes, Silk, Glow;
tools/genwallpapers.py), each in a light and a dark version that follows the theme. Right click works like in a desktop file manager: on the desktop (Refresh, New folder, New text document, Paste, display and personalization settings; the files of ~/Desktop are shown as icons), on a file or folder (Open, Cut, Copy, Delete, Rename), on a title bar and on a dock icon. Files has Cut/Copy/Paste between windows, Rename (F2), Delete with a confirmation, Properties, sorting and New text document. - Apps: terminal, files, settings, notepad, calculator, browser (HTTP/HTTPS, CSS subset, PNG/JPEG/GIF, no JS), monitor, installer.
- Linux programs: static x86-64 ELF and static-PIE binaries run through a Linux syscall layer (files, fork/execve/wait4, pipes, tty).
- NetSurf: the NetSurf 3.11 browser (full HTML5/CSS engine) ported as a Linux static executable with a FlacOS frontend
(window, HTTP/HTTPS with verified certificates, PNG/JPEG/GIF/BMP and SVG, cookies, JavaScript through Duktape); optional, built by
tools/netsurf/. - Sound: Intel AC97 output (48 kHz stereo);
beep,play file.wav,volume;/dev/dsp(OSS) for Linux programs. - Users: several accounts, each with its own
/home/<name>and~/.config; sign-in on the lock screen and in the text console;useradd,passwd,userdel,su. - Installer / Setup: GPT partitioning, FAT32 format, system copy, user account, language, hostname. uild/setup.img is a separate setup disk\n (like a Windows install medium): it boots into the installer only, no desktop around it.
Requirements
- QEMU (e.g.
scoop install qemu) - LLVM/clang, Rust with the
x86_64-unknown-nonetarget - Python 3 with Pillow, PyMuPDF and
resvg_py - Optional, for NetSurf and other Linux programs: Zig (
scoop install zig; used aszig cc -target x86_64-linux-musl) - Optional, for JavaScript in NetSurf: flex and bison to build its binding generator (
scoop install winflexbison) - Optional: enable the Windows "Windows Hypervisor Platform" feature (WHPX) for fast QEMU instead of slow TCG
Build and run
run.bat build (incremental) and start QEMU
run.bat rebuild rebuild from scratch
run.bat serial also attach the kernel log (COM1) to the console
run.bat install live system + blank second disk (build\target.img) to install onto
run.bat setup FlacOS Setup, like a PC with a blank disk: the setup disk (build\setup.img) boots straight into the installer, Restart now
reboots, and the new system starts from the new disk by itself
run.bat installed boot the installed system (build\target.img)
set FLAC_VM=vmware run in VMware Workstation/Player instead
set FLAC_AUDIO=wav:out.wav record the sound card to a file (default: dsound; none = silent)
python build.py kernel + apps + disk image build/static.img
python build.py --session console text console image instead of the desktop
python build.py mktarget blank disk build/target.img (size: FLAC_TARGET_MB, default 64)
python tools/qtest.py "uname -a" ... console test over serial (needs --session console)
python tools/dtest.py ... desktop test: mouse, keys, screenshot (see the file's docstring)
python tools/netsurf/fetch.py download NetSurf and its libraries into third_party/ (not stored in the repository)
python tools/netsurf/build.py build build/netsurf/netsurf; python build.py then puts it in the image
NetSurf starts from Applications > NetSurf, or netsurf <address> in the terminal. JavaScript (Duktape) runs while a page loads: DOM, document.write, innerHTML, JSON; changes made later by timers or clicks are not redrawn. Safari-style window (address pill with a bookmark star, tab bar from two tabs; Ctrl+T new tab, Ctrl+W close, Ctrl+D bookmark, Ctrl+B bookmarks and history); PNG and JPEG
go through the FlacOS decoders (user/lib/img.c, user/netsurf/vimg.c).
run.bat must keep CRLF line endings.
Layout
| Path | Contents |
|---|---|
static/ |
Kernel: hal, ke, mm, ob, io, fs, net, rtl, subsys, and fat32rs (Rust FAT32) |
user/ |
Userspace SDK (lib/), apps (apps/, disabled ones in apps_extra/), fonts, icons |
boot/limine/ |
Bootloader |
tools/ |
Python helpers, font and icon sources |
docs/ARCHITECTURE.md |
Architecture notes |
project.md |
Detailed project overview (in Russian) |
Known limitations
- HTTPS certificates are verified against the Mozilla root store, but without revocation checks (CRL/OCSP); random numbers come from a weak source (TSC).
- The browser has no JavaScript; CSS is a subset (no float/flex/grid); JPEG must be baseline.
- There is no privilege separation: FAT has no owners or permissions, so users differ by settings and home directories only.
- Under VMware video goes through firmware GOP (no resolution change in Settings).
static/include/con.hhas a Windows-reserved name (CON); it may fail to check out on Windows.
Roadmap
- Dynamic linking and threads for Linux programs.
- More sound hardware (Intel HDA) and audio input; file permissions and ownership (needs a different file system).
Licenses of third-party assets
Fluent UI System Icons and Fluent Emoji (MIT), Inter and JetBrains Mono (SIL OFL), MacTahoe cursors (GPL-3.0), Limine (BSD-2), Mozilla root certificates (MPL-2.0, via certifi). License files are next to the sources in tools/icons_src/ and boot/limine/.