MGT filesystem: Difference between revisions

Jump to navigation Jump to search
→‎Directory entry format: Split hex and dec offsets
(→‎Directory entry format: Split hex and dec offsets)
Line 38: Line 38:
{| class=wikitable
{| class=wikitable
|-
|-
! Byte offset (hex in parenthesis)
! | Offset (dec)
! Description
! | Offest (hex)
! | Description
|-
|-
| 0 ($00)
| 0
| $00
| Bits 0–4: file type (zero for erased — see below for a list of types), bit 6: protected, bit 7: hidden.
| Bits 0–4: file type (zero for erased — see below for a list of types), bit 6: protected, bit 7: hidden.
|-
|-
| 1–10 ($01–$0a)
| 1–10
| $01–$0a
| Filename, padded with spaces. If the first byte of the filename is zero, this may be taken as an end-of-directory marker. Note that '/', '\' and '^' are allowed, but are used for directories under Master DOS.
| Filename, padded with spaces. If the first byte of the filename is zero, this may be taken as an end-of-directory marker. Note that '/', '\' and '^' are allowed, but are used for directories under Master DOS.
|-
|-
| 11–12 ($0b–$0c)
| 11–12
| $0b–$0c
| Number of sectors used by the file, in big-endian format (i.e. MSB first).
| Number of sectors used by the file, in big-endian format (i.e. MSB first).
|-
|-
| 13–14 ($0d–$0e)
| 13–14
| $0d–$0e
| Address of the first sector in the file — track number (0–79, 128–207) followed by sector number (1–10). For a Master DOS subdirectory, the address of the sector holding the directory entry is used.
| Address of the first sector in the file — track number (0–79, 128–207) followed by sector number (1–10). For a Master DOS subdirectory, the address of the sector holding the directory entry is used.
|-
|-
| 15–209 ($0f–$d1)
| 15–209
| $0f–$d1
| Sector address map (195 bytes) — a bit is set in this map if the corresponding sector is allocated to the file. The lsb of byte 0 corresponds to track 4, sector 1. The msb of byte 0 corresponds to track 4, sector 8. The lsb of byte 1 corresponds to track 4, sector 9. The msb of byte 1 corresponds to track 5, sector 6.
| Sector address map (195 bytes) — a bit is set in this map if the corresponding sector is allocated to the file. The lsb of byte 0 corresponds to track 4, sector 1. The msb of byte 0 corresponds to track 4, sector 8. The lsb of byte 1 corresponds to track 4, sector 9. The msb of byte 1 corresponds to track 5, sector 6.
|-
|-
| 210–219 ($d2–$db)
| 210–219
| $d2–$db
| DISCiPLE / +D file information, or an 10-character Master DOS disk label (in slot 1) — if the first character in the label is '*', this specifies a blank label. SAMDOS sets these bytes to 0 for SAM CODE files.
| DISCiPLE / +D file information, or an 10-character Master DOS disk label (in slot 1) — if the first character in the label is '*', this specifies a blank label. SAMDOS sets these bytes to 0 for SAM CODE files.
|-
|-
| 220–231 ($dc–$e7)
| 220–231
| $dc–$e7
| SAM file information. For SAM CODE files, SAMDOS sets these to $20, except for the last byte, which is set to $ff.
| SAM file information. For SAM CODE files, SAMDOS sets these to $20, except for the last byte, which is set to $ff.
|-
|-
| 220–241 ($dc–$f1)
| 220–241
| $dc–$f1
| Snapshot register dump: IY, IX, DE', BC', HL', AF', DE, BC, HL, junk, I, SP. On the stack: F indicating IFF, R, AF, PC. If I holds 0 or 63, IM 1 is set, otherwise, IM 2 is set. On the DISCiPLE, there is a bug (a missing EX AF,AF' instruction) that causes AF' not to be saved.
| Snapshot register dump: IY, IX, DE', BC', HL', AF', DE, BC, HL, junk, I, SP. On the stack: F indicating IFF, R, AF, PC. If I holds 0 or 63, IM 1 is set, otherwise, IM 2 is set. On the DISCiPLE, there is a bug (a missing EX AF,AF' instruction) that causes AF' not to be saved.
|-
|-
| 232–235 ($e8–$eb)
| 232–235
| $e8–$eb
| Spare bytes under SAMDOS, set to $ff.
| Spare bytes under SAMDOS, set to $ff.
|-
|-
| 236–244 ($ec–$f4)
| 236–244
| $ec–$f4
| SAM file start/length information.
| SAM file start/length information.
|-
|-
| 245–249 ($f5–$f9)
| 245–249
| $f5–$f9
| Master DOS timestamp — day, month, year, hour and minute. $ff under SAMDOS.
| Master DOS timestamp — day, month, year, hour and minute. $ff under SAMDOS.
|-
|-
| 250 ($fa)
| 250
| $fa
| ID of Master DOS subdirectory (1–254). $ff under SAMDOS.
| ID of Master DOS subdirectory (1–254). $ff under SAMDOS.
|-
|-
| 251 ($fb)
| 251
| $fb
| $ff (unused) under SAMDOS.
| $ff (unused) under SAMDOS.
|-
|-
| 252–253 ($fc–$fd)
| 252–253
| $fc–$fd
| Randomly generated Master DOS disks ID (in slot 1). Possibly used under SAMDOS for some purpose.
| Randomly generated Master DOS disks ID (in slot 1). Possibly used under SAMDOS for some purpose.
|-
|-
| 254 ($fe)
| 254
| $fe
| ID of Master DOS directory containing this entry (0 for root directory). Possibly used under SAMDOS for some purpose.
| ID of Master DOS directory containing this entry (0 for root directory). Possibly used under SAMDOS for some purpose.
|-
|-
| 255 ($ff)
| 255
| $ff
| Number of extra tracks for the root directory (0–35), under Beta DOS and Master DOS (in slot 1). Possibly used under SAMDOS for some purpose.
| Number of extra tracks for the root directory (0–35), under Beta DOS and Master DOS (in slot 1). Possibly used under SAMDOS for some purpose.
|}
|}

Navigation menu