Skip to content

douxxtech/bootgol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bootgol

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.

Building

make

This 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.bin

To flash it to a USB stick and boot on real hardware:

sudo make flash DRIVE=/dev/sdX

Caution

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).

Configuration

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 wait variable is a busy-loop cycle count, not a real time unit, so the actual speed depends on the CPU it runs on.
  • Rules: the rule array, in {maxNeighbors, minNeighbors, neighborsToBorn} format.
  • Grid size: rows_count / cols_count.
  • Random spawn rate: the to_spawn thresholds, tied to the current alive cell count.

Credits

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.

License

GPLv3, see LICENSE.

About

Bootable x86 image that boots straight into Conway's Game of Life - https://aka.dbo.one/bootgol

Topics

Resources

License

Stars

10 stars

Watchers

0 watching

Forks

Contributors