PandorOS
2016-10-03
An operating system in the style of TI-OS for x86.
Table of Contents
Introduction
PandorOS is a small and playful operating system that was modelled after the TI-OS from Texas Instruments. It was the first operating system I wrote that I consider “done” in one way or another. It’s at least done in a way that it boots, you are able to load and store files, persist them on disk and write your own programs.
The Shell
The PandorOS shell is basically an interactive BASIC interpreter that uses the prompt #>
. As all variables in the system are global, you could easily initialize variables and invoke programs by typing !run "program.name"
.
As all commands are valid BASIC commands, you could also create sub-shells that were BASIC programs.
In the top bar, the shell provided access to the system menu, where you could do the following:
Catalog
: Open the online BASIC manualChar Map
: Show a character map that allows insertion of any legal characterShell 0
: Switch between four virtual terminalsSystem
: The system menu which allows you to configure the system.
The virtual terminal system is pretty cool, as you can write a program in the Shell 0
terminal, and without closing the editor, try it out on the Shell 1
terminal.
This feature provides very rough multitasking capabilities. It is not possible to switch between shells while programs are running, though.
Editor
PandorOS has a very simple editor built in, that can be invoked with !Edit <fileName>
. The editor is a very simple, line based editor where the user can
change files to create either data or program files.
PandorOS BASIC
The PandorOS BASIC was modelled after TI BASIC, a very crude and simple BASIC dialect.
It uses →
-based assignments, so value → variable
style whereas most programming languages use a variable = value
style.
There was also a distinction between orders (top level statements) and functions (arithmetic operators).
Here’s a really small program counting from 1 to 10:
1 -> A
Label Loop
Print A
A + 1 -> A
If A < 10
Goto Loop
As you can see, it uses a typical goto
style programming, but does not employ line numbers, but tagged labels. Also the If
statement is implemented by conditionally executing the next line of code or not.
Another, slightly more complex file is the following AUTORUN.BAS
file:
LoadFS("ATA0.0")
"INIT.BAS" -> Str0
If Not Exists(Str0)
Goto Create
Run(Str0)
Exit
Label Create
Print("Create '", Str0, "' in order to customize init sequence.")
Exit
This loads the current file system from the ATA0.0
storage device, then checks if a file called INIT.BAS
exists and runs it, if so. Otherwise, it will
print a small info message what the user can do to perform custom OS initialization.
All available commands can be found in the source code, they are defined in the orders.lst
and functions.lst
files.
Other Features
Char Map
As PandorOS uses the code page 437, a lot of characters were available that could not be entered via the keyboard.
Online Help
Similar to TI-OS, PandorOS features the so called Catalog, an index of all possible BASIC operations. Contrary to TI-BASIC, which had only a list of tokens, the PandorOS Catalog also had a nice online help included that explained what the system commands and tokens do:
Customization
The system color scheme was also customizable and could be persisted to disk. There were more options in the planning, but never implemented.