Home

Awesome

fooboot: boot your foo

A small kernel, C library, Makefile and launch script for building and booting your program in QEMU or on real hardware.

Prerequisites

Quick Start

  1. Checkout the fooboot project
git clone https://github.com/kanaka/fooboot
  1. Create a simple hello.c
#include <stdio.h>
int main() {
    printf("hello world\n");
}
  1. Build a bootable ISO
make FOO_TARGETS="hello" boot.iso
  1. Write the ISO to a USB device. Warning: This will destroy any content on the USB device. SECOND WARNING: make sure that MY_USB_DEVICE is actually your USB device and not some other device with critical data on it like your hard drive!!
sudo dd if=boot.iso of=/dev/MY_USB_DEVICE && sync
  1. Boot using the USB device (you may need to go into your BIOS/boot loader menu to select your USB device for boot).

Project with a Makefile

  1. Create a project directory and add fooboot to it
mkdir myproj
cd myproj
git clone https://github.com/kanaka/fooboot
  1. Create a project Makefile
FOO_TARGETS = myprog  # before the include
include fooboot/Makefile

myprog: mylib1.o mylib2.o myprog.o
  1. Add project files myprog.c, mylib1.c, mylib2.c
  2. Build myprog kernel
make
  1. Boot in QEMU with command line argument using the launch script:
fooboot/runfoo myprog myarg1 myarg2

fooboot C library

The C library included with fooboot includes a few basic functions including: printf, snprintf, memset, memmove, strcmp, strlen, strtol, etc. There is also a naive malloc function that will simply allocate memory from the beginning of the heap. However, please note that the free function is currently non-functional. Your program will need to provide its own memory management within the memory that it gets using fooboot's malloc.

fooboot extras

License

fooboot is licensed under the MPL-2.0 (see LICENSE).

Some code in fooboot is included or derived from other open source projects.