Apple DOS


Apple DOS was the disk operating system that came with the earlier Apple II series of computers until the launch of the Apple IIe Enhanced where it was superceded by "ProDOS". Before Apple DOS, the only way of loading and saving data using your Apple II was using a cassette recorder via the cassette port.

At the start of the Apple II's life in 1977, it didn't have a floppy disk drive, so there was no DOS (Disk Operating System).


Whilst Steve Wozniak wanted to write the disk operating system for his new floppy drive, Steve Jobs chose to farm out the work to a third party. They did consider using a pre-existing one in CP/M but Wozniak considered it too complex in general use for his machine. So Apple DOS was created by a company called Shepardson Microsystems. Shepardson employee Paul Laughton worked with early Apple employee Randy Wigginton to build DOS in just 35 days.

This DOS provided the following basic functionality:

  • Open file
  • Close file
  • Read from file
  • Write to file
  • Delete file
  • Lock (write-protect)
  • Unlock (write-enable)
  • Rename file
  • Verify a file's structural integrity
  • Catalog (for listing the various files on the disk)
  • Init (formats a disk for use with DOS)



The first commercially available version of Apple DOS was 3.1 - there were no DOS versions before this, as versions 0.1 through 3.0 were all used for development and testing purposes, right up to DOS 3.0.

DOS version 3.1 became available in June 1978. It supported only the lower-density format of disks (13 sectors per track), so a formatted disk could store 113.75 KB (13 x 35 tracks = 455 sectors) per side. DOS would take up about 10 KB of this.
It also only supported single-sided drives (the Disk II was a single-sided floppy drive), so the user would need to flip the floppy disk over to read the other side. A maximum of 105 files can be stored per disk side. DOS 3.x "System Master" disks could boot from any Apple II with at least 16 KB of RAM.

The main DOS routines actually hook into the machine's BASIC interpreter and intercept all disk commands. It provides BLOAD, BSAVE, and BRUN for storing, loading, and running binary executables. LOAD, RUN, and SAVE are provided for BASIC programs, and an EXEC command was provided for running text-based batch files consisting of BASIC and DOS commands. A full list of DOS commands is provided further down this page.

When DOS is loaded, it installs itself at the highest point in memory (remember Apple IIs can have from 16KB up to 48KB of RAM) - this frees up the lower memory for use with BASIC programs and graphics. This differs from the later ProDOS, which always loads itself in the RAM on the language card (which is why it requires a machine with at least 64KB of RAM).

Coinciding with the release of the Apple II Plus in 1978, Apple also released Apple DOS 3.2. This version worked with the II Plus's "Autostart" capability whereby upon startup it would look for a disk controller card, and if found attempt to boot from a floppy on the drives connected to it. Before this, an Apple II would display the System Monitor prompt on startup.

In 1980, Apple DOS 3.3 was released. This version supported higher-density disks (16 sectors per track) which could store up to 140 KB per side. DOS 3.3 was not backward-compatible with earlier versions. DOS 3.3 also improved a number of other aspects of DOS 3.2, such as the ability to switch between Integer BASIC and Applesoft BASIC for computers that had a language card or firmware card.









Files and File Types

Filenames under DOS 3.3 could be from 1 to 30 characters in length, comprising any uppercase keyboard character including spaces but not commas or colons. The filename must start with an uppercase letter.

In Apple DOS, each file is stored with a given type. The following types are recognised by Apple DOS:

  • I - The file is an Integer BASIC program
  • A - The file is an Applesoft BASIC program
  • B - The file is a binary file (either executable or data)
  • T - The file is an ASCII text file

The following types also exist, but aren't directly supported by Apple DOS and are rarely used:

  • R - Relocatable binary file
  • S - Source

When you run CATALOG on an Apple DOS floppy disk, the type will be shown beside each file in the listing, as can be seen in the screenshot to the right. Note that an asterisk before the file type means that file is locked (read-only).

The 3-digit number is the file size, which is the number of 256-byte sectors that the file is using up.


Apple DOS Commands

Apple DOS does not accept lowercase commands and does not support subdirectories, so usually you'll keep Caps Lock on.

