A bootable x86 image that boots straight into Conway's Game of Life: no OS, no libc, just a bootloader handing off to a small freestanding C kernel that runs the simulation in VGA mode 13h.
Full write-up of how this was built (bootloader, protected mode switch, C kernel, VGA text rendering, PRNG, etc.) is here: Vac Week #1: Booting to Life
Note
This repository likely won't receive any future updates. It was created to make the project's code publicly available, but not to be actively maintained or to accept external contributions. If you wish to modify the code, fix bugs, or continue development, please create a fork of it.
makeThis produces bin/image.bin, a raw disk image containing the bootloader + kernel.
To test it in QEMU:
qemu-system-x86_64 -drive format=raw,file=bin/image.binTo flash it to a USB stick and boot on real hardware:
sudo make flash DRIVE=/dev/sdXCaution
Be careful with DRIVE: it points dd at a raw block device. Double check it's your USB stick and not your OS disk (or any other important disk).
There's no config file or CLI flags (sorry!), everything is hardcoded directly in kernel/kernel.c, at the top of kmain(). If you want to tweak the simulation, edit and rebuild:
- Speed: the
waitvariable is a busy-loop cycle count, not a real time unit, so the actual speed depends on the CPU it runs on. - Rules: the
rulearray, in{maxNeighbors, minNeighbors, neighborsToBorn}format. - Grid size:
rows_count/cols_count. - Random spawn rate: the
to_spawnthresholds, tied to the current alive cell count.
The Game of Life engine (kernel/life.c) is based on André Jesus' implementation, released license-free. It was adapted here for a freestanding environment (no filesystem, no stdio) and given a VGA framebuffer renderer instead of stdout output.
GPLv3, see LICENSE.