Apple II Operating Systems

Table of Contents

by Phil Daley

from the June 1983 issue of Micro magazine

The operating systems that I have seen available for the Apple use essentially the same read/write routines, but they have been modified or changed. All the disks created by any one system can be read by any other system if you know the procedure. Modifying disks to make them copyprotected (unreadable) is a different technique and a different topic. The Operating Systems covered in this article all use standard DOS 3.3 format disks. The list is as follws: DOS 3.3® , Pascal®, ORCA/M®, Flex® , OS-9® and CP/M® . There are also many varieties and colors of patches and fixes for DOS 3.3 on the market, ranging from Craig Peterson’s and the Floeters’ articles in Nibble to ‘DIVERSI DOS’ and ‘MASTER DOS’.

Except for ORCA, all of the systems have a special {format} command. Whether a user types ‘INIT’, ‘NEWDISK’ or ‘FORMAT’ the results are a disk that is DOS 3.3 compatible as far as the individual sectors are concerned. The difference is in the boot program installed (or not installed) on the disk, and the directory and other housekeeping type sectors (for instance: the VTOC) written to various tracks on the disk. Having talked to some of the individuals responsible for converting operating systems for other microcomputers to the Apple, I discovered that the lowest common denominator and the reason for this compatability at the low level is the DISK II Apple disk drive and controller card, which impose certain hardware limitations on the software involved.

DOS 3.3 from Apple Computer Co.

Other than the CONTROL-D kludge, the standard operating system is highly efficient, moderately user friendly, and extremely error free. Other than the misadventures I had with a Corvus Systems hard disk running DOS 3.3, I have crashed a disk only two or three times. Apparently the people at Corvus do their field testing on the first group of unsuspecting customers that come along, with predictable results. I was able to resurrect most of the files on my crashed disks using a disk zap program.

Due to the lack of disk commands in the BASIC ROM, it is necessary for DOS to intercept all of the commands and check to see if any particular one is a disk command. This is facilitated (for DOS, not for us) by placing a CHR$(4) at the beginnng of every disk command. It is also wise policy to place a CHR$(13) immediately preceding the CONTROL-D to insure that DOS sees it. That is the ‘basic’ problem with Apple DOS. I can’t remember how many programs I’ve written that didn’t work the first time because of the lack of a carriage return.

The only file-handling capability that I find missing is a ‘LIST’ function for textf lies . It would be convenient not to have to run a file reading program to see what is in a particular file.

The technique of a track/sector list of program sectors seems to waste disk space at first glance. (If you want to talk about waste, consider RS DOS for the Color Computer. The minimum amount of information that can be read or written is a granule — 2,304 bytes of information: one half of a track.) The extra space required for short programs is more than compensated for in quick disk access using random records on large files. DOS is able to calculate the exact track and sector that any particular randomaccess record resides on, and immediately seek that sector. This is a tremendous improvement over the sectorlinking so prevalent in other systems.

The best consideration for using Apple DOS is that most of the commands are loaded into RAM and stored there while the computer is left on. This means that disk access to a system disk is kept to the absolute minimum and a program rarely requires a specific system program to reside on the program disk (for example, the ‘CHAIN’ program). In addition, a single drive system is a practical reality. This is not true of the other systems available.

There are also many different patches to the standard DOS on the market today. If one fits a specific application you can use, then by all means, use it. Generally speaking, none of them do everything well, or even the same as standard DOS, and many of them won’t work on anything that is sophisticated - assemblers/ ditors, word processing, or programs with a write-protection scheme. In other words, about 75% of my disks. If you have a large collection of simple BASIC programs, then one of these may suit you quite well.

PASCAL from Apple Computer Co.

The Pascal operating system requires a I6K RAM card in slot 0. I certainly recommend an 8O-column card in slot 3. Having worked in Pascal in 40-column mode, I found it difficult to follow the screen flipping sideways to accommodate the long lines. A nice option is to have a clock card, such as the CPS Multi-function card, included. This will set the system date for you and allow a parallel printer in slot I and serial I/O in slot 2.

The text editor is powerful and easy to use, once you get the hang of it. The assembler is a non-standard version, which I avoid using when possible. The compiler is too fussy, and while diagnosing a zillion errors, should correct some of them for you, especially the silly ones, like where all those ‘;’s belong.

