-
Notifications
You must be signed in to change notification settings - Fork 35
OS 9 Software
Author: Jon Bird
This article is an introduction to writing software for OS-9, especially from the perspective of a Dragon user coming from BASIC and DragonDOS.
Many people first meet OS-9 through applications like Stylograph, but writing software for OS-9 is a different experience from writing for a Dragon in its native mode.
On a Dragon, native mode gives the programmer direct control of the machine. Under OS-9, the operating system manages resources in a much more structured way. That can feel unfamiliar at first, but it also makes OS-9 closer in spirit to modern multitasking operating systems.
Jon Bird's main point is that OS-9 becomes far easier to understand once you stop thinking of it as a monolithic ROM and instead think of it as a set of cooperating modules.
A Dragon running BASIC and DragonDOS bundles most of its core behavior into ROM.
OS-9 is different. It is built from modules that can be combined, replaced, or extended. A minimal OS-9 system consists of the kernel plus whatever managers, drivers, descriptors, and commands are needed to make the machine useful.
On a Dragon, the kernel core is split into modules such as:
OS9p1OS9p2
Those modules handle the core operating-system work, but by themselves they do not know how to talk to specific devices or provide a command interpreter.
OS-9 works by layering modules with clear responsibilities.
The kernel provides the core services needed to manage the machine and processes.
IOMan is the I/O manager. It routes I/O requests to the appropriate file manager.
OS-9 commonly uses two major file managers:
-
SCFManfor sequential devices such as keyboards and screens -
RBFManfor random block devices such as disks
SCFMan understands sequential behavior like line editing, carriage return handling, and delete processing.
RBFMan understands filesystem structures such as sectors, directories, and files on block devices.
Drivers talk directly to the hardware.
For example, the Dragon disk driver knows how to operate the disk controller, but it does not know what a file is. That higher-level knowledge lives in the file manager.
Descriptors tie the pieces together. A descriptor tells OS-9 which driver and file manager should be used for a particular device.
A request to read data from a file passes through several layers:
Your OS-9 program says:
"read 100 bytes from path number n"
IOMan determines which file manager owns path n.
RBFMan interprets the request as filesystem access.
The driver is then asked to read the required sector or sectors.
This modular split is one of the key ideas behind OS-9.
The OS-9 shell fills the role that the BASIC interpreter plays in native Dragon mode.
Both provide:
- built-in commands
- a way to launch external programs
For example, in Dragon BASIC:
PRINT "HELLO WORLD"
is a built-in interpreter action.
In OS-9:
chd /d0
is a shell command handled by the shell itself.
In BASIC, launching an external program is explicit:
RUN "MYPROG"
In OS-9, if a command is not built into the shell, the shell looks for an external module to run.
Once you understand the module model, OS-9 starts to make much more sense:
- the kernel provides core system behavior
- managers provide policy
- drivers provide hardware access
- descriptors connect the pieces
- the shell provides the user-facing command environment
That separation is what gives OS-9 much of its flexibility, and it is also why writing software for OS-9 often feels more like systems programming than traditional 8-bit home-computer development.
NitrOS-9: Empowering 6809 CPUs with a modern, efficient operating system