Binary File Commands  
BRUN name Executes the binary file 'name'.
BSAVE name ,A ,L Saves the file 'name' starting at A, with length L.
BLOAD name Loads the binary file 'name'.
BASIC Program Commands
FP Activates Applesoft BASIC and clears any program currently in memory.
INT Activates Integer BASIC and clears any program currently in memory.
RUN name Executes 'name' from disk.
LOAD name Loads 'name' from disk.
SAVE name Saves the current program as 'name' on disk.
INIT name Initializes a disk, erasing all data from it and setting the startup program to 'name'. It stores a copy of DOS on the first three tracks, and stores startup program 'name' that is auto-started when this disk is booted from.
MAXFILES n Sets the maximum number of open files.
MON {,C} {,I} {,O} Selects whether Commands, Output, or Input are echoed to the screen.
NOMON {,C} {,I} {,O} Disables printing of DOS operations.
Programming Commands
CHAIN name Allows Integer BASIC programs to run other Integer BASIC program.
PR# n Re-directs output to slot n. If n is 0, output is sent to the 40-column display. If output is sent to a slot containing a disk controller, the system attempts to boot from Drive 1 of that slot.
IN# n Re-directs input to come from slot n. If n is 0, input comes from the keyboard.
Filing Commands  
CATALOG Displays contents of the current disk directory.
RENAME oldname, newname Changes the name of a disk file.
DELETE name Deletes the file 'name'.
LOCK name Prevents the file 'name' from being deleted, renamed or changed.
UNLOCK name Removes file locking.
VERIFY name Checks to see than an entire file is readable.
Text File Commands  

OPEN name

Opens a text file for reading.
CLOSE name Closes a text file.
READ name Sets the file 'name' to read mode.
WRITE name Sets the file 'name' to write mode.
APPEND name Sets write mode for 'name' at the end of the current file.
POSITION name,x Moves the record pointer for 'name' to the position specified by x.
EXEC name Reads text from file 'name' entering it as though it were typed from the keyboard.


How to Check Which OS You're Running

The best way is to simply try running a command that doesn't exist in Apple DOS but does in ProDOS, such as "CAT". If that command works, you're in ProDOS. If it doesn't, try "CATALOG". If that works you're in DOS 3.x. If it doesn't then you're not running either Apple DOS or ProDOS.


How to Change Drive

All DOS commands can be suffixed with a ",Dx" where x is either 1 or 2 denoting the drive number. Each slot in the Apple II can have up to 2 drives. Slot 6 is usually used for 5.25" drives, and slot 5 is used for 3.5" drives (ProDOS only). Changing to another drive remains for subsequent commands until you change it.


Support for Other Media

Without third-party patches, Apple DOS only supports 5.25" floppy disk media in a Disk II drive. It does not support hard disks, RAM drives, or 3.5" floppy disks. Due to the way in which Apple DOS has been written, it's not possible for it to 'see' more than 400 KB of available storage per drive. This is why in 1983 it was completely replaced by ProDOS, rather than being continued with a version 4.0 with greater support for larger capacity media.



As mentioned, in 1983 Apple started from scratch with a new disk operating system, which they called ProDOS. This continued to support 5.25" floppy disks with up to 16 sectors per track, but also introduced a new high-level format suitable for devices up to 32 MB in capacity. This made ProDOS suitable for not just 5.25" floppies, but also larger capacity 3.5" floppies as well as hard disks. All Apple computers from the II Plus and up can run both DOS 3.3 and ProDOS (the II Plus requires a language card memory expansion for ProDOS to run).

For backward compatibility, ProDOS includes commands that will copy the files from Apple DOS disks.

Unfortunately, for many existing Apple DOS users who had a large library of floppy disks in Apple DOS format, the larger memory footprint of ProDOS and the fact it wasn't directly backward compatible made the prospect of moving to ProDOS unsavoury. For this reason, Apple DOS enjoyed a much longer lifespan than ProDOS, far beyond 1983.

Other enhancements in ProDOS are that it accepts lowercase commands, support for subdirectories (via the use of the new CREATE and PREFIX commands), and timestamping of files.



An Account of the Writing of DOS 3.1 by Paul Laughton (c) 1996:

"In 1977, I became very excited about these new microcomputers. I had been working as a systems programmer on large IBM main frames (for IBM) for eight years. IBM's operating systems had become huge (many megabytes!). It had become so large that no one person could understand it all. The limited address space (64k) and possibility of owning my very own personal computer was very exciting. One day while visiting the Byte Shop (the first personal computer store), I came across a brochure and order form for the new Apple II computer. It was truly amazing. I had to have one. Coincidental to this, I happen to see a small add in the paper from a company called Shepardson Microsystems. They were looking for a programmer. On a lark, I sent them my resume. A few days later I went for an interview. I learned that Bob Shephardson had just signed a contract with Apple Computer to write a Basic Interpreter. He offered me the job of writing it.

Two weeks later, I had left my safe, secure position with IBM to work at the three (now four) person company. Within days I had my very own Apple II work station. This computer was hand delivered to me by Steve Jobs. I learned that the Basic was to go into Apple's next generation of computer, code named Apple Annie. Woz was very excited about this new machine. It was to have plug-in program ROM cartridges and lots of custom LSI.

