Code Monkey home page Code Monkey logo

yalo's Introduction

Yalo

Target

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

Status

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 Started

Getting Bootable Image

Currently, cross compilation is needed to build one floppy image containing yalo.

Cross compilation

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.

Mandatory Requirements:

Optional Requirements:

  • Emacs
  • SLIME

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.

With Emacs+SLIME

Inside Emacs,

  1. First type M-x slime if SLIME is not started.
  2. Type M-x slime-load-system then type cc when prompted for the system.
  3. At REPL, type (in-package :cc) to switch to package cc (alternatively, one can user keyboard shortcut C-x M-p and then type cc).
  4. Type (write-kernel "../floppy.img") at SLIME REPL to generate the kernel. Here we assume that current directory is cc of the source tree, therefore floppy.img is written directly to the source tree, where scripts to run the image (e.g. run-bochs) are located.

Run Image

There are various ways to run the image.

Bochs

Go to the root directory of the source code, where script run-bochs and debug-bochs are located. Run the scripts and select 6 to proceed emulation. The difference between run-bochs and debug-bochs is that after selecting 6, emulation starts directly for run-bochs; while for debug-bochs, emulator pauses before BIOS, and one needs to type c in the debugger window to continue the emulation.

Note that on Ubuntu (at least in 16.10), package bochs-x should be installed in addition to package bochs.

QEMU

Similar to Bochs, go to the root directory of the source code, where script run-qemu and debug-qemu are located.

In both run-qemu and 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 support: -s argument makes QEMU listens to port 1234 for GDB, while -S argument makes QEMU pauses at the beginning for GDB's continue command. After running debug-qemu and starting GDB, first type target remote :1234 to connect to QEMU, then type command continue to resume the emulation.

VirtualBox

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 run-virtualbox and debug-virtualbox are located. Run script run-virtualbox to start the emulator, or script debug-virtualbox to start the emulator with debug window.

Software version

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)

yalo's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.