Apple DOS
Encyclopedia
Apple DOS refers to operating systems for the Apple II series
Apple II series
The Apple II series is a set of 8-bit home computers, one of the first highly successful mass-produced microcomputer products, designed primarily by Steve Wozniak, manufactured by Apple Computer and introduced in 1977 with the original Apple II...

 of microcomputers
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

 from late 1978 through early 1983. Apple DOS had three major releases: DOS 3.1, DOS 3.2, and DOS 3.3; each one of these three releases was followed by a second, minor "bug-fix" release, but only in the case of Apple DOS 3.2 did that minor release receive its own version number, Apple DOS 3.2.1. The best-known and most-used version was Apple DOS 3.3 in the 1980 and 1983 releases. Prior to the release of Apple DOS 3.1, Apple users had to rely on audio cassette tapes for data storage and retrieval, but that method was notoriously slow, inconvenient and unreliable.

Version history

Apple DOS was largely written by Steve Wozniak
Steve Wozniak
Stephen Gary "Woz" Wozniak is an American computer engineer and programmer who founded Apple Computer, Co. with Steve Jobs and Ronald Wayne...

, Randy Wigginton, and outside contractor Paul Laughton. To the dismay of many programmers, Apple
Apple Computer
Apple Inc. is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad...

 published no official documentation until release 3.2.

There was no Apple DOS 1 or 2, per se. versions 0.1 through 2.8 were serially enumerated revisions during development (which might as well have been called builds 1 through 28). Apple DOS 3.0 (a renamed issue of version 2.8) was never publicly released due to bugs.

Apple DOS 3.1 was publicly released in June 1978 (slightly less than one year after the Apple II was introduced), becoming the first disk-based operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 for any Apple computer. A bug-fix release came later, addressing a problem with its MASTER CREATE utility, which was used to create Apple DOS master disks. (The built-in INIT command created disks that could be booted only on machines with at least the same amount of memory as the one that had created them. MASTER CREATE included a self-relocating version of DOS that would boot on Apples with any memory configuration.)

Apple DOS 3.2 was released in 1979 to reflect major changes in computer booting methods that were built into the successor of the Apple II, the Apple II Plus. Instead of the original Integer BASIC
Integer BASIC
Integer BASIC, written by Steve Wozniak, was the BASIC interpreter of the Apple I and original Apple II computers. Originally available on cassette, then included in ROM on the original Apple II computer at release in 1977, it was the first version of BASIC used by many early home computer owners...

, the Apple II Plus firmware
Firmware
In electronic systems and computing, firmware is a term often used to denote the fixed, usually rather small, programs and/or data structures that internally control various electronic devices...

 included the newer Applesoft II floating point BASIC
Applesoft BASIC
Applesoft BASIC was a dialect of Microsoft BASIC supplied with the Apple II series of computers. It superseded Integer BASIC and was the BASIC in ROM in all Apple II series computers after the original Apple II model. It was also referred to as FP because of the command used to invoke it instead...

. The new firmware also had an autostart feature which would automatically find a disk controller and boot from it when the system was powered up—earning it the name Autostart ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

.

Apple DOS 3.3 was released in 1980. It improved various functions of release 3.2, while also allowing for large gains in available floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

 storage; the newer P5A/P6A PROM
PROM
PROM may refer to:*Phosphate rich organic manure*Premature rupture of membranes, an obstetric term*PROM-1 land mine*Programmable read-only memory, related to electronics...

s in the disk controller could read and write data at a higher density, so that instead of 13 sectors (3.25 kB
Kilobyte
The kilobyte is a multiple of the unit byte for digital information. Although the prefix kilo- means 1000, the term kilobyte and symbol KB have historically been used to refer to either 1024 bytes or 1000 bytes, dependent upon context, in the fields of computer science and information...

), 16 sectors (4 kB) of data could be stored per disk track, increasing the capacity from 113.75 kB to 140 kB per disk side (16 kB of which was used by filesystem overhead and a copy of DOS, on a DOS 3.3-formatted disk), leaving 124 kB for user programs and data. DOS 3.3 was, however, not retrocompatible; it could not read or write DOS 3.2 disks. To address this problem, Apple Computer released a utility called "MUFFIN" to migrate Apple DOS 3.2 files and programs to version 3.3 disks. Apple never offered a utility to copy the other way. To migrate Apple DOS 3.3 files back to version 3.2 disks, someone wrote a "NIFFUM" utility. There were also commercial utilities (such as Copy II Plus) that could copy files from and to either format (and eventually ProDOS
ProDOS
ProDOS was the name of two similar operating systems for the Apple II series of personal computers. The original ProDOS, renamed ProDOS 8 in version 1.2, was the last official operating system usable by all Apple II series computers, and was distributed from 1983 to 1993...

 as well). Release 3.3 also improved the ability to switch between Integer BASIC and Applesoft BASIC, if the computer had a language card (RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

 expansion) or firmware card.