One problem that we had to solve was that of getting 6502 object code files into the Apple II from our development system The development system consisted of a national COPS microprocessor with a 6502 compiler created by Bob Shepardson. The input to the compiler was a deck of punched cards. The output was paper tape. How do you read paper tape into an Apple II? Woz had the answer. He built a card for the Apple II that would drive a paper tape reader. One day while Woz and I were setting up the tape reader, I noticed that Woz seemed depressed. I asked what was wrong. He replied that he had developed a floppy disk drive for the Apple II. He was really proud of that, but Apple's management had given him an impossible schedule for the delivery of both the hardware and the disk operating system. I said I could do the disk operating system (DOS). Woz was delighted. After a quick consultation with Bob Shepardson and Steve Jobs, Woz and I started to work.

When Woz showed me the designs of the disk controller hardware and software driver, I was truly amazed. At that time, all disk drive controllers were big cards with dozens of large and small scale integrated circuits. The design Woz created required only seven small scale integrated circuits. What was even more amazing was that Woz's design had significantly better performance (data density, reliability, and cost) than existing controllers. When Woz started this design, he did not look at how other people had done it. He thought about how it should be done. Using this process he created something remarkable. This became my real world example of what was to later be called "thinking outside the box." In my later life as an engineering manager, I have told the Woz Controller story to many engineers as a way of getting them thinking on a different path. Unfortunately, most engineers will never attain the level of Steve Wozniak's creativity.

It took Bob Shepardson and Steve Jobs a couple of weeks to negotiate the details (cost, schedule, re-scheduling the Basic, etc.) and sign a contract. If you looked at this contract, you should be amazed. The cost to Apple was very small compared to the value Apple received. The schedule was very short considering the work to be done. The product specifications, deliverables, acceptance criteria, penalty/bonus clauses and legal mumbo jumbo that I have become used to in the years since were all missing. Those were the good old days!

Now that I was no longer doing the Basic and because we had other work coming in, Bob needed to hire another programmer. I knew the perfect candidate. Kathleen O'Brien, my life partner, was a very good programmer - and we worked well together. A few weeks later, Kathleen was Shepardson Microsystems' employee number 5.

During the time I was working on the DOS, big changes were happening at Apple. They moved from their small office space behind the Good Earth Restaurant in Cupertino to their new World Wide Headquarters on Bandly Drive. (We used to joke about the World Wide part. Apple was a tiny start up that had just begun delivering its first production products. Shepardson Microsystems did a lot of projects for similar small start up companies that were going nowhere. Why should Apple be any different? At one point Steve Jobs offered to buy Shepardson Microsystems to form the nucleus for Apple's software development organization. Bob refused the deal. Steve was only willing to pay for Shepardson Microsystems with Apple stock. Bob might have been more interested, but Steve would not increase the offer beyond 10% of Apple's stock.)

One of the big changes came when Apple hired Jeff Raskin to manage Apple's technical writing group. The task of writing the user manuals for the DOS and the new Basic fell on Jeff's shoulders. The task was particularly difficult since no form of specification existed for either product. Jeff had a nearly finished version of the DOS to work with. For the Basic, all he had was the syntax checker part of the code. Jeff's solution was to write the manual as the specification. This was all well and good, but Jeff had big ideas. As he was writing the manual, the specification for both products grew well beyond the scope of the original agreements. For DOS, this lead to several follow on, last minute contracts to cover Jeff's additions. Fortunately, the scope of the DOS changes were limited due to shipping deadlines. This was not the case with the Basic.

Our little Basic grew and grew and grew. It would no longer fit in 48k of RAM. We were going to have to develop code segmentation and overlay methods. Jeff acknowledged the size of this monster by naming it NOTZO BASIC. We called it NutSo Basic.

The final chapter in our association with Apple came soon after a meeting with Apple in October, 1978. I have scanned Randy Wigginton's minutes of this meeting. The meeting.gif file is an small image of the introduction to this document. The meeting.txt file is an OCRed text file of the document. As you can see, the first part of meeting covers fixing some defects in the now shipping Apple DOS 3.0. The second part of the meeting covers discussion about the now bloated NOTZO Basic. I fixed the DOS defects by giving Apple a marked up listing. The Basic problem was fixed a short time later, when Apple canceled the Apple Annie project and the Basic contract. We at Shepardson did not mind. Atari wanted us to write a Basic for their new Atari 800 computer. That is another story....."

Why was the first release of Apple DOS called Apple DOS 3.1?

"Every time I recompiled the code, I incremented a revision counter. The counter started at Rev 0.1. Whenever I got to (n).9, I would roll the counter over to (n+1).0 The first listing I gave Apple was Rev 2.8. They (I forget who) decided they could not call it DOS 2.8, so they changed it to DOS 3.0. Apple did the beta testing with this version (2.8 renamed 3.0). When Apple shipped the DOS for revenue, they incremented it to 3.1 to indicate that the code had changed from the beta version. As a final note, when I transferred the source code to Apple in October, 1978 the Rev number was up to 6.3."