Repository navigation
Getting Started
This guide walks you through building Cupid OS from source and running it in QEMU.
| Tool | Purpose |
|---|---|
| GNU Make | Build system |
| Python 3 | Remaining build coordination, verification and image publication |
| Checked Cupid Toolchain seeds | Compile, assemble, link and inspect normal build outputs |
QEMU (qemu-system-i386) |
x86 emulator for testing |
| Windows or Linux host | Runs its checked native six-tool seed cohort |
The paired seeds ship in bootstrap/seeds/. Normal OS, user and hosted
toolchain builds do not require GCC, Clang, NASM or a host linker. Those tools
remain optional development and comparison tools. QEMU is needed for guest
testing. CupidObj constructs the normal image templates; the Python image
publisher retains filesystem and replacement checks.
sudo apt-get install make python3 qemu-system-x86sudo pacman -S make python qemu-fullSame as Ubuntu/Debian. For display, ensure an X server (VcXsrv, WSLg) is available for QEMU's graphical output.
git clone --branch bootstrap/cupid-self-hosting https://github.com/cupidthecat/cupid-os.git
cd cupid-os
makeThis produces:
-
boot/boot.bin- 2,560-byte bootloader with its second stage -
kernel/kernel.bin- Flat binary kernel -
cupidos.img- Bootable IDE HDD image (default 200 MiB) with embedded FAT16 partition
make HDD_MB=100
make HDD_MB=200Default is HDD_MB=200.
| Target | Description |
|---|---|
make |
Build the OS image |
make clean |
Remove build artifacts (keeps cupidos.img) |
make clean-image |
Remove only cupidos.img
|
make distclean |
Remove build artifacts + cupidos.img
|
make run |
Build and run in QEMU (serial to stdout) |
make run-log |
Build and run with serial output saved to debug.log
|
make sync-demos |
Copy local demos/*.asm into /home/demos in cupidos.img
|
make runBoots into the graphical desktop from HDD (-boot c -hda cupidos.img).
Serial output appears in your terminal.
make run-logAll serial output (debug logs, kernel messages) saved to debug.log.
cupidos.img contains the bootloader, kernel prefix and a FAT16 partition.
The default FAT start is LBA 20480, byte offset 10485760. Cupid OS mounts
raw FAT at /disk. Persistent /home files use HomeFS, whose HOMEFS.SYS
container is stored on FAT16.
Use the image publisher after building the image:
python3 tools/hostbuild.py stage --image cupidos.img --fat-start-lba 20480 cupid.bmp:/cupid.bmpOn Windows, use the configured Python executable. The staged file is available
as /disk/cupid.bmp. A fresh first boot imports staged files into HomeFS;
an existing image can copy a new file with cp /disk/cupid.bmp /home/cupid.bmp
in the guest. Staging requires no external mcopy utility.
make sync-user builds and stages the three validated ELF examples. See
ELF programs for their entry contract and guest commands.
If FAT_START_LBA changes, the byte offset is FAT_START_LBA * 512.
When cupid-os boots, you'll see:
- Bootloader - Loads kernel from HDD LBA sectors to 0x100000, switches to protected mode
- Kernel init - IDT, PIC, PIT, keyboard, memory, paging, serial
- Desktop - VBE 640×480 32bpp graphical desktop with pastel theme
CupidOS ships a TempleOS-inspired DolDoc-like manual set inside the OS.
Open Notepad, browse to /docs/00INDEX.ctxt, and press F2 to switch
between raw source and rendered view.
In rendered view, .ctxt manuals can contain:
- runnable CupidC code blocks
- clickable
open:,shell:, andrepl:links - buttons, tree widgets, and inline BMP sprites
The shipped manuals also embed /docs/image.bmp, which is used by the DolDoc
examples and widget demos.
Click the Terminal icon on the desktop (or boot in text mode). You'll see:
cupid-os shell
> help
Try these commands to get started:
help # List all commands
sysinfo # System information
ls # List in-memory files
ls /docs # List embedded manuals
lsdisk # List files on FAT16 disk
ed hello.cup # Create a script with the editor
cupid hello.cup # Run your script
- Shell Commands - Full command reference
- CupidScript - Write and run scripts
- Ed Editor - Create and edit files
-
Disk Setup - Work with the FAT16 partition inside
cupidos.img - Desktop Environment - Using the GUI
Getting Started
Shell & Scripting
Compilers
- CupidC Compiler
- CupidC Language Reference
- CupidC 2D Graphics Library
- CupidASM Assembler
- Toolchain Bootstrap
- Floating Point
Programs & Docs
GUI
Kernel
Filesystems
Hardware