Small LS logo

Adding disks to OS-9


Introduction

A few support people, who are unfamiliar with Microware's OS-9 real-time operating system, have recently been faced with the problem of replacing the existing disk or adding a second as a backup device.

OS-9 is most commonly used as the embedded real time operating system in machinery such as computer controlled printing presses, textile looms or electron microscopes. It has also been used in consumer electronics such as TV set-top boxes or CDi players. This note briefly describes the relevant features of the operating system and what you need to know about it to replace a failing disk or add an extra drive.

A little history

OS-9 has been around a long time, longer than MS-DOS. It has always been a highly modular multi-tasking, multi-user operating system. It was originally written by Microware under a contract with Motorola for an operating system to demonstrate the capabilities of their 8/16-bit 6809 microprocessor. However, it was soon ported to the 16/32 bit 68000 microprocessor series. The most widespread version seems to be OS-9/68000 version 2.4.

OS-9/68000 is frequently referred to as OS-9/68K or OSK. If you see a reference to V2.4 it is shorthand for OS-9/68000 version 2.4.

My copy of V2.4 dates from 1992 and is still running at the time of writing (March 2006). It has proved extremely stable: I cannot identify a single bug in my system. Unless your copy has been patched, it is not Y2K compliant. V2.9 is still current and is just V2.4 with its date handling patched. Non-compliance is not a big deal. You'll see odd things like the login prompt saying the date is 03/15/106 and the directory listing has similar anomalies, but everything else works as advertised.

Support organisations

Radisys bought out Microware and is now the OS-9 support organisation. OS-9 was the operating system selected for the CDi multimedia player, so the International CD-I Association maintain online copies of the OS9/68K V2.4 manuals: you can download them from there in PDF format.

You should talk to your supplier for first-line support or if you want to upgrade to V2.9 rather than to Radisys. It was your supplier, not Radisys, who ported the operating system to your hardware and wrote the device descriptors and any non-standard drivers that are needed to adapt OS-9 to your hardware. This makes them the best qualified to advise on changes to these components of your system.

What you need to know

In understanding OS-9 you should be aware that it is designed to be installed on bare metal with a bootstrap system that's much less elaborate than the PC BIOS. It can be booted off a disk drive or from read-only memory. Diskless OS-9 systems are common. As a result it has some unusual features. Specifically, all its knowledge about peripherals, etc. has to be compiled into its boot file as a set of device descriptors. If you need to replace the system disk with one having a different size or technology or to add an extra drive, you'll need to modify and/or add disk device descriptors. This isn't difficult to do, but it does require you to know hardware-specific details and be somewhat familiar with assembly language. The descriptors are defined using assembler macros. There are some essentials that you must have before changing the boot file:

  1. a serial port and terminal or terminal emulator that can be used during system boot.
  2. a floppy disk drive that can be used to boot the system.
  3. a detailed hardware description that describes the peripheral memory addresses and interrupts.
  4. the boot objects collection, which should be in /dd/CMDS/BOOTOBJS. File names similar to the module names shown in an mdir display should appear when you list this directory.
  5. the compilers, etc. If you have them /dd/CMDS will contain l68, o68 and r68.
  6. os9gen, which builds and installs the boot file.

I would not consider modifying the boot file without a working serially connected terminal or equivalent configured as /term, the system console. Some systems use a graphics card and keyboard as /term.

Similarly, I won't touch the boot file until I've built and tested a bootable floppy. You should take the same position. The bootable floppy is your get out of jail card.

The hardware description is essential. You won't be able to create or modify a disk descriptor without it.

Supported disk sizes

V2.4 cannot support disks bigger than 2 GB (I said it was old!) and does not use partitioning. However, disk descriptors can be set up with the start sector offset from the start of a disk. This offers the possiblity of creating a set of descriptors, each mapped to a non-overlapping region of the same disk. You'll need to know whether your disk driver can handle the necessary range of track and sector numbers used by your disk before trying this.

An alternative backup method

If you have a network connection and want to back up the OS-9 system disk, an alternative to installing a second disk is to back up your main disk via FTP and make sure you have a bootable floppy setup that could be used to restore the saved image over the network. Your system probably has a ram disk, usually called /r0. You can boot off the floppy and copy additional stuff onto the ram disk from a second floppy if it won't all fit on one. Then you chd /r0 and work from there while you format and reload a replacement hard drive.