Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Apple DOS
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Technical details== Apple DOS 3.1 disks use 13 sectors of data per track, each sector being 256 [[byte|bytes]]. It uses 35 tracks per disk side, and can access only one side of the floppy disk, unless the user [[Floppy disk variants#Flippy disks|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 [[subroutine]]s 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 protection|write-protect]]), unlock (i.e. write-enable), and rename files, and to verify a file's structural integrity. There is also a {{code|CATALOG}} function, for listing files on the diskette, and an {{code|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 [[BSAVE|BRUN]] for storing, loading, and running binary [[executable]]s. {{code|LOAD}}, {{code|RUN}}, and {{code|SAVE}} are provided for BASIC programs, and an {{code|EXEC}} was provided for running text-based [[batch file]]s consisting of BASIC and DOS commands. Finally, four types of files exist, identified by letters in a catalog listing:{{sfnb|Apple Computer|1983|page=16}} * I β [[Integer BASIC]] programs (stored in a compact format, not [[plain text|plain-text]]) * A β [[Applesoft BASIC]] programs (also stored in a [[file compression|packed]], space-saving format) * B β [[Binary file]]s, either executable [[machine code|machine-language]] programs, or [[data file|data files]] * T β [[ASCII]] [[text file]]s (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 [[relocation (computing)|relocatable]] binary executable files. A few programs support the "S" type as data files. A call vector table in the region of $03D0β03FF{{sub|16}} allows programs to find DOS wherever it is loaded in the system memory. For example, if the DOS hooked into the BASIC [[command-line interface|CLI]] stops functioning, it can be reinitialized by calling location $03D0{{sub|16}} (976{{sub|10}}){{snd}} hence the traditional {{code|3D0G}} ("3D0 go") command to return to BASIC from the [[machine code monitor|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 [[read-only memory|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 [[device driver|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 {{keypress|6 Control-P}} (from the ML monitor) or {{code|PR#6}} (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 {{code|C600G}}. *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{{sub|16}}). *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]],<ref name="Applesoft">{{cite web|url=http://apple2history.org/history/ah16.html#05|title=Apple II History Chapter 16|author=Steven Weyhrich|access-date=2009-01-26|archive-url=https://web.archive.org/web/20090129131828/http://apple2history.org/history/ah16.html#05|archive-date=29 January 2009|url-status=dead}}</ref> 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 {{code|FP}} or {{code|INT}} from BASIC, the user can switch between either version.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)