-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
This guide walks you through building cupid-os from source and running it in QEMU.
| Tool | Purpose |
|---|---|
| NASM | Assembler for bootloader and context switch |
| GCC (32-bit support) | C compiler for kernel and drivers |
| GNU Make | Build system |
QEMU (qemu-system-i386) |
x86 emulator for testing |
| dosfstools | Creating FAT16 partition in the HDD image |
| Linux environment | Ubuntu, Debian, WSL, or equivalent |
sudo apt-get install nasm gcc make qemu-system-x86 dosfstoolssudo pacman -S nasm gcc make qemu-full dosfstoolsSame as Ubuntu/Debian. For display, ensure an X server (VcXsrv, WSLg) is available for QEMU's graphical output.
git clone https://github.com/your-username/cupid-os.git
cd cupid-os
makeThis produces:
-
boot/boot.bin- 512-byte bootloader -
kernel/kernel.bin- Flat binary kernel -
cupidos.img- Bootable IDE HDD image (default 200MB) 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.
make now creates a single HDD image (cupidos.img) that already contains:
- MBR boot sector + Stage 2 + kernel area
- FAT16 partition mounted as
/home
By default, FAT starts at LBA 4096 (offset 2097152 bytes).
You no longer need a separate test-disk.img.
Use mtools against the FAT partition inside cupidos.img:
# Host file -> OS /home/cupid.bmp
mcopy -o -i cupidos.img@@2097152 cupid.bmp ::/cupid.bmp
# Verify (FAT root == OS /home)
mdir -i cupidos.img@@2097152 ::/If FAT_START_LBA changes, recompute offset:
offset_bytes = 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
- Floating Point
Programs & Docs
GUI
Kernel
Filesystems
Hardware