Apple DOS

Last updated
Apple DOS
Apple DOS.png
Apple computer running a Hello World program
Developer Apple Computer
Written in Assembly [1]
OS familyApple DOS
Working stateDiscontinued
Source model Closed source
Initial release1978;46 years ago (1978)
Latest release 3.3 / 1980;44 years ago (1980)
Kernel type Monolithic kernel
License Apple Software License Agreement

Apple DOS is the family of disk operating systems for the Apple II series of microcomputers from late 1978 through early 1983. It was superseded by ProDOS in 1983. Apple DOS has 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 is 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.

Contents

Version history

When Apple Computer introduced the Apple II in April 1977, the new computer had no disk drive or disk operating system (DOS). Although Apple co-founder Steve Wozniak designed the Disk II controller late that year, and believed that he could have written a DOS, his co-founder Steve Jobs decided to outsource the task. The company considered using Digital Research's CP/M, but Wozniak sought an operating system that was easier to use. On 10 April 1978 Apple signed a $13,000 contract with Shepardson Microsystems to write a DOS and deliver it within 35 days. Apple provided detailed specifications, and early Apple employee Randy Wigginton worked closely with Shepardson's Paul Laughton as the latter wrote the operating system with punched cards and a minicomputer. [2]

There was no Apple DOS 1 or 2. 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 published no official documentation until release 3.2. [3] [4]

Apple DOS 3.1 was publicly released in June 1978, slightly more than one year after the Apple II was introduced, becoming the first disk-based operating system for any Apple computer. A bug-fix release came later, addressing a problem by means of its MASTER CREATE utility, which was used to create Apple DOS master (bootable) 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 includes a self-relocating version of DOS that boots on Apples with any memory configuration.

Apple DOS 3.2 was released in 1979 to reflect changes in computer booting methods that were built into the successor of the Apple II, the Apple II Plus. New firmware included an auto-start feature which automatically found a disk controller and booted from it when the system was powered upearning it the name "Autostart ROM".[ citation needed ] DOS 3.2.1 was then released in July 1979 with some minor bug fixes. [5]

Apple DOS 3.3 was released in 1980. It improves various functions[ which? ] of release 3.2, while allowing for large gains in available floppy disk storage. The newer P5A/P6A PROMs in the disk controller enable the reading and writing of data at a higher density, so 16 sectors (4 KiB) can be stored per track instead of 13 sectors (3.25  KiB), increasing capacity from 113.75 KB to 140 KB per side  16 KB of which is used by filesystem overhead and a copy of DOS, leaving 124 KB for user programs and data. DOS 3.3 is, however, not backward compatible; it cannot read or write DOS 3.2 disks. To address this problem, Apple Computer released "MUFFIN", a utility to migrate Apple DOS 3.2 files and programs to version 3.3 disks. Apple never offered a utility to copy in the other direction. To migrate Apple DOS 3.3 files back to version 3.2 disks, someone wrote a "NIFFUM" utility. There are also commercial utilities (such as Copy II Plus) that can copy files between either format (and eventually ProDOS as well). Release 3.3 also improves the ability to switch between Integer BASIC and Applesoft BASIC, if the computer has a language card (RAM expansion) or firmware card.

Technical details

Apple DOS 3.1 disks use 13 sectors of data per track, each sector being 256 bytes. It uses 35 tracks per disk side, and can access only one side of the floppy disk, unless the user flipped the disk over. This gives the user a total storage capacity of 113.75 KB per side, of which about 10 KB are used to store DOS itself and the disk directory, leaving about 100 KB for user programs.

The first layer of the operating system is called RWTS, which stands for "read/write track sector". This layer consists of subroutines for track seeking, sector reading and writing, and disk formatting. An API called the File Manager was built on top of this, and implements 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, storing a copy of DOS on the first three tracks, and storing a startup program (usually called HELLO) that is auto-started when this disk is booted from. On top of the File Manager API, the main DOS routines are implemented which 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 was provided for running text-based batch files consisting of BASIC and DOS commands. Finally, four types of files exist, identified by letters in a catalog listing:

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

A call vector table in the region of $03D0–03FF16 allows programs to find DOS wherever it is loaded in the system memory. For example, if the DOS hooked into the BASIC CLI stops functioning, it can be reinitialized by calling location $03D016 (97610)  hence the traditional 3D0G ("3D0 go") command to return to BASIC from the System Monitor.

Boot loader

The process of loading Apple DOS involves a series of very tiny programs, each of which carries the loading process forward a few steps before passing control to the next program in the chain.

Integer BASIC and Applesoft BASIC support

