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 function, for listing files on the diskette, and an 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. , , and are provided for BASIC programs, and an 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: • I –
Integer BASIC programs (stored in a compact format, not
plain-text) • A –
Applesoft BASIC programs (also stored in a
packed, space-saving format) • B –
Binary files, either executable
machine-language programs, or
data files • T –
ASCII text files (or plain-text, unpacked batch files) 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–03FF 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 $03D0 (976) hence the traditional ("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. • Originally, the Apple II
ROM did not support disk booting at all. At power-up it would display the System Monitor prompt. Both the Monitor and Integer BASIC have commands to redirect printing to a printer
driver in a designated slot, so the conventional way to boot from disk then was to command the computer to start "printing" to the disk interface card, typically installed in slot 6, using the command (from the ML monitor) or (from BASIC). When the monitor or BASIC issued the next prompt character, the computer would call the ROM routines on the disk card to "print" to it, which would then proceed with the boot sequence. (One could use input redirection to similar ends.) Alternatively, from the ML monitor, the user could invoke the controller's boot code directly with a command like . • 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 a bootable expansion card ROM, 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 available, the drive spins indefinitely until one is provided and the drive door is closed.) • Sector zero contains a small program which instructs the computer to read sectors 0 through 9 of track zero into memory using part of the ROM boot code (rereading 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 determine the computer's RAM configuration and relocate DOS as high into 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 is commonly a BASIC language program named
HELLO (or some other name) but DOS can 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 is an indication to the user that an Applesoft BASIC startup program is loading, while a greater-than symbol (
>) indicates that an Integer BASIC program is loading. (These are the prompts for the respective versions of BASIC, which are being initialized at this point.) • The startup program then begins executing.
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, 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 or from BASIC, the user can switch between either version. ==Decline==