diff --git a/disks/pcx86/dos/compaq/1.11/README.md b/disks/pcx86/dos/compaq/1.11/README.md index 681967bcd..642cab2de 100644 --- a/disks/pcx86/dos/compaq/1.11/README.md +++ b/disks/pcx86/dos/compaq/1.11/README.md @@ -117,8 +117,8 @@ The boot sector of the COMPAQ MS-DOS 1.11 disk image contains the following byte 000001e0 00 00 00 00 00 00 00 e7 01 00 00 00 00 00 00 00 |................| 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -Unlike most DOS boot sectors, this boot sector doesn't start with an Intel x86 JMP instruction. Let's take a -look at the code, using the PCjs Debugger to stop at the first instruction: +Unlike most DOS boot sectors, this boot sector doesn't start with an Intel x86 JMP instruction. +Let's take a look at the code, using the PCjs Debugger to stop at the first instruction: >> bp 0:7c00 bp &0000:7C00 set @@ -134,44 +134,38 @@ look at the code, using the PCjs Debugger to stop at the first instruction: &0000:7C04 B8C007 MOV AX,07C0 &0000:7C07 8ED0 MOV SS,AX &0000:7C09 FB STI - ; - ; At this point, the stack has been set to an unused region INSIDE the boot sector, because - ; 07C0:01E7 is the same as 0000:7C00+01E7 or 0000:7DE7. This puts a fairly low limit on stack - ; usage: as more stack is used, the COMPAQ copyright string will be trashed first, then boot - ; sector data, then boot sector code. - ; - ; Curiously, the value 01E7 is also stored at 07C0:01E7. Also curious is the choice of an ODD - ; address for the stack (although, for the 8088, this presumably didn't affect performance). - ; + +At this point, the stack has been set to an unused region INSIDE the boot sector, because +07C0:01E7 is the same as 0000:7C00+01E7 or 0000:7DE7. This puts a fairly low limit on stack +usage: as more stack is used, the COMPAQ copyright string will be trashed first, then boot +sector data, then boot sector code. + +Curiously, the value 01E7 is also stored at 07C0:01E7. Also curious is the choice of an ODD +address for the stack (although, for the 8088, this presumably didn't affect performance). + +After the next two instructions, all of DS:0, ES:0, and SS:0 point to the beginning of the +boot sector (just like CS:7C00): + &0000:7C0A 8ED8 MOV DS,AX &0000:7C0C 8EC0 MOV ES,AX - ; - ; All of DS:0, ES:0, and SS:0 now point to the beginning of the boot sector, as does CS:7C00. - ; - &0000:7C0E 33C0 XOR AX,AX ; perform a disk reset + +This resets the drive: + + &0000:7C0E 33C0 XOR AX,AX ; perform a drive reset &0000:7C10 CD13 INT 13 - ; - ; Read 1 sector (the 4th sector, which is the first sector of the directory) into memory immediately - ; above the boot sector (07C0:0200). - ; + +Next, read 1 sector (the 4th sector, which is the first sector of the directory) into memory +immediately above the boot sector (07C0:0200): + &0000:7C12 B80102 MOV AX,0201 &0000:7C15 BB0002 MOV BX,0200 &0000:7C18 B90400 MOV CX,0004 &0000:7C1B 33D2 XOR DX,DX - &0000:7C1D E88B00 CALL 7CAB ; call DISK_IO + &0000:7C1D E88B00 CALL 7CAB ; read the disk &0000:7C20 EB1C JMP 7C3E - ; - ; ERROR: print error message and start over. - ; - ; Setting DS:BX to 07C0:00DA references the same memory as CS:7CDA: - ; - ; >> db cs:7cda cs:7d22 - ; &0000:7CDA 0A 0D 4E 6F 6E 2D 53 79-73 74 65 6D 20 64 69 73 ..Non-System dis - ; &0000:7CEA 6B 20 6F 72 20 64 69 73-6B 20 65 72 72 6F 72 0A k or disk error. - ; &0000:7CFA 0D 52 65 70 6C 61 63 65-20 61 6E 64 20 73 74 72 .Replace and str - ; &0000:7D0A 69 6B 65 20 61 6E 79 20-6B 65 79 20 77 68 65 6E ike any key when - ; &0000:7D1A 20 72 65 61 64 79 0A 0D-24 ready..$ - ; + +Next, the error handler and restart sequence: + &0000:7C22 BBDA00 MOV BX,00DA &0000:7C25 8A07 MOV AL,[BX] &0000:7C27 3C24 CMP AL,24 @@ -188,51 +182,62 @@ look at the code, using the PCjs Debugger to stop at the first instruction: &0000:7C3B EBC3 JMP 7C00 ; start over &0000:7C3D C3 RET ; unreachable RET? +Here's the error message (setting DS:BX to 07C0:00DA references the same memory as CS:7CDA): + + >> db cs:7cda cs:7d22 + &0000:7CDA 0A 0D 4E 6F 6E 2D 53 79-73 74 65 6D 20 64 69 73 ..Non-System dis + &0000:7CEA 6B 20 6F 72 20 64 69 73-6B 20 65 72 72 6F 72 0A k or disk error. + &0000:7CFA 0D 52 65 70 6C 61 63 65-20 61 6E 64 20 73 74 72 .Replace and str + &0000:7D0A 69 6B 65 20 61 6E 79 20-6B 65 79 20 77 68 65 6E ike any key when + &0000:7D1A 20 72 65 61 64 79 0A 0D-24 ready..$ + +Next, we have the code to validate the directory contents: + &0000:7C3E FC CLD &0000:7C3F 8BF3 MOV SI,BX &0000:7C41 BFC400 MOV DI,00C4 ; ES:DI -> 7C0:C4 (aka 0:7CC4) &0000:7C44 B90B00 MOV CX,000B &0000:7C47 F3 REPZ &0000:7C48 A6 CMPSB - &0000:7C49 75D7 JNZ 7C22 ; if first DIRENTRY was not "IOSYS.COM", jump to ERROR + &0000:7C49 75D7 JNZ 7C22 ; if first DIRENTRY was not "IOSYS.COM", jump to error handler &0000:7C4B 83C615 ADD SI,0015 &0000:7C4E B90B00 MOV CX,000B &0000:7C51 F3 REPZ &0000:7C52 A6 CMPSB - &0000:7C53 75CD JNZ 7C22 ; if second DIRENTRY was not "IOSYS.COM", jump to ERROR + &0000:7C53 75CD JNZ 7C22 ; if second DIRENTRY was not "IOSYS.COM", jump to error handler &0000:7C55 B80102 MOV AX,0201 &0000:7C58 BB0002 MOV BX,0200 &0000:7C5B B90200 MOV CX,0002 &0000:7C5E 33D2 XOR DX,DX - &0000:7C60 E84800 CALL 7CAB ; call DISK_IO to read 1st FAT sector - ; - ; At this point, the directory sector is gone, and all this code did with it was verify the names of - ; the first two entries. It did not examine or record their starting cluster numbers. And in the FAT - ; sector just read, only one byte (the first byte) will be examined next: the media ID byte. - ; - ; Further reading will rely on on two hard-coded tables inside the boot sector: one table at DS:126 (CS:7D26) - ; if the FAT media ID byte is 0xFE (160Kb diskette), or another table at DS:13C (CS:7D3C) if the FAT media ID - ; byte is 0xFF (320Kb diskette). If the FAT media ID byte is neither, off to ERROR we go. - ; - ; Here's the table for the 160Kb diskette: - ; - ; >> dw cs:7d26 l11. - ; &0000:7D26 0201 0008 0000 0208 0200 0101 0000 0208 ................ - ; &0000:7D36 1000 0201 0000 ...... - ; - ; and here's the table for the 320Kb diskette: - ; - ; >> dw cs:7d3c l11. - ; &0000:7D3C 0206 0003 0100 0208 0C00 0101 0000 0203 ................ - ; &0000:7D4C 1000 0101 0100 ...... - ; - ; These tables are then followed by a DWORD jump address: - ; - ; >> dw cs:7d52 l2 - ; &0000:7D52 0000 0060 ..`. - ; - ; which means that the "JMP FAR [0152]" instruction will jump to 60:0 after the reads are complete. - ; + &0000:7C60 E84800 CALL 7CAB ; read 1st FAT sector + +At this point, the directory sector is gone, and all this code did with it was verify the names of +the first two entries. It did not examine or record their starting cluster numbers. And in the FAT +sector just read, only one byte (the first byte) will be examined next: the media ID byte. + +Further reading will rely on on two hard-coded tables inside the boot sector: one table at DS:126 (CS:7D26) +if the FAT media ID byte is 0xFE (160Kb diskette), or another table at DS:13C (CS:7D3C) if the FAT media ID +byte is 0xFF (320Kb diskette). If the FAT media ID byte is neither, off to the error handler we go. + +Here's the table for the 160Kb diskette: + + >> dw cs:7d26 l11. + &0000:7D26 0201 0008 0000 0208 0200 0101 0000 0208 ................ + &0000:7D36 1000 0201 0000 ...... + +and here's the table for the 320Kb diskette: + + >> dw cs:7d3c l11. + &0000:7D3C 0206 0003 0100 0208 0C00 0101 0000 0203 ................ + &0000:7D4C 1000 0101 0100 ...... + +These tables are then followed by a DWORD jump address: + + >> dw cs:7d52 l2 + &0000:7D52 0000 0060 ..`. + +which means that the "JMP FAR [0152]" instruction will jump to 60:0 after the reads are complete. + &0000:7C63 8A27 MOV AH,[BX] &0000:7C65 80FCFE CMP AH,FE &0000:7C68 BE2601 MOV SI,0126 @@ -260,9 +265,10 @@ look at the code, using the PCjs Debugger to stop at the first instruction: &0000:7CA1 8B5414 MOV DX,[SI+14] &0000:7CA4 E80400 CALL 7CAB &0000:7CA7 FF2E5201 JMP FAR [0152] - ; - ; DISK_IO: read AL sector(s) identified by the CHS values in CX:DX into ES:BX, using DI as a retry counter. - ; + +The final chunk of code is the disk read interface, which reads AL sector(s) identified by the CHS values in CX:DX +into ES:BX, using DI as a retry counter: + &0000:7CAB BF0500 MOV DI,0005 &0000:7CAE 57 PUSH DI &0000:7CAF 50 PUSH AX @@ -279,7 +285,9 @@ look at the code, using the PCjs Debugger to stop at the first instruction: &0000:7CBE 75EE JNZ 7CAE &0000:7CC0 58 POP AX ; retry count exhausted &0000:7CC1 E95EFF JMP 7C22 ; jump to PRINT function - + +And then we have the assorted strings and tables: + >> db 7cc4 l13c &7CC4 49 4F 53 59 53 20 20 20-43 4F 4D 4D 53 44 4F 53 IOSYS COMMSDOS &7CD4 20 20 20 43 4F 4D 0A 0D-4E 6F 6E 2D 53 79 73 74 COM..Non-Syst @@ -310,7 +318,11 @@ relieving the code from dealing with head and track size calculations. It's arguably an improvement over the [PC-DOS 1.10 Boot Sector](/disks/pcx86/dos/ibm/1.10/#pc-dos-110-boot-sector), because it didn't need to be altered to support both 160Kb and 320Kb diskettes. On the other hand, that flexibility -also makes it slightly slower to boot, because it must read the first FAT sector to determine the diskette format. +also makes it slightly slower to boot, because it must read the first FAT sector to determine the diskette format. + +Finally, notice the letters `GAS` in the boot sector at offset 0x7D23. Presumably, they're the initials of +author, and somewhat less conspicuous and more modest than the `Robert O'Rear` signature in the +[PC-DOS 1.00 Boot Sector](/disks/pcx86/dos/ibm/1.00/#pc-dos-100-boot-sector). ### Mounting the COMPAQ MS-DOS 1.11 Diskette diff --git a/disks/pcx86/dos/ibm/1.00/README.md b/disks/pcx86/dos/ibm/1.00/README.md index b012dde8d..a8609b0b1 100644 --- a/disks/pcx86/dos/ibm/1.00/README.md +++ b/disks/pcx86/dos/ibm/1.00/README.md @@ -78,6 +78,41 @@ CHKDSK reports: ### PC-DOS 1.00 Boot Sector +The boot sector of the PC-DOS 1.00 disk image contains the following bytes: + + 00000000 eb 2f 14 00 00 00 60 00 20 37 2d 4d 61 79 2d 38 |./....`. 7-May-8| + 00000010 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |1...............| + 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 00000030 00 fa 8c c8 8e d8 ba 00 00 8e d2 bc 00 7c fb a1 |.............|..| + 00000040 06 7c 8e d8 8e c0 ba 00 00 8b c2 cd 13 72 41 e8 |.|...........rA.| + 00000050 58 00 72 fb 2e 8b 0e 02 7c 51 bb 00 00 33 d2 b9 |X.r.....|Q...3..| + 00000060 08 00 be 01 00 56 b0 01 b4 02 cd 13 72 22 5e 58 |.....V......r"^X| + 00000070 e8 e7 00 2b c6 74 14 fe c5 b1 01 be 08 00 3b c6 |...+.t........;.| + 00000080 73 04 8b f0 eb 01 96 56 50 eb dd 2e ff 2e 04 7c |s......VP......|| + 00000090 be 44 7d b8 42 7d 50 32 ff ac 24 7f 74 0b 56 b4 |.D}.B}P2..$.t.V.| + 000000a0 0e bb 07 00 cd 10 5e eb f0 c3 bb 00 00 b9 04 00 |......^.........| + 000000b0 b8 01 02 cd 13 1e 72 34 8c c8 8e d8 bf 00 00 b9 |......r4........| + 000000c0 0b 00 26 80 0d 20 26 80 8d 20 00 20 47 e2 f3 bf |..&.. &.. . G...| + 000000d0 00 00 be 76 7d b9 0b 00 fc f3 a6 75 0f bf 20 00 |...v}......u.. .| + 000000e0 be 82 7d b9 0b 00 f3 a6 75 02 1f c3 be f9 7c e8 |..}.....u.....|.| + 000000f0 a5 ff b4 00 cd 16 1f f9 c3 0d 0a 4e 6f 6e 2d 53 |...........Non-S| + 00000100 79 73 74 65 6d 20 64 69 73 6b 20 6f 72 20 64 69 |ystem disk or di| + 00000110 73 6b 20 65 72 72 6f f2 0d 0a 52 65 70 6c 61 63 |sk erro...Replac| + 00000120 65 20 61 6e 64 20 73 74 72 69 6b 65 20 61 6e 79 |e and strike any| + 00000130 20 6b 65 79 20 77 68 65 6e 20 72 65 61 64 f9 0d | key when read..| + 00000140 0a 00 cd 18 0d 0a 44 69 73 6b 20 42 6f 6f 74 20 |......Disk Boot | + 00000150 66 61 69 6c 75 72 e5 0d 0a 00 50 52 8b c6 bf 00 |failur....PR....| + 00000160 02 f7 e7 03 d8 5a 58 c3 52 6f 62 65 72 74 20 4f |.....ZX.Robert O| + 00000170 27 52 65 61 72 20 69 62 6d 62 69 6f 20 20 63 6f |'Rear ibmbio co| + 00000180 6d b0 69 62 6d 64 6f 73 20 20 63 6f 6d b0 c9 00 |m.ibmdos com...| + 00000190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| + A number of people have already delved into the guts of the PC-DOS 1.00 boot sector, including: * [Reverse-Engineering DOS 1.0 – Part 1: The Boot Sector (May 7, 2009 by Michael Steil)](http://www.pagetable.com/?p=165) @@ -265,46 +300,43 @@ Using the PCjs Debugger, we can examine the boot sector in its native environmen &0000:7C00 EB2F JMP 7C31 >> db 7c00 l200 - &7C00 EB 2F 14 00 00 00 60 00-20 37 2D 4D 61 79 2D 38 ./....`. 7-May-8 - &7C10 31 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 1............... - &7C20 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7C30 00 FA 8C C8 8E D8 BA 00-00 8E D2 BC 00 7C FB A1 .............|.. - &7C40 06 7C 8E D8 8E C0 BA 00-00 8B C2 CD 13 72 41 E8 .|...........rA. - &7C50 58 00 72 FB 2E 8B 0E 02-7C 51 BB 00 00 33 D2 B9 X.r.....|Q...3.. - &7C60 08 00 BE 01 00 56 B0 01-B4 02 CD 13 72 22 5E 58 .....V......r"^X - &7C70 E8 E7 00 2B C6 74 14 FE-C5 B1 01 BE 08 00 3B C6 ...+.t........;. - &7C80 73 04 8B F0 EB 01 96 56-50 EB DD 2E FF 2E 04 7C s......VP......| - &7C90 BE 44 7D B8 42 7D 50 32-FF AC 24 7F 74 0B 56 B4 .D}.B}P2..$t.V. - &7CA0 0E BB 07 00 CD 10 5E EB-F0 C3 BB 00 00 B9 04 00 ......^......... - &7CB0 B8 01 02 CD 13 1E 72 34-8C C8 8E D8 BF 00 00 B9 ......r4........ - &7CC0 0B 00 26 80 0D 20 26 80-8D 20 00 20 47 E2 F3 BF ..&.. &.. . G... - &7CD0 00 00 BE 76 7D B9 0B 00-FC F3 A6 75 0F BF 20 00 ...v}......u.. . - &7CE0 BE 82 7D B9 0B 00 F3 A6-75 02 1F C3 BE F9 7C E8 ..}.....u.....|. - &7CF0 A5 FF B4 00 CD 16 1F F9-C3 0D 0A 4E 6F 6E 2D 53 ...........Non-S - &7D00 79 73 74 65 6D 20 64 69-73 6B 20 6F 72 20 64 69 ystem disk or di - &7D10 73 6B 20 65 72 72 6F F2-0D 0A 52 65 70 6C 61 63 sk erro...Replac - &7D20 65 20 61 6E 64 20 73 74-72 69 6B 65 20 61 6E 79 e and strike any - &7D30 20 6B 65 79 20 77 68 65-6E 20 72 65 61 64 F9 0D key when read.. - &7D40 0A 00 CD 18 0D 0A 44 69-73 6B 20 42 6F 6F 74 20 ......Disk Boot - &7D50 66 61 69 6C 75 72 E5 0D-0A 00 50 52 8B C6 BF 00 failur....PR.... - &7D60 02 F7 E7 03 D8 5A 58 C3-52 6F 62 65 72 74 20 4F .....ZX.Robert O - &7D70 27 52 65 61 72 20 69 62-6D 62 69 6F 20 20 63 6F 'Rear ibmbio co - &7D80 6D B0 69 62 6D 64 6F 73-20 20 63 6F 6D B0 C9 00 m.ibmdos com... - &7D90 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DA0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DB0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DC0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DD0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DE0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ - &7DF0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7C00 EB 2F 14 00 00 00 60 00-20 37 2D 00 02 01 01 00 ./....`. 7-..... + &0000:7C10 02 40 00 40 01 FE 01 00-08 00 01 00 00 00 00 00 .@.@............ + &0000:7C20 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7C30 00 FA 8C C8 8E D8 BA 00-00 8E D2 BC 00 7C FB A1 .............|.. + &0000:7C40 06 7C 8E D8 8E C0 BA 00-00 8B C2 CD 13 72 41 E8 .|...........rA. + &0000:7C50 58 00 72 FB 2E 8B 0E 02-7C 51 BB 00 00 33 D2 B9 X.r.....|Q...3.. + &0000:7C60 08 00 BE 01 00 56 B0 01-B4 02 CD 13 72 22 5E 58 .....V......r"^X + &0000:7C70 E8 E7 00 2B C6 74 14 FE-C5 B1 01 BE 08 00 3B C6 ...+.t........;. + &0000:7C80 73 04 8B F0 EB 01 96 56-50 EB DD 2E FF 2E 04 7C s......VP......| + &0000:7C90 BE 44 7D B8 42 7D 50 32-FF AC 24 7F 74 0B 56 B4 .D}.B}P2..$t.V. + &0000:7CA0 0E BB 07 00 CD 10 5E EB-F0 C3 BB 00 00 B9 04 00 ......^......... + &0000:7CB0 B8 01 02 CD 13 1E 72 34-8C C8 8E D8 BF 00 00 B9 ......r4........ + &0000:7CC0 0B 00 26 80 0D 20 26 80-8D 20 00 20 47 E2 F3 BF ..&.. &.. . G... + &0000:7CD0 00 00 BE 76 7D B9 0B 00-FC F3 A6 75 0F BF 20 00 ...v}......u.. . + &0000:7CE0 BE 82 7D B9 0B 00 F3 A6-75 02 1F C3 BE F9 7C E8 ..}.....u.....|. + &0000:7CF0 A5 FF B4 00 CD 16 1F F9-C3 0D 0A 4E 6F 6E 2D 53 ...........Non-S + &0000:7D00 79 73 74 65 6D 20 64 69-73 6B 20 6F 72 20 64 69 ystem disk or di + &0000:7D10 73 6B 20 65 72 72 6F F2-0D 0A 52 65 70 6C 61 63 sk erro...Replac + &0000:7D20 65 20 61 6E 64 20 73 74-72 69 6B 65 20 61 6E 79 e and strike any + &0000:7D30 20 6B 65 79 20 77 68 65-6E 20 72 65 61 64 F9 0D key when read.. + &0000:7D40 0A 00 CD 18 0D 0A 44 69-73 6B 20 42 6F 6F 74 20 ......Disk Boot + &0000:7D50 66 61 69 6C 75 72 E5 0D-0A 00 50 52 8B C6 BF 00 failur....PR.... + &0000:7D60 02 F7 E7 03 D8 5A 58 C3-52 6F 62 65 72 74 20 4F .....ZX.Robert O + &0000:7D70 27 52 65 61 72 20 69 62-6D 62 69 6F 20 20 63 6F 'Rear ibmbio co + &0000:7D80 6D B0 69 62 6D 64 6F 73-20 20 63 6F 6D B0 C9 00 m.ibmdos com... + &0000:7D90 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DA0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DB0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DC0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DD0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DE0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DF0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ -NOTE: When PCjs adds a BPB to the boot sector, the first 32 bytes will actually look like: - - &7C00 EB 2F 14 00 00 00 60 00-20 37 2D 00 02 01 01 00 ./....`. 7-..... - &7C10 02 40 00 40 01 FE 01 00-08 00 01 00 00 00 00 00 .@.@............ - -The addition of a BPB makes the disk image mountable by modern operating systems and does not -otherwise affect the operation of the boot sector or any of the code below. +NOTE: PCjs adds a BPB to the boot sector, which is why the first 32 bytes of the boot sector +appear slightly different from the original [dump](#pc-dos-100-boot-sector) above. The addition of +a BPB makes the disk image mountable by modern operating systems and does not otherwise affect the +operation of the boot sector or any of the code below. First, let's disassemble the code from `start` (0x7C31): @@ -439,6 +471,11 @@ And finally, `IBMBIO_COM` (0x7D76) and `IBMDOS_COM` (0x7D82): &7D78 6D 62 69 6F 20 20 63 6F-6D B0 69 62 6D 64 6F 73 mbio com.ibmdos &7D88 20 20 63 6F 6D B0 C9 00-00 00 00 00 00 00 00 00 com........... +Interestingly, the [COMPAQ MS-DOS 1.11 Boot Sector](/disks/pcx86/dos/compaq/1.11/#compaq-ms-dos-111-boot-sector) +is completely different from all PC-DOS 1.x boot sectors. The COMPAQ boot sector supports both 160Kb and 320Kb +formats with less code and without requiring "patches", although that flexibility did require reading the first +FAT sector, which PC-DOS 1.x boot sectors did not do. + ### Additional Information From [PC DOS Retro](https://sites.google.com/site/pcdosretro/doshist) - distributed on 1 160KB floppy disk diff --git a/disks/pcx86/dos/ibm/1.10/README.md b/disks/pcx86/dos/ibm/1.10/README.md index 8d48220f9..ae0b2e830 100644 --- a/disks/pcx86/dos/ibm/1.10/README.md +++ b/disks/pcx86/dos/ibm/1.10/README.md @@ -74,7 +74,7 @@ size of IBMDOS.COM is 6656, so the total number of bytes consumed by those two f ### PC-DOS 1.10 Boot Sector -The boot sector of the PC-DOS 1.11 disk image contains the following bytes: +The boot sector of the PC-DOS 1.10 disk image contains the following bytes: 00000000 eb 27 90 08 00 14 00 00 00 00 00 00 00 00 00 00 |.'..............| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| @@ -124,6 +124,11 @@ a 320Kb diskette is allocated a larger root directory (7 sectors instead of 4), out to sector #3 and head #1. The total number of sectors to read (0x14) remains the same as PC-DOS 1.00, but that value is now stored at offset 0x0005 (0x7C05) instead of 0x0002 (0x7C02). +Interestingly, the [COMPAQ MS-DOS 1.11 Boot Sector](/disks/pcx86/dos/compaq/1.11/#compaq-ms-dos-111-boot-sector) +is completely different from all PC-DOS 1.x boot sectors. The COMPAQ boot sector supports both 160Kb and 320Kb +formats with less code and without requiring "patches", although that flexibility did require reading the first +FAT sector, which PC-DOS 1.x boot sectors did not do. + Using the PCjs Debugger, we can examine the boot sector in its native environment: bp &0000:7C00 hit @@ -131,6 +136,46 @@ Using the PCjs Debugger, we can examine the boot sector in its native environmen AX=0000 BX=7C00 CX=0004 DX=0000 SP=0100 BP=E4B7 SI=0000 DI=0044 SS=0030 DS=0040 ES=0000 PS=F296 V0 D0 I1 T0 S1 Z0 A1 P1 C0 &0000:7C00 EB27 JMP 7C29 + + >> db 7c00 l200 + &0000:7C00 EB 27 90 08 00 14 00 00-00 00 00 00 02 01 01 00 .'.............. + &0000:7C10 02 40 00 40 01 FE 01 00-08 00 01 00 00 00 00 00 .@.@............ + &0000:7C20 00 00 00 00 00 00 00 CD-19 FA 8C C8 8E D8 33 D2 ..............3. + &0000:7C30 8E D2 BC 00 7C FB B8 60-00 8E D8 8E C0 33 D2 8B ....|..`.....3.. + &0000:7C40 C2 CD 13 72 69 E8 85 00-72 DD 2E 83 3E 03 7C 08 ...ri...r...>.|. + &0000:7C50 74 06 2E C6 06 64 7D 02-BB 00 00 2E 8B 0E 03 7C t....d}........| + &0000:7C60 51 B0 09 2A C1 B4 00 8B-F0 56 33 D2 33 C0 8A C5 Q..*.....V3.3... + &0000:7C70 2E F6 36 64 7D 8A E8 8A-F4 8B C6 B4 02 CD 13 72 ..6d}..........r + &0000:7C80 2D 5E 59 2E 29 36 05 7C-74 1F 8B C6 2E F7 26 65 -^Y.)6.|t.....&e + &0000:7C90 7D 03 D8 FE C5 B1 01 51-BE 08 00 2E 3B 36 05 7C }......Q....;6.| + &0000:7CA0 7C 05 2E 8B 36 05 7C EB-C0 EA 00 00 60 00 BE 67 |...6.|.....`..g + &0000:7CB0 7D E8 02 00 EB FE 32 FF-2E AC 24 7F 74 0B 56 B4 }.....2...$t.V. + &0000:7CC0 0E BB 07 00 CD 10 5E EB-EF C3 E9 33 FF BB 00 00 ......^....3.... + &0000:7CD0 B9 04 00 B8 01 02 CD 13-1E 72 33 8C C8 8E D8 BF .........r3..... + &0000:7CE0 00 00 B9 0B 00 26 80 0D-20 26 80 4D 20 20 47 E2 .....&.. &.M G. + &0000:7CF0 F4 BF 00 00 BE 8B 7D B9-0B 00 FC F3 A6 75 0F BF ......}......u.. + &0000:7D00 20 00 BE 97 7D B9 0B 00-F3 A6 75 02 1F C3 BE 1B ...}.....u..... + &0000:7D10 7D E8 A2 FF B4 00 CD 16-1F F9 C3 0D 0A 4E 6F 6E }............Non + &0000:7D20 2D 53 79 73 74 65 6D 20-64 69 73 6B 20 6F 72 20 -System disk or + &0000:7D30 64 69 73 6B 20 65 72 72-6F 72 0D 0A 52 65 70 6C disk error..Repl + &0000:7D40 61 63 65 20 61 6E 64 20-73 74 72 69 6B 65 20 61 ace and strike a + &0000:7D50 6E 79 20 6B 65 79 20 77-68 65 6E 20 72 65 61 64 ny key when read + &0000:7D60 79 0D 0A 00 01 00 02 0D-0A 44 69 73 6B 20 42 6F y........Disk Bo + &0000:7D70 6F 74 20 66 61 69 6C 75-72 65 0D 0A 00 4D 69 63 ot failure...Mic + &0000:7D80 72 6F 73 6F 66 74 2C 49-6E 63 20 69 62 6D 62 69 rosoft,Inc ibmbi + &0000:7D90 6F 20 20 63 6F 6D 30 69-62 6D 64 6F 73 20 20 63 o com0ibmdos c + &0000:7DA0 6F 6D 30 05 C6 06 77 2F-FF 83 7E FC 00 75 0B 80 om0...w/..~..u.. + &0000:7DB0 7E F7 3B 75 05 C6 06 76-2F FF 89 EC 5D CA 04 00 ~.;u...v/...]... + &0000:7DC0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DD0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DE0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + &0000:7DF0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + +NOTE: PCjs adds a BPB to the boot sector, which is why the first 32 bytes of the boot sector +appear slightly different from the original [dump](#pc-dos-110-boot-sector) above. The addition of +a BPB makes the disk image mountable by modern operating systems and does not otherwise affect the +operation of the boot sector or any of the code below. + >> tr AX=0000 BX=7C00 CX=0004 DX=0000 SP=0100 BP=E4B7 SI=0000 DI=0044 SS=0030 DS=0040 ES=0000 PS=F296 V0 D0 I1 T0 S1 Z0 A1 P1 C0