The original Apple II included BASIC interpreter in ROM known originally as Apple BASIC and later as Integer BASIC . Variables in this language can only handle integer numbers ranging from −32,768 to +32,767 (16-bit binary values); floating point numbers are not supported. Apple commissioned Microsoft to develop Applesoft BASIC, [6] capable of handling floating-point numbers. Applesoft BASIC cannot 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. Integer BASIC is loaded into RAM on the language card of Apple IIs (if present) and by typing FP or INT from BASIC, the user can switch between either version.

Decline

After 1980, Apple DOS entered into a state of stagnation as Apple concentrated its efforts on the ill-fated Apple III computer and its SOS operating system. 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 model, were released in early and mid-1983.

Without third-party patches, Apple DOS can only read floppy disks running in a 5.25-inch Disk II drive and cannot access any other media, such as hard disk drives, virtual RAM drives, or 3.5-inch floppy disk drives. The structure of Apple DOS disks (particularly the free sector map, which was restricted to part of a single sector) is such that it is not possible to have more than 400 KB available at a time per drive without a major rewrite of almost all sections of the code; this is the main reason Apple abandoned this iteration of DOS in 1983, when Apple DOS was entirely replaced by ProDOS.

ProDOS retains the 16-sector low-level format of DOS 3.3 for 5.25 inch disks, but introduces a new high-level format that is suitable for devices of up to 32  MB; this makes it suitable for hard disks from that era and 3.5-inch floppies. All the Apple computers from the II Plus onward can run both DOS 3.3 and ProDOS, the Plus requiring a "Language Card" memory expansion to use ProDOS; the e and later models have built-in Language Card hardware, and so can run ProDOS straight. ProDOS includes 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 clones long after 1983. The Apple convention of storing a bootable OS on every single floppy disk means that commercial software can be used no matter what OS the user owns. A program called DOS.MASTER enables users to have multiple virtual DOS 3.3 partitions on a larger ProDOS volume, which allows the use of many floppy-based DOS programs with a hard disk.

Shortly after ProDOS came out, Apple withdrew permission from third parties to redistribute DOS 3.3, but granted one company, Syndicomm, an exclusive license to resell DOS 3.3. [7]

Commercial games usually did not use Apple DOS, instead having their own custom disk routines for copy protection purposes as well as for performance.

Performance improvements

DOS's RWTS routine can read or write a track in two revolutions with proper interleaving. A sector of the spinning disk passes under the read/write head while the RWTS routine is decoding the just-read sector (or encoding the next one to be written), and if this missed sector is the next one needed, DOS needs to wait nearly an entire revolution of the disk for the sector to come around again. This is called "blowing a rev" and is a well-understood performance bottleneck in disk systems. To avoid this, the sectors on a DOS disk are arranged in an interleaved order: [8]

0 7 e 6 d 5 c 4 b 3 a 2 9 1 8 f

Later, ProDOS arranged the sectors in this order: [8]

0 8 1 9 2 a 3 b 4 c 5 d 6 e 7 f

When reading and decoding sector 0, then sector 8 passes by, so that sector 1, the next sector likely to be needed, will be available without waiting. When reading sector 7, two unneeded sectors, f and 0, pass by before sector 8 is available, and when reading sector 15, the drive will always have to wait an extra revolution for sector 0 on the same track. However, the sector 0 actually needed in most cases will be on the next-higher track, and that track can 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 comes around. On average, a full track can be read in two revolutions of the disk.

The early DOS File Manager subverted this efficiency by copying bytes read from or written to a file one at a time between a disk buffer and main memory, requiring more time and resulting in DOS constantly blowing revs when reading or writing files. [9] Programs became available early on to format disks with modified sector interleaves; these disks give DOS more time between sectors to copy the data, ameliorating the problem.

Later, programmers outside Apple 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 from a disk buffer whenever a full sector was to be transferred. An early patch to provide this functionality was published in Call-A.P.P.L.E. . 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, Hyper-DOS, and David-DOS, along with additional features, but it was never used in an official Apple DOS release. Similar functionality was, however, employed by Apple's successor operating system, ProDOS. The Apple IIGS-specific operating system GS/OS 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.

Source code release

In 2013, more than 35 years after the Apple II debuted, the original Apple DOS source code was released by the Computer History Museum on its website. [10] It was donated by the original author, Paul Laughton. [11]

See also

Related Research Articles

Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original Apple II model. It is also referred to as FP BASIC because of the Apple DOS command FP used to invoke it, instead of INT for Integer BASIC.

