/guess-the-number

A bare metal kernel with only Guess The Number

Primary LanguageCMIT LicenseMIT

Guess The Number

A bare metal kernel to play Guess the Number on

screenshot

Features

  • Guess the Number
  • 32-bit
  • custom bootloader
  • pseudo-random number generator

Resources

Thanks to @cfenollosa's amazing os-tutorial repository for teaching me how to write a kernel!

Running

Download the most recent disk image from releases

Then, run

qemu-system-i386 -fda path/to/file/guess-the-number.iso

Building from source

Requirements

Linux

With your package manager, install

  • qemu
  • gcc(i386 elf)
  • GNU Make
  • nasm

Mac

NOTE: does not work on M1 chip

Install dependencies with

brew install qemu nasm
brew tap nativeos/i386-elf-toolchain
brew install i386-elf-binutils i386-elf-gcc

Steps

Clone this repository with

git clone https://github.com/luketio/guess-the-number.git

then to build the disk image

make

To run, type

make qemu

TODO

  • Better random number generator(currently has pseudo random digits but that repeat with each boot)
  • Better bug checking with strtonum in string.c
  • Stop user from deleting the prompt

License

MIT License