Disclaimer: This document is a work in progress. Please mail any corrections to atari@columbus.rr.com Most of this information has been derived from my work on AtrUtil, a windows 95 Disk Image Utility. Information comes from a variety of documents and Usenet.
Sectors | Function |
1 to 3 | Boot Sectors |
4 to 359 | Data Sectors |
360 | VTOC |
361 to 368 | Directory Sectors |
369 to 719 | Data Sectors |
720 | Unused |
Byte Offset | Function |
0 | Unused. Usually 0 for Atari Dos |
1 | Number of sectors to boot. For Atari Dos this is 3. The first three sectors are enough to get as loaded into memory to load the DOS.SYS. |
2 to 3 | Boot Load Address. For Atari Dos it is 1792 ($700) |
4 to 5 | Initialization Address. Called after booting requested number of sectors. |
6 to 8 | JMP to Boot Continuation Address. This should be a 6502 jump instruction (76/$4C) followed by the address to jump to after booting the requested number of sectors. |
9 | Maximim number of files that can be open at once. This value can be set by POKEing location 1801 and writing DOS. Default is 3. |
10 | Drive Bits. There is one bit for each drive. Bit 0 is drive D1:, Bit 1 is Drive D2:, etc. This can be set by poking location 1803 and writing DOS. The Default is 3 to include only drives 1 and 2. |
Byte Offset | Function |
0 to 124 | File Data |
125 (left 6 bits) | File #0 to 63 (which corresponding directory this sector belongs to.) Incorrect values will give Error #164 (File # Mismatch) |
125 (right two bits) and 126 | Link to next sector. 10 bits allow for 1024 sectors. The two bits at offset are the most significant byte. |
127 | Number of bytes in sector. Can be up to 125 bytes. |
Byte Offset | Function |
0 | Dos code. This seems to be 2 for Atari Dos (Mapping the Atari Revised Edition claims it is 0) |
1 to 2 | Total number of available sectors on the disk (used and unused). This should be 707 on a freshly formatted Atari Dos disk. |
3 to 4 | Number of currently unused sectors. This can range from 0 to 707. |
5 to 9 | Unused |
10 to 99 | Bitmap for sectors 0 to 719. A bit value of 0 means in use, a value of 1 means the sector is free. Sector 0 doesn't exist. Sectors 1 to 3 are reserved for booting the disk, sector 360 is the VTOC, and sectors 361 to 368 are the directory sectors. Sector 720 is unused because sector 0 is used in the map, with 90 bytes there is only enough bits to map sectors 0 through 719. The number of available sectors can be calcualted 721-1-3-1-8-1=707 bytes. (721 bits are used since we started counting at 0.) |
100-127 | Unused. These should all be set to 0 so the sectors are marked as used and therefore unavailable. Note: Mydos uses the first bit of byte 100 to allow sector 720 to used for a total of 708 free sectors. |
Byte Offset | Function |
0 | Flag Byte |
1 to 2 | Total number of sectors in file. Can be up to 65535 although obviously there can only be up to 707 on the disk |
3 to 4 | Starting sector number. Can be 1 to 65535 although obviously the hightest usable sector is sector 719. |
5 to 12 | 8 character filename padded with spaces at end |
13 to 15 | 3 character filename extension padded with spaces at end |
Bit/Value | Function |
0/$01 | File Opened for Output. |
1/$02 | File Created by Dos 2. |
5/$20 | File Locked (appears with '*' in directory). |
6/$40 | File In use (normal) |
7/$80 | File Deleted |
Sectors | Function |
1 to 3 | Boot Sectors |
4 to 359 | Data Sectors |
360 | VTOC |
361 to 368 | Directory Sectors |
369 to 1023 | Data Sectors |
1024 | VTOC2 |
1025-1040 | Unused |
Byte Offset | Function |
0 | Unused. Usually 0 for Atari Dos |
1 | Number of sectors to boot. For Atari Dos this is 3. The first three sectors are enough to get as loaded into memory to load the DOS.SYS. |
2 to 3 | Boot Load Address. For Atari Dos it is 1792 ($700) |
4 to 5 | Initialization Address. Called after booting requested number of sectors. |
6 to 8 | JMP to Boot Continuation Address. This should be a 6502 jump instruction (76/$4C) followed by the address to jump to after booting the requested number of sectors. |
9 | Maximim number of files that can be open at once. This value can be set by POKEing location 1801 and writing DOS. Default is 3. |
10 | Drive Bits. There is one bit for each drive. Bit 0 is drive D1:, Bit 1 is Drive D2:, etc. This can be set by poking location 1803 and writing DOS. The Default is 3 to include only drives 1 and 2. |
Byte Offset | Function |
0 to 124 | File Data |
125 (left 6 bits) | File #0 to 63 (which corresponding directory this sector belongs to.) Incorrect values will give Error #164 (File # Mismatch) |
125 (right two bits) and 126 | Link to next sector. 10 bits allow for 1024 sectors (Thats why only all 1040 sectors are not available). The two bits at offset are the most significant byte. |
127 | Number of bytes in sector. Can be up to 125 bytes. |
Byte Offset | Function |
0 | Dos code. This is 2 for Atari Dos. |
1 to 2 | Total number of available sectors on the disk below sector 720(used and unused). This should be 707 on a freshly formatted Atari Dos disk. |
3 to 4 | Number of currently unused sectors below sector 720. This can range from 0 to 707. |
5 to 9 | Unused |
10 to 99 | Bitmap for sectors 0 to 719. A bit value of 0 means in use, a value of 1 means the sector is free. Sector 0 doesn't exist. Sectors 1 to 3 are reserved for booting the disk, sector 360 is the VTOC, and sectors 361 to 368 are the directory sectors. Sector 720 through 1023 are tracked in sector 1023. |
100-127 | Unused. These should all be set to 0 so the sectors are marked as used and therefore unavailable. |
Byte Offset | Function |
0 to 83 | Repeat of sectors 48 to 719. I would only use the values in sector 360 for these since Dos 2.0 will not update this sector if the disk is written to. |
84 to 121 | Bitmap of sectors 720 to 1023. Bit set equals available. |
122 to 123 | Number of free sectors above sector 719. This should be 304 on a freshly formatted disk. |
124 to 127 | Unused. These should all be set to 0. |
Byte Offset | Function |
0 | Flag Byte |
1 to 2 | Total number of sectors in file. Can be up to 65535 although obviously it can't be anywhere near that big. |
3 to 4 | Starting sector number. Can be 1 to 65535 although obviously the hightest usable sector is much less. |
5 to 12 | 8 character filename padded with spaces at end |
13 to 15 | 3 character filename extension padded with spaces at end |
Bit/Value | Function |
0/$01 | File Opened for Output. (Also will be set for Files using sectors above sector 719 but bit 6 will not be set. This is to make a Dos 2.5 file using extended sectors invisible to Dos 2.0) |
1/$02 | File Created by Dos 2. |
5/$20 | File Locked (appears with '*' in directory). |
6/$40 | File In use (normal). This will not be set if the file is usable only by Dos 2.5 and not Dos 2.0 (It is located above the sector 719 threshold) |
7/$80 | File Deleted |
Sectors | Function |
1 to 3 | Boot Sectors |
4 to (360-#vtoc_sectors) | Data Sectors |
(360-#vtoc_sectors+1) to 360 | VTOC |
361 to 368 | Directory Sectors |
369 to total # sectors | Data Sectors |
Byte Offset | Function |
0 | Unused. Usually 0. |
1 | Number of sectors to boot. For Atari Dos this is 3. The first three sectors are enough to get as loaded into memory to load the DOS.SYS. |
2 to 3 | Boot Load Address. Same as Atari Dos: 1792 ($700) |
4 to 5 | Initialization Address. Called after booting requested number of sectors. |
6 to 8 | JMP to Boot Continuation Address. This should be a 6502 jump instruction (76/$4C) followed by the address to jump to after booting the requested number of sectors. |
9 | Maximim number of files that can be open at once. This value can be set by POKEing location 1801 and writing DOS. Default is 3. |
Atari Dos Compatable (less than 1024 sectors) | |
Byte Offset | Function |
0 to 124/252 | File Data |
125/253 (left 6 bits) | File #0 to 63 (which corresponding directory this sector belongs to.) Incorrect values will give Error #164 (File # Mismatch) |
125/253 (right two bits) and 126/254 | Link to next sector. 10 bits allow for 1024 sectors. The two bits at offset are the most significant byte. |
127/255 | Number of bytes in sector. Can be up to 125/253 bytes. |
MyDos Compatable (1024 or more sectors) | |
Byte Offset | Function |
0 to 124/252 | File Data |
(125 to 126)/(253 to 254) | Link to next sector. All 16 bits are available allowing for up to 65536 sectors. |
127/255 | Number of bytes in sector. Can be up to 125/253 bytes. |
Byte Offset | Function |
0 | code indicating #of vtoc sectors code. For single density the # of vtoc sectors is (code * 2)-3. Note: this is always an odd number( sectors after the first vtoc sector are always allocated in pairs). For double density #vtoc_sectors = code-1. |
1 to 2 | Total number of available sectors on the disk. |
3 to 4 | Number of currently unused sectors. |
5 to 9 | Unused |
10 to 127 | Bitmap for sectors 0 to 943. A bit value of 0 means in use, a value of 1 means the sector is free. Sector 0 doesn't exist. Sectors 1 to 3 are reserved for booting the disk, sector 360 and possibly some below it are used to hold the VTOC, and sectors 361 to 368 are the directory sectors. Sectors above 943 are tracked in sector 359, 358, etc. |
Byte Offset | Function |
0 | Flag Byte |
1 to 2 | Total number of sectors in file. Can be up to 65535. |
3 to 4 | Starting sector number. Can be 1 to 65535. |
5 to 12 | 8 character filename padded with spaces at end |
13 to 15 | 3 character filename extension padded with spaces at end |
Bit/Value | Function |
0/$01 | File Opened for Output. |
1/$02 | File Created by Dos 2. |
2/$04 | File doesn't use file# in sector links (not Atari Dos compatible) |
4/$10 | File is actually a directory (all other bits clear except possible bit 5. |
5/$20 | File Locked (appears with '*' in directory). |
6/$40 | File In use (normal). |
7/$80 | File Deleted |
Sectors | Function |
1 to 3 | Boot Sectors |
4 to ??? | Data Sectors |
Byte Offset | Function |
0 | Unused. Usually 0. |
1 | Number of sectors to initially boot. This is set to three which is enough to get the loader into memory |
2 to 3 | Boot Load Address. 1792 ($700) |
4 to 5 | Initialization Address. Called after booting requested number of sectors. |
6 to 8 | JMP to Boot Continuation Address. This is a 6502 jump instruction (76/$4C) followed by the address to jump to after booting the requested number of sectors. This routine will then load the actual file which is located at sectors 4 and above |
9 to 11 | Number of bytes to load (number of bytes in original executable) This is a three byte value. The least significant byte is stored first. |
12 | Unused. Set to 0 |
Sectors | Function |
1 to 3 | Boot Sectors |
4-? | Bitmap Sectors Does not necessarily have to start at sector 4, the sector number is at offset 16/17 in sector 1 |
varies | Main Directory Sector Map |
varies | Main Directory |
varies | Data Sectors |
Byte Offset | Function |
0 | Unused. Usually 0. |
1 | Number of sectors to boot. For Atari Dos this is 3. The first three sectors are enough to get as loaded into memory to load the DOS.SYS. |
2 to 3 | Boot Load Address. Same as Atari Dos: 1792 ($700) |
4 to 5 | Initialization Address. Called after booting requested number of sectors. |
6 to 8 | JMP to Boot Continuation Address. This should be a 6502 jump instruction (76/$4C) followed by the address to jump to after booting the requested number of sectors. |
7 | $80 for Sparta Dos. (note: this is also the low byte of the boot continuation adress) |
9/10 | First sector of sector map for main directory. |
11/12 | Total number of sectors on disk |
13/14 | Number of free sectors on disk |
15 | #of bitmap sectors (used to track free sectors) One byte is needed for every 8 sectors. |
16/17 | Sector for first bitmap (usually 4?) |
18/19 | First available sector (to save time from having to search though bitmap) |
20/21 | First available directory sector. This is the sector the next new directory entry will need to be added to. |
22-29 | Volume Name (8 characters - padded with spaces) |
30 | bits 0-6: Number of Tracks. bit 7:Set for double sided. |
31 | Size of sectors. 128 for 128 bytes/ 0 for 256 bytes. |
32 | Dos major version $11 for sparta 1.1. $20 for sparta 3.2. |
38 | Sequence Number. Incremented whenever a file is opened for write? |
39 | Random Number - filled in at format. |
40/41 | First sector map for file being booted. |
42 | Write Lock Flag? |
43-47 | Reserved. |
Byte Offset | Function |
0 | ? |
1 to 2 | Sector of first map of parent directory. For the Root directory this is 0. |
3,4,5 | Length of directory in bytes. |
6-13 | Directory Name (8 characters padded with spaces). This will be MAIN for the root directory |
14-22 | Unused |
The format of each 23 byte directory entry is.
Byte Offset | Function |
0 | Flag Byte |
1 to 2 | First sector of file's sector map. |
3,4,5 | Length of file in bytes. |
6-13 | File Name (8 characters padded with spaces) |
14-16 | File Extension (8 characters padded with spaces.) |
17-22 | Time and Date Stamp. Format???? |
Bit/Value | Function |
0/$01 | File is Write Protecter. |
3/$08 | Directory entry is in use. (contains a file or directory entry) |
4/$10 | File has been deleted. |
5/$20 | Subdirectory flag. |
Byte Offset | Function |
0 to 1 | Pointer to next sector map. |
2 to 3 | Pointer to previous sector map. |
4 to 127/255 | Every 2 bytes holds a sector number for the file or directory. |