Technical details

Apple DOS 3.1 disks used 13 sectors of data per disk track, each sector being 256 B in size. It used 35 tracks per disk side, and could access only one side of the floppy disk, unless the user flipped the disk over. This gave the user a total storage capacity of 113.75 kB per disk side, of which about 10 kB were used to store DOS itself and the disk directory, leaving about 100 kB for user programs.

Compared to the modern operating systems, Apple DOS was quite primitive. The first layer of the operating system was called the RWTS, which stands for "read/write track sector". This layer consisted of subroutine
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....

s for track seeking, sector reading and writing, and a disk formatting. An API called the File Manager was built on top of this, and implemented functions to open, close, read, write, delete, lock (i.e. write-protect), unlock (i.e. write-enable), and rename files, and to verify a file's structural integrity. There is also a catalog function, for listing files on the diskette, and an init function, which formats a disk for use with DOS, and stores a startup program (usually called HELLO) that will be auto-started when this disk is booted. On top of the File Manager API, the main DOS routines were implemented which hooked into the machine's BASIC interpreter and intercepted all disk commands. It provided BLOAD, BSAVE, and BRUN for storing, loading and running binary executables. LOAD, RUN, and SAVE were provided for BASIC programs, and an EXEC was provided for running text-based batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

s consisting of BASIC and DOS commands. Finally, 4 types of files existed, identified by letters in a catalog listing.

Apple DOS File Formats:
  • I: Integer BASIC
    Integer BASIC
    Integer BASIC, written by Steve Wozniak, was the BASIC interpreter of the Apple I and original Apple II computers. Originally available on cassette, then included in ROM on the original Apple II computer at release in 1977, it was the first version of BASIC used by many early home computer owners...

     programs (stored in a compact format, not plain-text).
  • A: AppleSoft BASIC
    Applesoft BASIC
    Applesoft BASIC was a dialect of Microsoft BASIC supplied with the Apple II series of computers. It superseded Integer BASIC and was the BASIC in ROM in all Apple II series computers after the original Apple II model. It was also referred to as FP because of the command used to invoke it instead...

     programs (also stored in a packed, space-saving format).
  • B: Binary file
    Binary file
    A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text...

    s, either executable machine-language programs, or data files.
  • T: ASCII
    ASCII
    The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

     text file
    Text file
    A text file is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists within a computer file system...

    s (or plain-text, unpacked batch files).


There were four additional file types; 'R', 'S' and an additional 'A' and 'B', none of which were fully supported. DOS recognized these types for catalog listings only, and there were no direct ways to manipulate these types of files. The 'R' type found some use for relocatable binary executable files. A few programs supported the 'S' type as data files.

Relocatable software

Most 8-bit Apple II machine language programs did not concern themselves with code relocation since the Apple II usually did not run multiple programs at the same time like modern computers. Programs were generally written to always expect to find their machine code at the same memory location every time. Fully relocatable code was more complicated and difficult to implement.

Apple DOS, however, needed to accommodate varying amounts of memory installed in an Apple II — from 16 kB to 48 kB. DOS would load itself at the highest point possible, to free up the lower memory locations for BASIC programs and graphics capabilities. In machines with 48 kB or more memory, it occupied the region from $9600 to $BFFF (three file buffers + 10 kB of software), but could load in a lower memory area if less system memory were available. (In comparison, ProDOS always loads into language card RAM, thus requiring at least a 64 kB machine.)

A call vector table in the region of $03D0-03FF allowed programs to find DOS wherever it was loaded into the system memory. For example, if the DOS hooks into the BASIC CLI stopped functioning, DOS could be reinitialized by calling location $03D0 (976) — hence the traditional "3D0G" command to return to BASIC from the System Monitor.

Boot loader

