Home

Awesome

FLISP

A simple Scheme-like Lisp interpreter that can also be run as a simple self-contained operating system.

Features the following:

Build instructions

The Makefile provided builds three different things: the flisp library, libflisp.a which is used to compile the user-space interpreter and the OS-version. Because building the kernel requires loopback devices, it must typically be built with superuser priviliges.

Builds using gcc and nasm for the assembly language in the kernel.

Note: older version of nasm do not generate working object files (it leaves global symbols undefined). It is recommended to build using nasm version 2.10.

Usage guide

flisp launches into a REPL. Use (quit) to exit.

Flisp as an operating system

Flisp comes with a simple kernel, inspired and largely taken from Bran's Kernel Tutorial, http://www.osdever.net/bkerndev/Docs/gettingstarted.htm

The build script compiles the kernel and generates a floppy disk image with the grub bootloader installed. You can test it out using, e.g.,

qemu -fda floppy.img

Feel free to try out using virtualization software like VMWare, or even running it directly on hardware!

A word of warning: parts of the kernel are not really complete and really could do with more work. The keyboard driver is partially broken as it doesn't handle capslock and other control keys propertly. If any exception fires it goes into a kernel panic and a reboot is required. This shouldn't be a major issue because it enters an flisp REPL almost straight away and doesn't allow any user binary code to be executed at all so there's no danger of protection or paging faults occuring for instance.

Developer's guide

Flisp is pretty simple in design and can be easily extended if you so wish. This is a broad outline of its implementation.

Some things that might be useful to add: Custom data structures, tail call optimisation, math functions (see libflisp/libs/ for some example code), reader macros, fixing the kernel keyboard driver, ...

Closing notes

This is a hobby project and was written over a couple of weeks for fun and as a learning exercise. It is intended for educational more than serious use. I'd be interested if anyone is using it for any reason at all, so feel free to email any questions or queries concerning this little project.

Frank James, (frank.a.james AT gmail.com) August 2013