DiOS is an operating system for the raspberry Pi. It currently has a working command shell.
It currently works well inside QEMU, but has not yet been tested on real hardware.
DiOS ships with a "virtual machine" for a basic Turning-complete programming language. Operations can be performed by entering a command into the prompt (over UART).
There are 256 bytes available to the machine to store data. This is for JUST the data: the program (or "command" in DiOS terminology) is stored separately.
State is preserved across successive command runs, so more complex computations can be done in stages with multiple commands.
The following functions are currently supported:
- Manipulating the 256-byte memory array
- Taking text input from the user
- Printing text
The command shell prompts the user to enter a command. A command can be 256 characters long, but changes to memory persist across commands.
The language is from the P" family, which is a common family for many esolangs.
The Tape is a memory array. It is 256 "cells" long, each "cell" being a byte in size (though these limits may change soon). Values on the Tape cannot be randomly addressed, and are modified via the Pointer.
The Pointer points to a "cell" on the Tape. It starts at the first cell (number 0), and can be advanced or sent back one cell at a time.
The only cell in memory that can be modified is the one pointed to by the Pointer.
Commands are composed of one or more of the following characters, each of which performs a function
| character | function |
|---|---|
+ |
Increment value in current cell |
- |
Decrement value in current cell |
> |
Advance pointer |
< |
Move pointer back |
[ |
"anchor" point, used in combination with ] |
] |
If current cell value is 0, move ahead to the next character. If not, jump back to the corresponding [ to continue execution. |
. |
Send ASCII character corresponding to the current cell value over UART |
, |
Read a character over UART and store the corresponding ASCII character in the current cell |
p |
Print the value in the cell as a number |
d |
Dump VM memory buffer |
"current cell" in this context means the cell on the Tape currently pointed to by the Pointer.
Running make builds and runs the OS in QEMU. UART data is sent and received on the terminal. Press Control-a and then C to open the QEMU console (from where it is possible to quit).
arm-none-eabi-gccversion 15arm-none-eabi-binutilsversion 2.45qemu-system-arm
The following Raspberry Pi files need to be sourced to be able to build the image:
bootcode.binfixup.dat
Credits go to the OSDev wiki for providing documentation and example code.