Apple DOS file system

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(Add infobox and category; some minor tweaks/additions)
 
(6 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|subcat=Filesystem
 
|subcat=Filesystem
 
}}
 
}}
 +
The '''Apple DOS file system''' was used on disks for the Apple II series of computers. It was later replaced with the [[ProDOS file system]].
 +
 +
== Format documentation ==
  
 
Apple [[Apple II 16 sector disk|DOS 3.3 disks]] were 5 1/4" media containing 35 tracks of 16 sectors (earlier Apple DOS versions used a format with [[Apple II 13 sector disk|13 sectors]]) using a [[GCR encoding]].
 
Apple [[Apple II 16 sector disk|DOS 3.3 disks]] were 5 1/4" media containing 35 tracks of 16 sectors (earlier Apple DOS versions used a format with [[Apple II 13 sector disk|13 sectors]]) using a [[GCR encoding]].
Line 16: Line 19:
 
The contents of the VTOC are:
 
The contents of the VTOC are:
  
  offset
+
offset
  -----
+
-----
  $00    not used
+
$00    not used
  $01    track number of first catalog sector
+
$01    track number of first catalog sector
  $02    sector number of first catalog sector
+
$02    sector number of first catalog sector
  $03    release number of DOS used to INIT this disk
+
$03    release number of DOS used to INIT this disk
  $04-05 not used
+
$04-05 not used
  $06    Diskette volume number (1-254)
+
$06    Diskette volume number (1-254)
  $07-26 not used
+
$07-26 not used
  $27    maximum number of track/sector pairs which will fit in one file track/sector
+
$27    maximum number of track/sector pairs which will fit in one file track/sector
        list sector (122 for 256 byte sectors)
+
        list sector (122 for 256 byte sectors)
  $28-2F not used
+
$28-2F not used
  $30    last track where sectors were allocated
+
$30    last track where sectors were allocated
  $31    direction of track allocation (+1 or -1)
+
$31    direction of track allocation (+1 or -1)
  $32-33 not used
+
$32-33 not used
  $34    number of tracks per diskette (normally 35)
+
$34    number of tracks per diskette (normally 35)
  $35    number of sectors per track (13 or 16)   
+
$35    number of sectors per track (13 or 16)   
  $36-37 number of bytes per sector (LO/HI format)
+
$36-37 number of bytes per sector (LO/HI format)
  $38-3B bit map of free sectors in track 0
+
$38-3B bit map of free sectors in track 0
  $3C-3F bit map of free sectors in track 1
+
$3C-3F bit map of free sectors in track 1
  $40-43 bit map of free sectors in track 2
+
$40-43 bit map of free sectors in track 2
...
+
        ...
  $BC-BF bit map of free sectors in track 33
+
$BC-BF bit map of free sectors in track 33
  $CO-C3 bit map of free sectors in track 34
+
$CO-C3 bit map of free sectors in track 34
  $C4-FF bit maps for additional tracks if there are more than 35 tracks per diskette
+
$C4-FF bit maps for additional tracks if there are more than 35 tracks per diskette
 
+
  
 
=== Catalog  ===
 
=== Catalog  ===
Line 64: Line 66:
 
  ----
 
  ----
 
  $00    Track of first track/sector list sector, if this is a deleted file this contains FF
 
  $00    Track of first track/sector list sector, if this is a deleted file this contains FF
and the original track number is copied to the last byte of the file name (BYTE 20)
+
        and the original track number is copied to the last byte of the file name (BYTE 20)
If this byte contains a 00, the entry is assumed to never have been used and is
+
        If this byte contains a 00, the entry is assumed to never have been used and is
available for use. (This means track 0 can never be used for data even if the DOS image
+
        available for use. (This means track 0 can never be used for data even if the DOS image
is 'wiped' from the disk)
+
        is 'wiped' from the disk)
 
  $01    Sector of first track/sector list sector  
 
  $01    Sector of first track/sector list sector  
 
  $02    File type and flags:
 
  $02    File type and flags:
 
         $80+file type - file is locked
 
         $80+file type - file is locked
$00+file type - file is not locked
+
        $00+file type - file is not locked
$00 - TEXT file
+
        $00 - TEXT file
$01 - INTEGER BASIC file
+
        $01 - INTEGER BASIC file
$02 - APPLESOFT BASIC file
+
        $02 - APPLESOFT BASIC file
$04 - BINARY file
+
        $04 - BINARY file
$08 - S type file
+
        $08 - S type file
$10 - RELOCATABLE object module file
+
        $10 - RELOCATABLE object module file
$20 - a type file
+
        $20 - a type file
$40 - b type file
+
        $40 - b type file
 
  $03-20 File Name (30 characters)
 
  $03-20 File Name (30 characters)
 
  $21-22 Length of file in sectors (LO/HI format)
 
  $21-22 Length of file in sectors (LO/HI format)
  
 
=== Track Sector List Format ===
 
=== Track Sector List Format ===
  $00 Not used
+
  $00   Not used
  $01 Track number of next T/S list of one is needed or zero if no more t/s list
+
  $01   Track number of next T/S list of one is needed or zero if no more t/s list
  $02 Sector number of next T/S list (if one is present)
+
  $02   Sector number of next T/S list (if one is present)
  $03-04 Not used
+
  $03-04 Not used
  $05-06 Sector offset in file of the first sector described by this list
+
  $05-06 Sector offset in file of the first sector described by this list
  $07-oB Not used