The process of loading Apple DOS involved a series of very tiny programs, each of which carried the loading process forward a few steps before passing control to the next program in the chain.
  • Originally, the Apple II ROM did not support disk booting at all. At power-up it would go straight to the System Monitor prompt. At this point, booting from disk required the user to type the slot number followed by Control-P then Return).
  • When the Apple II Plus was introduced, it included the ability to scan each expansion slot (working downward from slot 7 to slot 1) for an expansion card ROM with additional boot code, and automatically call it.
  • The expansion card ROM boot code attempts to boot from drive 1 of the controller, by moving the read/write arm to track zero, and attempting to read 256 bytes from sector zero of that track. (If no readable disk is present the drive spins indefinitely until a readable disk is provided and the drive door is closed.)
  • Sector zero contains a small program which tells the computer how to read sectors 0 to 9 of track zero (re-reading sector 0 in the process).
  • The program in sectors 1-9 of track 0, including the complete RWTS code, then proceeds to load tracks 1 and 2, which contain the rest of DOS. On a "system master" disk, code is also included to relocate DOS as high in system memory as possible, up to the 48 kB limit of the Apple II's main memory ($BFFF).
  • Once DOS is loaded into memory, it attempts to load and execute a startup program as indicated in the DOS program code. This was commonly a BASIC language program named HELLO (or some other name) but DOS could be modified to run other types of programs at startup, such as an executable binary file. The appearance of the right-hand bracket ( ] ) on the screen was an indication to the user that an Applesoft BASIC startup program was loading, while a greater-than symbol ( > ) indicated an Integer BASIC program was loading.
  • The startup program would then begin executing.

Integer BASIC and Applesoft floating point BASIC support

The Apple II started out using a simple BASIC interpreter known originally as Apple BASIC and later as Integer BASIC
Integer BASIC
Integer BASIC, written by Steve Wozniak, was the BASIC interpreter of the Apple I and original Apple II computers. Originally available on cassette, then included in ROM on the original Apple II computer at release in 1977, it was the first version of BASIC used by many early home computer owners...

. It could only handle integer numbers ranging from -32768 to 32767 and only had built-in support for low-resolution graphics. But it was the first version of BASIC available for the Apple II and is what the earliest BASIC programs used.

Later, Apple commissioned Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 to develop a much more capable interpreter known as Applesoft BASIC
Applesoft BASIC
Applesoft BASIC was a dialect of Microsoft BASIC supplied with the Apple II series of computers. It superseded Integer BASIC and was the BASIC in ROM in all Apple II series computers after the original Apple II model. It was also referred to as FP because of the command used to invoke it instead...

, capable of handling floating-point real numbers with up to nine digits of precision and base 10 multipliers from -38 to +38, and with support for high-resolution graphics. While more capable, Applesoft could not run Integer BASIC programs, causing some users to resist upgrading to it.

DOS 3.3 was released when Applesoft BASIC was standard in ROM on the Apple II Plus, so Apple designed it to support switching back and forth between the two BASIC interpreters. The DOS 3.3 System Master disk contained Integer BASIC and Applesoft on disk as a binary files which could be loaded into RAM, allowing whichever language was not resident in ROM to be used on any machine with enough RAM. The user could switch between BASICs by typing either FP or INT at either BASIC prompt. DOS automatically chose the needed language when running a saved program. Applesoft programs were saved as type A files, while Integer BASIC programs were saved as type I files.

Decline of Apple DOS

After 1980, DOS entered into a state of stagnation, along with all other Apple II products, as Apple concentrated its efforts on the ill-fated Apple III
Apple III
The Apple III is a business-oriented personal computer produced and released by Apple Computer that was intended as the successor to the Apple II series, but largely considered a failure in the market. Development work on the Apple III started in late 1978 under the guidance of Dr. Wendell Sander...

 computer and its SOS operating system. After the Apple III had been abandoned by the company, two more versions of Apple DOS, both still called DOS 3.3 but with some bug fixes and better support for the new Apple IIe
Apple IIe
The Apple IIe is the third model in the Apple II series of personal computers produced by Apple Computer. The e in the name stands for enhanced, referring to the fact that several popular features were now built-in that were only available as upgrades and add-ons in earlier models...

 model, were released in early and mid 1983.

Without third-party patches, Apple DOS could only read floppy disks running in a 5.25-inch Disk II disk drive and could not access any other media, such as hard disk drives, virtual RAM drives, or 3.5-inch floppy disk drives. The structure of DOS was such that it was not possible to have more than 400kB available per drive without a major rewrite of almost all sections of the code; this was the main reason Apple abandoned DOS in 1983, when Apple DOS was entirely replaced by ProDOS
ProDOS
ProDOS was the name of two similar operating systems for the Apple II series of personal computers. The original ProDOS, renamed ProDOS 8 in version 1.2, was the last official operating system usable by all Apple II series computers, and was distributed from 1983 to 1993...

.