<span class="mw-page-title-main">Apple II series</span> Computer series by Apple Computer, 1977–1993

The Apple II series is a family of home computers, one of the first highly successful mass-produced microcomputer products, designed primarily by Steve Wozniak, manufactured by Apple Computer, and launched in 1977 with the original Apple II.

<span class="mw-page-title-main">Apple III</span> Business-oriented personal computer made by Apple Computer

The Apple III is a business-oriented personal computer produced by Apple Computer and released in 1980. Running the Apple SOS operating system, it was intended as the successor to the Apple II series, but was largely considered a failure in the market. It was designed to provide key features business users wanted in a personal computer: a true typewriter-style upper/lowercase keyboard and an 80-column display.

<span class="mw-page-title-main">Apple II</span> First computer model in the Apple II series

The Apple II is an early personal computer that was created by Apple Inc. It was one of the first successful mass-produced microcomputer products, and it played a significant role in the early development of the personal computer industry. It has an 8-bit microprocessor.

<span class="mw-page-title-main">Floppy disk</span> Removable disk storage medium

A floppy disk or floppy diskette is a type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined with a fabric that removes dust particles from the spinning disk. Floppy disks store digital data which can be read and written when the disk is inserted into a floppy disk drive (FDD) connected to or inside a computer or other device.

<span class="mw-page-title-main">TRS-80</span> 1977 microcomputer by Tandy Corporation

The TRS-80 Micro Computer System is a desktop microcomputer launched in 1977 and sold by Tandy Corporation through their Radio Shack stores. The name is an abbreviation of Tandy Radio Shack, Z80 [microprocessor]. It is one of the earliest mass-produced and mass-marketed retail home computers.

<span class="mw-page-title-main">Booting</span> Process of starting a computer

In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so some process must load software into memory before it can be executed. This may be done by hardware or firmware in the CPU, or by a separate processor in the computer system.

Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first version of BASIC published by Microsoft as well as the first high-level programming language available for the Altair 8800 microcomputer.

<span class="mw-page-title-main">Boot sector</span> Sector of a persistent data storage device

A boot sector is the sector of a persistent data storage device which contains machine code to be loaded into random-access memory (RAM) and then executed by a computer system's built-in firmware.

<span class="mw-page-title-main">Apple ProDOS</span> Operating system on Apple II series computers

ProDOS is 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, is the last official operating system usable by all 8-bit Apple II series computers, and was distributed from 1983 to 1993. The other, ProDOS 16, was a stop-gap solution for the 16-bit Apple IIGS that was replaced by GS/OS within two years.

<span class="mw-page-title-main">Bootloader</span> Software responsible for starting the Computer and Load other software to the CPU memory

A bootloader, also spelled as boot loader or called bootstrap loader, is a computer program that is responsible for booting a computer. If it also provides an interactive menu with multiple boot choices then it's often called a boot manager.

<span class="mw-page-title-main">Atari DOS</span>

Atari DOS is the disk operating system used with the Atari 8-bit family of computers. Operating system extensions loaded into memory were required in order for an Atari computer to manage files stored on a disk drive. These extensions to the operating system added the disk handler and other file management features.

<span class="mw-page-title-main">Rainbow 100</span> DEC microcomputer

The Rainbow 100 is a microcomputer introduced by Digital Equipment Corporation (DEC) in 1982. This desktop unit had a monitor similar to the VT220 and a dual-CPU box with both 4 MHz Zilog Z80 and 4.81 MHz Intel 8088 CPUs. The Rainbow 100 was a triple-use machine: VT100 mode, 8-bit CP/M mode, and CP/M-86 or MS-DOS mode using the 8088. It ultimately failed to in the marketplace which became dominated by the simpler IBM PC and its clones which established the industry standard as compatibility with CP/M became less important than IBM PC compatibility. Writer David Ahl called it a disastrous foray into the personal computer market. The Rainbow was launched along with the similarly packaged DEC Professional and DECmate II which were also not successful. The failure of DEC to gain a significant foothold in the high-volume PC market would be the beginning of the end of the computer hardware industry in New England, as nearly all computer companies located there were focused on minicomputers for large organizations, from DEC to Data General, Wang, Prime, Computervision, Honeywell, and Symbolics Inc.

<span class="mw-page-title-main">Disk II</span> Floppy disk drive for the Apple II computer

