PilOS - A Stand-Alone Operating System
Presenting a minimal prototypeAs an experimental version, the 64-bit version of PicoLisp is available which runs directly on a standard x86-64 PC hardware. In principle, it works as its own operating system.
In the future, embedded applications are conceivable.
It can boot from a device like an USB-Stick, and also uses only that stick's flash memory for mass storage. It doesn't touch any other drives on the host machine.
It is a full blown 64-bit PicoLisp, with database, pilog, coroutines and namespaces (minus native function calls, due to the fact that there is no other native environment around). So good news for anybody who wanted to try out PicoLisp, but didn't want to bother with installing Linux.
What works, and what doesn't work yet?
Currently works:- Booting from an USB-Stick or in Qemu
- Virtual memory management (Page Tables)
- AMD64 long mode
- Interrupt handling
- VGA screen output
- Keyboard driver
- DB/File I/O
- Speaker beep
- Millisecond timer (*Run tasks)
- Signals (Ctrl-C interrupt)
- Date/Time from the RTC chip)
Keyboard layout is US (QWERTY). You can change it according to your own preferences by editing the layout in "pilos/src/sys.l" and re-building the image (see below).
Note that the arrow keys are not supported. Please use the line editor's VI mode, as described in http://software-lab.de/doc/tut.html#ledit.
A special bonus is the support of the "Penti" chorded keyboard. You operate it with a single hand, by typing chords and arpeggios on five keys on the numeric keypad ('0', '7', '8', '9', and '+'). A reference table is in https://software-lab.de/penti.html.
File I/O works now. You can write (and create) files with 'out'.
Directories are created automatically as necessary, and you can remove a file with 'rm'. Directories disappear when the last file is removed. As normally, you can read files with 'in' or 'load'.
Still missing is - of course - networking (left as an exercise for the reader;).
The "File" System
Files and directories are implemented in the PicoLisp database. Each file is a DB object, and directories are emulated with the database's B-Trees. Commands like 'pwd', 'cd' or 'dir' are plain Lisp functions.A small demo video
This video was taked from a Qemu test run:How to get PilOS
You can download a tarball with all sources, and a ready-made image to be put onto an USB-Stick or passed to Qemu.$ wget http://software-lab.de/pilos.tgz $ tar xvfz pilos.tgz $ cd pilosYou can now start it with Qemu:
$ qemu-system-x86_64 -m 4096 -ctrl-grab -no-reboot x86-64.imgor copy it to an USB-Stick (e.g. on /dev/sdb, be sure about that!)
$ sudo dd if=x86-64.img of=/dev/sdband then use it to reboot your PC.
You can exit PilOS (and reboot) by hitting the END key.
I haven't tested it much yet. No idea if it runs on other machines besides Qemu and my own Acer notebook ;)
Building the image
To build the image yourself, you need a recent PicoLisp version.Note that the variable 'PIL' in pilos/Makefile must point to the 'pil' script in the installation directory. I have the "pilos/" directory directly in my PicoLisp runtime directory, so 'PIL' is "../pil". You might change that to something like
PIL = /home/foo/picoLisp/pilThen execute 'make' in the "pilos/" directory. Besides for some intermediate files, it will create the image in "x86-64.img".
https://picolisp.com/wiki/?pilos
16aug17 | abu |