Obtaining a Time Machine
Since most of us will not have a 64K Radio Shack TRS-80 Color Computer laying around, as well as a disk drive and the original OS-9 floppy disks, I suppose running an emulator on your PC/Mac/Linux machine will have to suffice.
I personally use the XRoar emulator since I can run it on my Mac, Windows PC or Raspberry Pi. It allows me to emulate everything from a 1980 4K CoCo with Color BASIC 1.0, on up to a 512k CoCo 3. It has been invaluable in articles I have written, because I can quickly switch between Color, Extended and Disk BASIC systems of various versions using various amounts of RAM. There are other options available such as VCC for Windows, or the cross-platform MAME, but I do not know the specifics of how (or if) they can emulate an old 64K CoCo. (I think VCC is CoCo 3 only.)
Over at the Color Computer Archive, disk images have been preserved from the original V1.00.00 release of CoCo OS-9:
I went and found the very first V1.00.00 release:
There was a later V1.01.00 update, and then an even later V2.00.00 update, but I want just just focus on what 1984 had to offer.
Inside that .zip file you will find two disk images:
- OS9L1V1B.DSK – boot program (for Disk BASIC 1.0 users) and disk drive speed test utility.
- OS9L1V1M.DSK – the actual OS-9 operating system itself, contained on this 156K 35-track single sided disk image.
As long as your CoCo or emulator is set to have 64K and Disk Extended Color BASIC 1.1, you can just mount the second one (OS9L1V1M.DSK) and then type “DOS” to boot in to OS-9. It will take awhile, since we are also emulating a slow floppy drive.
A “set time” utility is there asking for date and time — anyone here old enough to remember with early PCs all did the same thing as they booted to PC-DOS? Life before realtime clocks – the struggle was real!
Sadly, the set time utility is not Y2K compliant and will not let you enter “22” to mean 2022. You can type something like “22/7/27 8:58” but it will treat that as the year 1922.
I should point out that, internally, it seems the clock code understood years past 2000 — but the utility did not allow you to enter them. If you set the time to just before midnight on December 31, 1999, then wait, you will see it rolls over from 1999 to the year of 19100:
The NitrOS9 project, which has created an open source update from the old OS-9, has fixed all these issues. Anyone interested in running OS-9 on a CoCo these days should be using that, but for this article, we will be sticking strictly with stock OS-9 as it existed in 1984. Which means maybe I should have entered the year to be 1984…
But I digress…
OS-9 Beginner’s Guide
I used to teach week-long courses on OS-9 for Microware, but we’ll keep this article much simpler and just look at commands and how the disk directories are set up.
As mentioned earlier, there is a “set time” utility, and in the previous screen shot you can see I used a command called “date” which will display the date. Typing it with the option of “t” added — “date t” — will display the date and add the time at the end.
If you type “dir” you will get a directory of the OS-9 disk:
OS9:DIR DIRECTORY OF . 00:05:38 OS9BOOT CMDS SYS DEFS STARTUP
Unlike Disk BASIC, OS-9 has a real file system that support longer filenames, upper and lowercase, subdirectories and much more. Since the CoCo VDG chip lacked true lowercase characters (lowercase existed, but would be displayed as inverted uppercase characters), by default CoCo OS-9 displays everything in uppercase even if the underlying text is using lowercase. You can type commands in upper or lowercase since the file system is not case sensative.
We see five filenames, but can’t tell if they are files or directories. There is a convention in OS-9 to make filenames lowercase, and directory names UPPERCASE. Since we can’t see the difference, we can use the option “e” on the dir command to display a longer listing:
OS9:DIR E DIRECTORY OF . 00:08:28 CREATED ON OWNER NAME ATTR START SIZE ============================== 83/06/02 1921 0 OS9BOOT ------WR A 3032 83/06/02 1956 0 CMDS D-EWREWR 3C 620 83/06/02 2002 0 SYS D-EWREWR 164 A0 83/06/02 2002 0 DEFS D-EWREWR 17F C0 83/06/02 2003 0 STARTUP ----R-WR 15F E
Yuck! But we’ll get to what this means in a moment. You will see the screen pauses at the end. This is a feature built-in to OS-9 and it can be turned on or off. Press SPACE and you will see the listing continues, but there wasn’t anything left other than an empty line before returning to the “OS9:” command prompt.
Looking at that listing, if we made it expand to a wider display, it becomes much easier to understand. It might look like this on a 40 or 80 column OS-9 system:
DIRECTORY OF . 00:08:28 CREATED ON OWNER NAME ATTR START SIZE ===================================================== 83/06/02 1921 0 OS9BOOT ------WR A 3032 83/06/02 1956 0 CMDS D-EWREWR 3C 620 83/06/02 2002 0 SYS D-EWREWR 164 A0 83/06/02 2002 0 DEFS D-EWREWR 17F C0 83/06/02 2003 0 STARTUP ----R-WR 15F E
- CREATED ON – The first column is the date (YY/MM/DD) and time (HHMM) the file/directory was created.
- OWNER – The second column is the owner of the file/directory. OS-9 Level 1 is a multi-user system, and each user can have its own unique user number. 0 is reserved for the administrator (super user).
- NAME – The third column is the file/directory name. OS-9 Level 1 allowed filenames to be up to 28 characters long, and use upper and lowercase. Spaces are not allowed, and there are some other restrictions, like files cannot start with a number and most special characters are not allowed. But still, far more advanced than DOS was.
- ATTR – Attributes of the file. This is how we can tell if something is a file or a directory. There are eight attributes, and the first is D if it is a directory, or – if it is a file. We can skip the next one, and focus on the next two sets of 3 attributes. They are “EWR” — the first three are PUBLIC Execution (for binaries), Write (writeable), and Read (readable). The next three are the same but for the OWNER. Thus, you can have a file that ONLY the user can read, or everyone can read. You can make a file that only the user can write to, but the public can read but NOT write to. The same thing for directories. Private directories could exist, usable only by the owner, or public, that other users on the system could read and/or write to.
- START – This is a hexadecimal value of what logical sector the file/directory starts at on the disk system. OS-9 splits a disk up in to logical sectors of 256-bytes each. We don’t need to worry about this.
- SIZE – This is the file size, also shown in hexadecimal. We see the “startup” file is E (&HE to BASIC users, or 0xE to C programmers) long – 14 bytes.
Here are what those files are:
- OS9BOOT – The OS-9 boot file, which contains the kernel, device drivers, etc. This will be all the files necessary to get the system up and running to the OS9: command prompt.
- CMDS – We see that this is a directory. It contains various command line utility programs.
- SYS – Another directory. This one contains system text files.
- DEFS – Another directory. This one has definition text files used by the assembler/compiler and such.
- STARTUP – This is a text file with public Read and owner Write/Read. It is basically AUTOEXEC.BAT for OS-9.
Let’s try the “list” command on the STARTUP file, which we know is 14 bytes long:
OS9:LIST STARTUP SETIME </TERM
The contents of the file is displayed, much like using “cat” under Linux or “type” under MS-DOS. We see the contents is one line, “SETIME </TERM” and if we counted those characters, we’d get 13 characters. The file size is 14, because it contains those thirteen characters plus a carriage return at the end of the line.
By default, OS-9 will boot and then run whatever is in this STARTUP file. This allows us to customize things if we wanted to, or remove that set time prompt completely.
Let’s see what is in the various directories.
OS9:DIR CMDS DIRECTORY OF CMDS 00:26:46 ASM ATTR BACKUP BINEX BUILD CMP COBBLER COPY DATE DCHECK DEBUG DEL DELDIR DIR DISPLAY DSAVE DUMP ECHO EDIT EXBIN FORMAT FREE IDENT LINK LIST LOAD LOGIN MAKDIR MDIR MERGE MFREE OS9GEN PRINTERR PROCS PWD PXD RENAME SAVE SETIME SHELL SLEEP TEE TMODE TSMON UNLINK VERIFY XMODE
There is quite a bit available! We see some commands that may look familiar — like DATE (show the date), DEL (delete a file), COPY (copy a file), DIR (directory), DELDIR (delete directory), ECHO (echo text), LIST (list a file), MAKDIR (make directory), RENAME (rename a file) and so on. OS-9 has a full file system with most of the standard commands you would expect.
If you have ever used “CHKDSK” on a PC or “fsck” on Linux, you will find OS-9 DCHECK familiar. If you have ever merged files on a Linux system, MERGE will be familiar.
OS-9 is very Unix-like in design, and with Linux being based on UNIX, it will have some familiar aspects to a Linux user.
We will explore these commands later, but let’s keep looking.
OS9:DIR SYS DIRECTORY OF SYS 00:33:34 ERRMSG PASSWORD MOTD
Not much there. All three of these are text files.
- ERRMSG – Contains a text listing of error messages (OS-9 will use an error number like ERROR #216, and this text file will show you that it means “PATH NAME NOT FOUND”.) You could type “LIST SYS/ERRMSG” if you wanted to see them all. You can also type the command PRINTERR to activate long error messages. Now instead of just getting “ERROR #216” it will be followed by the text description from the file. This will make error messages slower, though, since each time it will have to seek through the text file to find the entry and display it.
- PASSWORD – As a multi-user system, OS-9 has a password file that can have entries for each user. You could create a password file with an entry for “admin” that would let them log in, change to the user’s “home” directory, and set their user ID to 0 (super user). Or you could make an entry for “bob” that sets his home directory somewhere else and makes him user 42, non-super user. Type “LIST SYS/PASSWORD” to see what is in there. You will see nothing is encrypted. Ah, those early days of operating systems! This file is used by the “login” command.
- MOTD – Message of the Day text file. This file will be displayed to a user after they log in using the login command. We don’t see it because by default this OS-9 just boots directly to an OS9: command prompt.
OS9:DIR DEFS DIRECTORY OF DEFS 00:39:53 OS9DEFS RBFDEFS SCFDEFS SYSTYPE
There are text files used by the 6809 assembler. They are sorta like .h header files in C. They contain various text definitions for bit values or whatever.
- OS9DEFS – Definitions for the operating system.
- RBFDEFS – Definitions for the “random block file” manager (disk).
- SCFDEFS – Definitions for the “sequential character file” manager (console, serial ports, etc.)
- SYSTYPE – Definitions for the system.
Unless we are programming for those, we would never use these files.
So what can we do?
In the next installment, we’ll explore some of the commands, and discuss some of the things that make OS-9 very unique (and the reason why it can run as a disk-based operating system, or completely out of ROM with no file system at all).
To be continued…