If Pascal were easier to use, I might be tempted to write more programs with it. A straightforward writing of the simplest program starts with

  1. Loading the OS from APPLEl:.
  2. Calling the text editor.
  3. Typing in the appropriate program text.
  4. Saving the WORKFILE.
  5. Exiting the text editor.
  6. Calling the compiler (that’s when you discover all those ‘syntax errors’).
  7. Making a list of the mistakes.
  8. Calling the text editor.
  9. Correcting the errors.
  10. Saving the WORKFILE.
  11. Quiting the text editor.
  12. Compiling the program.
  13. Executing the program.
  14. Discovering a flaw in the program logic (which sends you back to step 7). That’s assuming you corrected all the syntax errors on the first go-round.

Not only is this process inconvenient, but the system drive has to be on-line most of the time, or you get ‘diskitis’ of the thumb from swapping disks. A two-drive system is minimal but three are better. If you really want to cut the turn-around time between edit/compile, get a hard disk. They were invented with Pascal in mind.

I did not intend to give the impression that I don’t like Pascal as a language. I just don’t like the Apple implementation. A microcomputer is a one person computer and shouldn’t make you wait. If you are familiar with time-sharing systems that make you wait no matter what language you are using, then Pascal is probably a better choice than some of the other languages available on those systems.

ORCA/M from Hay den Software

A new entry into the language development system market, ORCA/M is a self-contained OS and (currently) assembler. In the near future, Hayden intends to add a Pascal compiler into the system. (All the commands are already included.) The Operating System is packed into $BOOO-BFFF. Some of the system is also incorporated into the various overlaying parts of the program - text editor, assembler, linker and soon-to-be compiler.

While omitting the BASIC file commands (for obvious reasons), they have included several disk utilities not normally resident in Apple DOS: a PEEK command that invokes a sector editor,a VOLUME command that sets the disk volume number; a TIME command for the current date and time (if you have a clock); an APPEND command that adds a disk file to the current file in memory; a CHECK command that looks for bad sectors, lists a warning if a file is endangered and marks the sector as unusable in the VTOC; a COMPRESS command to either alphabetize the directory or move deleted files to the end of the directory; a COPY command that works like ‘FID’; a RESTORE command to restore deleted files; and a SWITCH command to switch directory entries in the catalog.

All commands are memory resident and may be abbreviated to the shortest definable string. The command search is linear, so that a ‘C’ command would produce the first command with starting with a ‘C’. To address a different ‘C’ command, only enough letters have to be typed to distinguish it from the other ‘C’ commands.

The text editor produces ‘S’ (for Source) type files, and the assembler creates ‘R’ type relocatable object files. The R file must be ’linked’ into an address-oriented, BRUNable binary file. During linking, a subroutine library is searched for undefined addresses, allowing the addition of often used routines to the program without having to manually include them in the source file. ORCA/M has a SUB. LIB file with a raft of subroutines for your use. The assembler uses a fairly standard source file format.

Flex for the Apple from Norell Data Systems

Norell has adapted TSC Flex for the Apple computer using their FLEX09 6809 board. Flex is a small, easily adapted OS because it is mainly disk resident. Almost all of the commands reside on disk and are called into use by typing the appropriate command name. This means the system commands are easily modified or appended because each module is an executable binary file. It also means the system disk must be on-line all the time. Two drives are necessary to perform most functions.

The TSC text editor that comes with the system is an elemental lineoriented editor. It would be great with a hard-copy terminal, but most of us work with CRTs. Now, I have some good and some bad news. The good news is that there are several good screen-oriented text editors available for Flex. The bad news is that you would have to get the source file and type it into the Apple, because the disk format is totally different at the hardware level.

Flex has several convenient commands from the system level. The ‘P’ and ‘O’ commands, prefaced to any other command, send the output to printer or disk respectively. The ‘LIST’ command will print any ASCII (BASIC or Text type) file. ‘APPEND’ will join any number of files (of any type) together into a single file. ‘COPY’ Is like ‘FID’, including wildcards, but has no prompting. Sometimes you copy programs you didn’t intend to by mistake.

A nice feature of Flex is the ease of changing the system commands. At MICRO, we have rewritten several of the commands and added several commands to the original list. Any 6809 machine-language executable file can be a command if its name ends with ‘.CMD’, and it can run at $C100.

Unfortunately, TSC’s extended BASIC is not available as of this date, but Norell Data Systems considers implementation of the Apple version a high priority.

OS-9 from MICROWARE

OS-9 is a newer and more advanced operating system than Flex. Flex is a holdover from the 6800 microprocessor days and was rewritten in 6809 code, but not updated. OS-9 was originally written in 6809 code and utilizes the capabilities of the microprocessor more fully. It includes more advanced technology, such as multi-tasking, and in its higher levels, a multi-user environment.