+
  $07-0B Not used
  $0C-0D Track and sector of first data sector or zeros
+
  $0C-0D Track and sector of first data sector or zeros
  $0E-0F Track and sector of second data sector or zeros
+
  $0E-0F Track and sector of second data sector or zeros
  $10-FF Up to 120 more track and sector pairs
+
  $10-FF Up to 120 more track and sector pairs
 +
 
 +
== Related formats ==
 +
* [[ProDOS file system]] - successor
 +
* [[GCR encoding]]
 +
* For related disk image formats, see [[Disk Image Formats#Apple II series]].
 +
* For related physical media, see [[Apple II 16 sector disk]] and [[Apple II 13 sector disk]].
 +
 
 +
== Specifications ==
 +
* [https://archive.org/details/beneath-apple-dos/page/n35/mode/2up Beneath Apple DOS, Chapter 4: Diskette Organization]
 +
 
 +
== Links ==
 +
* [https://archive.org/details/Apple_DOS_v3.3_1980 Apple DOS 3.3 download and in-browser emulation: Internet Archive]
 +
* [https://archive.org/details/Diversi-DOS_v2c_1982_DSR Diversi-DOS download and in-browser emulation: Internet Archive]
  
 
[[Category:Apple II series]]
 
[[Category:Apple II series]]

Latest revision as of 23:18, 12 July 2022

File Format
Name Apple DOS file system
Ontology

The Apple DOS file system was used on disks for the Apple II series of computers. It was later replaced with the ProDOS file system.

Contents

[edit] Format documentation

Apple DOS 3.3 disks were 5 1/4" media containing 35 tracks of 16 sectors (earlier Apple DOS versions used a format with 13 sectors) using a GCR encoding.

The DOS executable was stored on disk. The Disk ][ controller card (typically placed in slot #6 of an Apple ][) contained firmware that when started (via the command PR#6) would load the track $00, sector $00 into memory and start executing. In the case of a DOS boot disk, that sector would contain code that loaded the full DOS into memory, this was always stored in the first 3 tracks of a DOS boot disk.

When a new DOS boot disk was created (using the INIT command), the DOS in memory would be written to the disk being INITed. This made it easy for people to create variants of DOS (by altering the running copy of DOS then INITing a new disk). Common modifications made include changing the GCR encoding or the sync and sector header bytes (to prevent the copying of a disk via normal DOS copy programs), and extending the number of tracks per disk (up to 40)

[edit] Volume Table Of Contents

A standard Apple DOS 3.3 has a structure called a Volume Table of Contents (VTOC) stored at track $11, sector $00

The contents of the VTOC are:

offset
-----
$00    not used
$01    track number of first catalog sector
$02    sector number of first catalog sector
$03    release number of DOS used to INIT this disk
$04-05 not used
$06    Diskette volume number (1-254)
$07-26 not used
$27    maximum number of track/sector pairs which will fit in one file track/sector
       list sector (122 for 256 byte sectors)
$28-2F not used
$30    last track where sectors were allocated
$31    direction of track allocation (+1 or -1)
$32-33 not used
$34    number of tracks per diskette (normally 35)
$35    number of sectors per track (13 or 16)  
$36-37 number of bytes per sector (LO/HI format)
$38-3B bit map of free sectors in track 0
$3C-3F bit map of free sectors in track 1
$40-43 bit map of free sectors in track 2
       ...
$BC-BF bit map of free sectors in track 33
$CO-C3 bit map of free sectors in track 34
$C4-FF bit maps for additional tracks if there are more than 35 tracks per diskette

[edit] Catalog

The catalog consists of a 35 byte "File Descriptive Entry" for each file on the disk. The catalog is a chain of sectors, the location of the first Catalog sector is found by looking in the VTOC.

offset
----
$00    Not Used
$01    track number of next catalog sector
$02    sector number of next catalog sector
$03-0A not used
$0B-2D First file descriptive entry
$2E-50 Second file descriptive entry
$51-73 Third file descriptive entry
$74-96 Fourth file descriptive entry
$97-B9 Fifth file descriptive entry
$BA-DC Sixth file descriptive entry
$DD-FF Seventh file descriptive entry

[edit] File Descriptive Entry

offset
----
$00    Track of first track/sector list sector, if this is a deleted file this contains FF
       and the original track number is copied to the last byte of the file name (BYTE 20)
       If this byte contains a 00, the entry is assumed to never have been used and is
       available for use. (This means track 0 can never be used for data even if the DOS image
       is 'wiped' from the disk)
$01    Sector of first track/sector list sector 
$02    File type and flags:
       $80+file type - file is locked
       $00+file type - file is not locked
       $00 - TEXT file
       $01 - INTEGER BASIC file
       $02 - APPLESOFT BASIC file
       $04 - BINARY file
       $08 - S type file
       $10 - RELOCATABLE object module file
       $20 - a type file
       $40 - b type file
$03-20 File Name (30 characters)
$21-22 Length of file in sectors (LO/HI format)

[edit] Track Sector List Format

$00    Not used
$01    Track number of next T/S list of one is needed or zero if no more t/s list
$02    Sector number of next T/S list (if one is present)
$03-04 Not used
$05-06 Sector offset in file of the first sector described by this list
$07-0B Not used
$0C-0D Track and sector of first data sector or zeros
$0E-0F Track and sector of second data sector or zeros
$10-FF Up to 120 more track and sector pairs

[edit] Related formats

[edit] Specifications

[edit] Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox