Yalo is a Lisp OS running on bare metal x86-64 hardware. The system programming language is Ink, a new Lisp dialect which combines the elegance of Scheme and powerfulness of Common Lisp. The project webpage is: https://github.com/whily/yalo
The project is only at very very initial stage, with an assembler written in Common Lisp, and a 64 bit bootloader.
"Short term" plan:
- VGA text mode without using BIOS.
- Keyboard handling without using BIOS.
- Switch to 32 bit protected mode.
- Switch to 64 bit long mode.
- Physical/virtual memory management.
- Userland and system call.
- Implement Ink interpreter with assembly.
- Self hosting a more powerful Ink interpreter with Ink itself.
Getting Bootable Image
Currently, cross compilation is needed to build one floppy image containing yalo.
Although yalo should compile on any Ansi Common Lisp implementation, it is only tested on SBCL. Therefore the following discussion is focused on how to build yalo from SBCL.
- [SBCL](http://sbcl.sourceforge.net SBCL)
Getting Source Code
Run following command to anonymously checkout the latest source code of yalo.
$ git clone https://github.com/whily/yalo.git
Setup link for ASDF
Run following commands to make SBCL aware of the ASDF file for the cross compiler.
$ cd yalo/cc $ ./lnasdf
Build Floppy Image
With SBCL alone
When using SBCL alone, type the following at REPL:
* (require 'asdf) * (asdf:oos 'asdf:load-op 'cc) * (in-package :cc) * (write-kernel "floppy.img")
One may type
Ctrl-d to exit from SBCL.
- First type
M-x slimeif SLIME is not started.
M-x slime-load-systemthen type
ccwhen prompted for the system.
- At REPL, type
(in-package :cc)to switch to package cc (alternatively, one can user keyboard shortcut
C-x M-pand then type
(write-kernel "../floppy.img")at SLIME REPL to generate the kernel. Here we assume that current directory is
ccof the source tree, therefore
floppy.imgis written directly to the source tree, where scripts to run the image (e.g.
run-bochs) are located.
There are various ways to run the image.
Go to the root directory of the source code, where script
debug-bochs are located. Run the scripts and select 6 to
proceed emulation. The difference between
debug-bochs is that after selecting 6, emulation starts directly
run-bochs; while for
debug-bochs, emulator pauses before BIOS,
and one needs to type
c in the debugger window to continue the
Note that on Ubuntu (at least in 16.10), package
bochs-x should be
installed in addition to package
Similar to Bochs, go to the root directory of the source code, where
debug-qemu are located.
debug-qemu, QEMU monitor is redirectted to
stdio (via argument
-monitor stdio). Script
run-qemu will start
the emulator without GDB support; while
debug-qemu enables GDB
-s argument makes QEMU listens to port 1234 for GDB, while
-S argument makes QEMU pauses at the beginning for GDB's
command. After running
debug-qemu and starting GDB, first type
target remote :1234 to connect to QEMU, then type command
to resume the emulation.
In the Storage page of the virtual machine settings, right click
and select "Add Floppy Controller". And the select the image file
floppy.img for floppy drive. In the System page of virtual
machine settings, make sure that Floppy is checked for Boot order.
Assuming the VM name is
yalo, go to the root directory of the source
code, where script
located. Run script
run-virtualbox to start the emulator, or script
debug-virtualbox to start the emulator with debug window.
So far, the development is done on Ubuntu 16.10. For above-mentioned software, the corresponding version is listed below:
- SBCL: 1.3.3
- Emacs: 24.5.1
- SLIME: 2.18
- Bochs: 2.6 (some issues)
- QEMU: 2.6.1
- VirtualBox: 5.1.6 (some issues)