The OS commands are similar to Flex: they are disk resident and called when needed. However, OS-9 allows loading commands into memory as an option, and removing them when they are no longer needed. Since OS-9 takes up more room in memory than Flex, I still recommend two disk drives.

I don’t have access to another system that runs OS-9, so I can’t compare it to a standard implementation. The Apple OS-9 disks are DOS 3.3 compatible, and as such must not be compatible with the rest of the OS-9 world.

It is a real pleasure, when working with a word processor, to finish one letter and send it to the printer, while at the same time, working on the next letter on the stack without having to wait for the printer to get done before starting in again (there goes the coffee bresks]. There doesn’t seem to be any particular limit to the number of tasks that can be specified to run at the same time, and I gave up after running four tasks simultaneously.

The BASIC that comes with OS-9 is called BASIC09 and is the most Pascallike language I have seen, without being called Pascal. It includes named procedures with parameter passing, data typing, print using, IF. .THEN. .ELSE. .ENDIF, REPEAT. .UNTIL, WHILE. .DO. .ENDWHILE, LOOP. .ENDLOOP, EXITIF. .THEN. .END EXIT, and variables and line numbers (optional] local to procedures. The text editor checks syntax during line entry, and loop and subroutine nesting upon exit from the editor. It almost makes BASIC too easy. Compilation is fast and errors return you to the text editor, text file intact. A trace mode aids in debugging. The BASIC file can be PACKed to remove REMs and spaces and reduce the space requirements of the program. BASIC09 computes to 9 decimal digits.

The text editor is line-oriented, common to most BASICs. It uses commands to move from line to line, as line numbers are optional, includes line insert and delete, and has string search and replace. The Debug mode allows controlled program execution, trace on/off, variables examined/changed, procedure-nesting listing and stepping one or more steps through the program.

BASIC09 improves many of the shortcomings of the standard BASIC language by incorporating ideas and structures of the PASCAL language, without adding the faults of PASCAL and losing the interactivity of BASIC.

CP/M from Digital Research

The Appli-Card from Personal Computer Products, Inc., arrived at our office too late to be included in last month’s new boards article, so I will briefly mention its attributes now. The board includes a six megahertz Z-80 microprocessor and 64K of RAM. The software includes CP/M 1.1 and drivers for an 80-column card or a 70-column hi-res display, horizontal scrolling of up to 255 characters screen width, and display of all 96 printable ASCII characters. It also has a rewritten FORMAT command that includes formatting, copying the CP/M tracks, and disk copy.

The documentation is clearly written in a step-by-step fashion that should allow someone without extensive computer knowledge to install an Appli-Card and have it running in less than 30 minutes. I also booted up Wordstar, MBASIC, GBASIC, and FORTRAN in less time than it takes to write about it. I waited about eight months to receive this card, and it was worth the wait.

The only problem that I’ve found is that the CPS Multi-function card software won’t recognize the Appli-Card as a CPM card, and the program exits immediately, meaning that I have to use the old Apple Serial card to do my printing. The company is currently working on drivers for specialized cards.

The Control Program for Microcomputers is probably the most popular microcomputer operating system, and if you are looking for a system with a large installed base and corresponding software availability to add to your Apple (no small amount of software already), then CP/M is the system for you. In spite of its problems and slowness, the number of people currently using the system assures its place in the future of microcomputers .

One complaint is that the DIR command does not display the length of the files, although that can be determined with the STAT command. Another complaint is the amount of memory that CP/M requires compared to DOS. A standard 48K Apple without DOS (just for reference, not really too useful — have you used a tape recorder lately?) has 47101 bytes of free memory. Adding DOS to the system reduces the total to 36349 bytes. With MBASIC you have 32883 bytes free without the use of hi-res graphics. GBASIC contains hi-res graphics commands and further reduces the amount of memory free to 23793 bytes. That is on a 64K Z-80 board. If you have a RAM card in slot 0, you can increase the amount of space available for programs to 46076 bytes by moving DOS onto the card.

The Microsoft BASICs available, both M and G, are a more standard implementation (like the big machine versions) than Applesoft, and are easier to learn for someone who knows another BASIC. The file commands eliminate the Control-D, and include reading EOF. The text editor also allows whatever indentation and line spacing that you desire.

Wrapping it all up

Since the Apple is so versatile due to its plug-in slots and OEM support by Apple Computer, many additional operating systems are available that increase the quantity of useable software. The one big disadvantage with all the other systems is the lack of disk compatibility between the Apple Disk ][ and other microcomputer disk drives. This means that while the programs will execute without many changes, getting the programs into Apple disk format is the biggest hurdle.