The Disk II Floppy Disk Subsystem, often rendered as Disk ][, is a 5 +14-inch floppy disk drive designed by Steve Wozniak at the recommendation of Mike Markkula, and manufactured by Apple Computer, Inc. It went on sale in June 1978 at a retail price of US$495 for pre-order; it was later sold for $595 including the controller card and cable. The Disk II was designed specifically for use with the Apple II personal computer family to replace the slower cassette tape storage. These floppy drives cannot be used with any Macintosh without an Apple IIe Card as doing so will damage the drive or the controller.

<span class="mw-page-title-main">Apple II Plus</span> Second model of the Apple II series of personal computers by Apple Computer

The Apple II Plus is the second model of the Apple II series of personal computers produced by Apple Computer. It was sold from June 1979 to December 1982. Approximately 380,000 II Pluses were sold during its four years in production before being replaced by the IIe in 1983.

<span class="mw-page-title-main">Atari TOS</span> Operating system of the Atari ST range of computers

TOS is the operating system of the Atari ST range of computers. This range includes the 520ST and 1040ST, their STF/M/FM and STE variants and the Mega ST/STE. Later, 32-bit machines were developed using a new version of TOS, called MultiTOS, which allowed multitasking. More recently, users have further developed TOS into FreeMiNT.

<span class="mw-page-title-main">SpartaDOS X</span> Disk operating system

SpartaDOS X is a disk operating system for the Atari 8-bit family of computers that closely resembles MS-DOS. It was developed and sold by ICD, Inc. in 1987-1993, and many years later picked up by the third-party community SpartaDOS X Upgrade Project, which still maintains the software.

<span class="mw-page-title-main">ITT 2020</span>

The ITT 2020 was an Apple II computer clone manufactured by ITT under license from Apple Computer, specifically for the European market. In the Benelux, it was distributed by International Bell Telephone Company. It was distributed in the United Kingdom by Microsense Computer Limited.

The IBM Personal Computer Basic, commonly shortened to IBM BASIC, is a programming language first released by IBM with the IBM Personal Computer, Model 5150 in 1981. IBM released four different versions of the Microsoft BASIC interpreter, licensed from Microsoft for the PC and PCjr. They are known as Cassette BASIC, Disk BASIC, Advanced BASIC (BASICA), and Cartridge BASIC. Versions of Disk BASIC and Advanced BASIC were included with IBM PC DOS up to PC DOS 4. In addition to the features of an ANSI standard BASIC, the IBM versions offered support for the graphics and sound hardware of the IBM PC line. Source code could be entered with a full-screen editor, and limited facilities were provided for rudimentary program debugging. IBM also released a version of the Microsoft BASIC compiler for the PC concurrently with the release of PC DOS 1.10 in 1982.

<span class="mw-page-title-main">Dimension 68000</span> Microcomputer introduced by the Micro Craft Corporation in 1983

The Dimension 68000 is a microcomputer introduced by the Micro Craft Corporation in 1983 that sought to emulate the Apple II, the IBM PC, and various CP/M-centric computers through a family of coprocessor expansion cards and emulation software. The Dimension 68000 can also run as a standalone computer based on the Motorola 68000 from which it gets its namesake. The computer is mostly the brainchild of Mike Carpenter, a former executive of a scientific instrument manufacturer who incorporated Micro Craft in Dallas, Texas, to develop the Dimension 68000. It had a market lifespan of three years and received mixed, mostly positive, reception from the technology press. Criticism was leveled at the $6,250 price tag for the computer with the full deck of coprocessor cards, as well as the extent of the emulation power of those cards.

References

  1. Apple II DOS - Source Code
  2. Terdiman, Daniel (2013-04-03). "The untold story behind Apple's $13,000 operating system". CNET. Retrieved April 4, 2013.
  3. "Apple Computer". Laughton.com. Retrieved 2013-06-14.
  4. "Apple II History » 14-DOS". Apple2History.org. Archived from the original on 2010-07-10. Retrieved 2013-06-14.
  5. "Apple II History » 14-DOS". Apple2History.org. Archived from the original on 2010-07-10. Retrieved 2013-06-14.
  6. Steven Weyhrich. "Apple II History Chapter 16". Archived from the original on 29 January 2009. Retrieved 2009-01-26.
  7. Dean Esmay (18 November 2010). "Even Apple Used Pirate Tools". Archived from the original on 25 July 2011. Retrieved 2011-08-11.
  8. 1 2 "About the archive formats" . Retrieved 26 April 2012.
  9. DOS 3.3, ProDOS & Beyond v1.3 bullet 07 Jul 01
  10. Shustek, Len (2013-11-12). "Apple II DOS source code". ComputerHistory.org. Retrieved 2013-11-30.
  11. "Apple II's 35-year-old operating system is now open to the public". November 13, 2013.

Further reading