ProDOS retained the 16-sector low-level format of DOS 3.3 for 5.25 inch disks, but introduced a new high-level format that was suitable for devices up to 32 MB
Megabyte
The megabyte is a multiple of the unit byte for digital information storage or transmission with two different values depending on context: bytes generally for computer memory; and one million bytes generally for computer storage. The IEEE Standards Board has decided that "Mega will mean 1 000...

 in size; this made it suitable for hard disks and 3.5-inch floppies. All the Apple computers from the Apple II Plus onward can run both DOS 3.3 and ProDOS
ProDOS
ProDOS was the name of two similar operating systems for the Apple II series of personal computers. The original ProDOS, renamed ProDOS 8 in version 1.2, was the last official operating system usable by all Apple II series computers, and was distributed from 1983 to 1993...

, the Apple II Plus requiring a "Language Card" memory expansion to use ProDOS; the Apple //e and later models had built-in Language Card hardware, and so could run ProDOS out of the box. ProDOS included software to copy files from Apple DOS disks. However many people who had no need for the improvements of ProDOS (and who did not like its much higher memory footprint) continued using Apple DOS or one of its clone
Clone (computer science)
In computing, a clone is a hardware or software system that is designed to mimic another system. Compatibility with the original system is usually the explicit purpose of cloning hardware or low-level software such as operating systems...

s long after 1983. The Apple convention of storing a bootable OS on every single floppy disk meant that commercial software could be used no matter what OS the user owned. A program called DOS.MASTER
DOS.MASTER
DOS.MASTER is a program for Apple II computers which allows Apple DOS 3.3 programs to be placed on a hard drive or 3½" floppy disk and run from ProDOS...

 enables users to have multiple virtual DOS 3.3 partitions on a larger ProDOS volume, which allowed the use of many floppy-based DOS programs with a hard disk.

Apple stopped authorizing user groups to distribute DOS 3.3 many years ago, but granted one company, Syndicomm, an exclusive license to resell DOS 3.3.

Performance improvements and other versions

DOS's RWTS could read or write a track in two revolutions with proper interleaving. A sector of the spinning disk would pass by under the read/write head while RWTS was decoding the just-read sector (or encoding the next one to be written), and if this sector was the next one needed, DOS would need to wait nearly an entire revolution of the disk for the sector to come around again. This was called "blowing a rev" and was a well-understood performance bottleneck in disk systems. To avoid this, the sectors on a DOS disk were arranged on the disk something like this:

0 8 1 9 2 10 3 11 4 12 5 13 6 14 7 15

When reading and decoding sector 0, then, sector 8 would pass by, so that sector 1, the next sector likely to be needed, would be available without waiting. When reading sector 7, two unneeded sectors, sectors 15 and 0, would pass by before sector 8 was available, and when reading sector 15, the drive would always have to wait a revolution for sector 0 on the same track. However, the sector 0 actually needed in most cases would be on the next higher track, and that track could be arranged relative to the last one to allow the needed time to decode the just-read sector and move the head before sector 0 came around. On average, a full track could be read in two revolutions of the disk.

Unfortunately, the DOS file manager ruined this efficiency by copying bytes read from or written to a file one at a time between the RWTS buffer and main memory, requiring more time and resulting in DOS constantly blowing revs when reading or writing files. Programs became available early on to format disks with modified interleaves; these disks gave DOS more time between sectors to copy the data, ameliorating the problem. Later, programmers rewrote the file manager routines to avoid making the extra copy for most sectors of a file; RWTS was instructed to read or write sectors directly to or from main memory rather than a buffer when at least a full sector was to be transferred. Speedups in the LOAD command of three to five times were typical.

This functionality soon appeared in commercial products, such as Pronto-DOS, Diversi-DOS, and David-DOS, along with additional features, but was never used in an official Apple DOS release. Similar functionality was, however, employed by Apple's successor operating system, ProDOS. The Apple IIGS
Apple IIGS
The Apple , the fifth and most powerful model in the Apple II series of personal computers produced by Apple Computer. The "GS" in the name stands for Graphics and Sound, referring to its enhanced graphics and sound capabilities, both of which greatly surpassed previous models of the line...

 operating system, GS/OS
GS/OS
GS/OS is an operating environment developed by Apple Computer for its Apple IIGS personal computer that uses the ProDOS filing system. It provides facilities for accessing the file system, controlling input/output devices, loading and running program files, and a system allowing programs to handle...

, would eventually employ an even more efficient "scatter read" technique that would read any sector that happened to be passing under the read head if it was needed for the file being read.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK