
When DISKMON goes under the DOS in Part three, it has to know where things are: which sectors hold the list of files, how an entry in that list is laid out, and how a file's block numbers turn into tracks and sectors. Inside the Einstein: The Disc teaches all of this in full. This is the one page of it you need, with a practice disc to look at.
An Einstein disc has one side of 40 tracks, numbered 0-39, each of 10 sectors of 512 bytes. A sector is found by its ID, 0-9, written on the disc when it was formatted - and the IDs need not be in order around the track. One disc may store them 0,1,2...9, another 0,5,1,6,2,7,3,8,4,9. Always ask for a sector by its ID.

Tracks 0 and 1 are kept for the system - on a system disc, the DOS itself - and the files start at track 2.
Track 2, sectors 0 to 3 - 2K - is the directory: 64 entries of 32
bytes, sixteen to a sector. Here is the first sector of
FILES.DSK, a practice disc from Inside the Einstein: The Disc:
python3 edisc.py dump FILES.DSK 2 0
Track 2, sector 0: bytes 11264 to 11775 of the image
000000 00 52 45 41 44 4D 45 20 20 D4 58 54 00 00 00 01 .README .XT....
000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000020 00 53 54 4F 52 59 20 20 20 54 58 54 00 00 00 80 .STORY TXT....
000030 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 ................
000040 00 53 54 4F 52 59 20 20 20 54 58 54 01 00 00 1D .STORY TXT....
Each entry is 32 bytes:
| Byte | Holds |
|---|---|
| 0 | Status: 0 in use, E5h deleted (or never used) |
| 1-8 | Name, padded with spaces |
| 9-11 | Extension; bit 7 of byte 9 set means the file is locked (README's D4 is T with bit 7 set) |
| 12 | Extent: which 16K piece of the file this entry describes |
| 13-14 | Not used |
| 15 | Record count: how many 128-byte records of this extent are used |
| 16-31 | Eight block numbers, two bytes each, low byte first |
A file over 16K has one entry per extent. STORY.TXT has two: extent 0 with 80h (128) records in blocks 2-9, and extent 1 with 1Dh (29).
python3 edisc.py entries FILES.DSK
Slot 0: README.TXT status 00 extent 0 records 1 blocks [1] locked
Slot 1: STORY.TXT status 00 extent 0 records 128 blocks [2, 3, 4, 5, 6, 7, 8, 9]
Slot 2: STORY.TXT status 00 extent 1 records 29 blocks [10, 11]
Slot 3: NUMBERS.BIN status 00 extent 0 records 24 blocks [12, 13]
Space is handed out in blocks of 2K - four sectors. Count sectors from track 2 sector 0 (that is logical sector 0); block n is logical sectors 4n to 4n+3, and logical sector L is track L / 10 + 2, sector L mod 10. Work it out for each sector: block 2 starts at track 2 sector 8 and finishes on track 3. Block 0 is the directory, so files start at block 1:
python3 edisc.py block FILES.DSK 1
Block 1: track 2, sector 4
Block 1: track 2, sector 5
Block 1: track 2, sector 6
Block 1: track 2, sector 7
000000 46 49 4C 45 53 2E 44 53 4B 20 2D 20 70 72 61 63 FILES.DSK - prac
That is the start of README.TXT, whose entry says block 1.
edisc.py block
FILES.DSK 12 and 13.Tracks 0-1 are the system's; the directory is track 2 sectors 0-3, 64 entries of 32 bytes; a file is a list of 2K blocks, and each block's sectors are worked out one at a time. You will need every line of this in Part three.
S4 puts the BDOS and the MOS side by side: who does what between your program and the disc.
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.