Changed DiskDump to deal better with disk images that are physically larger than the disk's logical file system (specifically, 320Kb FAT images inside 360Kb disk images, and 160Kb FAT images inside 180Kb disk images); the Lotus 1-2-3 v1.0a disks I dumped from my personal collection are the perfect example.
This commit is contained in:
parent
1a4afce36a
commit
c4a8d66027
11 changed files with 188 additions and 80 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -5,9 +5,9 @@ permalink: /disks/pcx86/apps/lotus/123/1.0a/
|
||||||
---
|
---
|
||||||
|
|
||||||
Lotus 1-2-3 1.0a
|
Lotus 1-2-3 1.0a
|
||||||
---
|
----------------
|
||||||
|
|
||||||
### Directory of Lotus 1-2-3 (System)
|
### Directory of Lotus 1-2-3 1.0a (System-PATCHED)
|
||||||
|
|
||||||
Volume in drive A has no label
|
Volume in drive A has no label
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ Lotus 1-2-3 1.0a
|
||||||
11 file(s) 244155 bytes
|
11 file(s) 244155 bytes
|
||||||
72704 bytes free
|
72704 bytes free
|
||||||
|
|
||||||
### Directory of Lotus 1-2-3 (Utility)
|
### Directory of Lotus 1-2-3 1.0a (Utility)
|
||||||
|
|
||||||
Volume in drive A has no label
|
Volume in drive A has no label
|
||||||
|
|
||||||
|
|
@ -75,7 +75,7 @@ Lotus 1-2-3 1.0a
|
||||||
33 file(s) 185587 bytes
|
33 file(s) 185587 bytes
|
||||||
116736 bytes free
|
116736 bytes free
|
||||||
|
|
||||||
### Directory of Lotus 1-2-3 (Graph)
|
### Directory of Lotus 1-2-3 1.0a (Graph)
|
||||||
|
|
||||||
Volume in drive A has no label
|
Volume in drive A has no label
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ Lotus 1-2-3 1.0a
|
||||||
20 file(s) 204350 bytes
|
20 file(s) 204350 bytes
|
||||||
108544 bytes free
|
108544 bytes free
|
||||||
|
|
||||||
### Directory of Lotus 1-2-3 (Tutorial)
|
### Directory of Lotus 1-2-3 1.0a (Tutorial)
|
||||||
|
|
||||||
Volume in drive A has no label
|
Volume in drive A has no label
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,102 @@
|
||||||
<category>Productivity</category>
|
<category>Productivity</category>
|
||||||
<author>Lotus</author>
|
<author>Lotus</author>
|
||||||
<releaseDate/>
|
<releaseDate/>
|
||||||
<disk id="disk01" size="368640" chs="40:2:9" img="archive/123-DISK1-SYSTEM.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK1-SYSTEM.json" md5="36aa0babe09470801636d9acb6a6d127" md5json="10202c5c7ac7a719e86464f29d14ae7f">
|
<disk id="disk01" size="368640" chs="40:2:9" img="archive/123-DISK1-SYSTEM-PATCHED.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK1-SYSTEM-PATCHED.json" md5="02b4711a30c8100415026c38e542ddc3" md5json="a6440e2e7c766cca184708a969213d00">
|
||||||
<name>Lotus 1-2-3 (System)</name>
|
<name>Lotus 1-2-3 1.0a (System)</name>
|
||||||
|
<file size="256" time="1983-07-01 02:23:00" attr="0x20">123.CNF</file>
|
||||||
|
<file size="89984" time="1984-08-17 16:59:30" attr="0x20">123.EXE</file>
|
||||||
|
<file size="113416" time="1983-07-01 02:23:00" attr="0x20">123.HLP</file>
|
||||||
|
<file size="2139" time="1983-07-01 02:23:00" attr="0x20">GD.DRV</file>
|
||||||
|
<file size="4736" time="1983-10-20 13:00:00" attr="0x20">IBMBIO.COM</file>
|
||||||
|
<file size="17024" time="1983-10-20 13:00:00" attr="0x20">IBMDOS.COM</file>
|
||||||
|
<file size="352" time="1983-07-01 02:23:00" attr="0x20">KB.DRV</file>
|
||||||
|
<file size="481" time="1983-07-01 02:23:00" attr="0x20">LOTUS.COM</file>
|
||||||
|
<file size="10144" time="1983-07-01 02:23:00" attr="0x20">LTSLOAD.COM</file>
|
||||||
|
<file size="329" time="1983-07-01 02:23:00" attr="0x20">PR.DRV</file>
|
||||||
|
<file size="5294" time="1983-07-01 02:23:00" attr="0x20">TD.DRV</file>
|
||||||
</disk>
|
</disk>
|
||||||
<disk id="disk02" size="368640" chs="40:2:9" img="archive/123-DISK2-UTILITY.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK2-UTILITY.json" md5="7c44429e0572cc9b5ccb69cd158d107e" md5json="6b6bb5326cd2a24370acdf9df9800d1a">
|
<disk id="disk02" size="368640" chs="40:2:9" img="archive/123-DISK2-UTILITY.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK2-UTILITY.json" md5="3f76942627e958a5495656f0332c88a4" md5json="7bc7de246155e26a41f844bf0d993067">
|
||||||
<name>Lotus 1-2-3 (Utility)</name>
|
<name>Lotus 1-2-3 1.0a (Utility)</name>
|
||||||
|
<file size="1036" time="1983-07-01 01:23:00" attr="0x20">B&W.BAT</file>
|
||||||
|
<file size="1036" time="1983-07-01 01:23:00" attr="0x20">BOTH.BAT</file>
|
||||||
|
<file size="1036" time="1983-07-01 01:23:00" attr="0x20">COLOR.BAT</file>
|
||||||
|
<file size="1036" time="1983-07-01 01:23:00" attr="0x20">COMPAQ.BAT</file>
|
||||||
|
<file size="3837" time="1983-07-01 01:23:00" attr="0x20">CONTINUE.BAT</file>
|
||||||
|
<file size="745" time="1983-07-01 01:23:00" attr="0x20">CPQ0TD.DRV</file>
|
||||||
|
<file size="16000" time="1983-07-01 01:23:00" attr="0x20">DBFWKS.EXE</file>
|
||||||
|
<file size="18304" time="1983-07-01 01:23:00" attr="0x20">DIFWKS.EXE</file>
|
||||||
|
<file size="17706" time="1983-07-01 01:23:00" attr="0x20">FILEMGR.COM</file>
|
||||||
|
<file size="1195" time="1983-07-01 01:23:00" attr="0x20">FIXDOS.COM</file>
|
||||||
|
<file size="2139" time="1983-07-01 01:23:00" attr="0x20">GD.DRV</file>
|
||||||
|
<file size="1036" time="1983-07-01 01:23:00" attr="0x20">HERCULES.BAT</file>
|
||||||
|
<file size="5294" time="1983-07-01 01:23:00" attr="0x20">IBM0B&W.DRV</file>
|
||||||
|
<file size="5294" time="1983-07-01 01:23:00" attr="0x20">IBM0COLO.DRV</file>
|
||||||
|
<file size="5293" time="1983-07-01 01:23:00" attr="0x20">IBM0HERC.DRV</file>
|
||||||
|
<file size="745" time="1983-07-01 01:23:00" attr="0x20">IBM0MONO.DRV</file>
|
||||||
|
<file size="2139" time="1983-07-01 01:23:00" attr="0x20">IBM1G1.DRV</file>
|
||||||
|
<file size="2139" time="1983-07-01 01:23:00" attr="0x20">IBM1G2.DRV</file>
|
||||||
|
<file size="2080" time="1983-07-01 01:23:00" attr="0x20">IBM1HERC.DRV</file>
|
||||||
|
<file size="352" time="1983-07-01 01:23:00" attr="0x20">IBM2KB.DRV</file>
|
||||||
|
<file size="329" time="1983-07-01 01:23:00" attr="0x20">IBM3PR.DRV</file>
|
||||||
|
<file size="1920" time="1983-06-02 17:21:46" attr="0x20">IBMBIO.COM</file>
|
||||||
|
<file size="6400" time="1983-06-02 17:21:48" attr="0x20">IBMDOS.COM</file>
|
||||||
|
<file size="352" time="1983-07-01 01:23:00" attr="0x20">KB.DRV</file>
|
||||||
|
<file size="481" time="1983-07-01 01:23:00" attr="0x20">LOTUS.COM</file>
|
||||||
|
<file size="10144" time="1983-07-01 01:23:00" attr="0x20">LTSLOAD.COM</file>
|
||||||
|
<file size="1021" time="1983-07-01 01:23:00" attr="0x20">MONO.BAT</file>
|
||||||
|
<file size="329" time="1983-07-01 01:23:00" attr="0x20">PR.DRV</file>
|
||||||
|
<file size="5294" time="1983-07-01 01:23:00" attr="0x20">TD.DRV</file>
|
||||||
|
<file size="20187" time="1983-07-01 01:23:00" attr="0x20">TRANSLAT.COM</file>
|
||||||
|
<file size="20224" time="1983-07-01 01:23:00" attr="0x20">VCWKS.EXE</file>
|
||||||
|
<file size="16128" time="1983-07-01 01:23:00" attr="0x20">WKSDBF.EXE</file>
|
||||||
|
<file size="14336" time="1983-07-01 01:23:00" attr="0x20">WKSDIF.EXE</file>
|
||||||
</disk>
|
</disk>
|
||||||
<disk id="disk03" size="368640" chs="40:2:9" img="archive/123-DISK3-GRAPH.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK3-GRAPH.json" md5="2f65d1d69f1b048c91373cf616f7b6b4" md5json="137b97e95889983d01e0922a379f2f50">
|
<disk id="disk03" size="368640" chs="40:2:9" img="archive/123-DISK3-GRAPH.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK3-GRAPH.json" md5="f7169659ec0f1f7666390fe2bc9c6f46" md5json="844c406a7534242cdaf2898bfa43b40a">
|
||||||
<name>Lotus 1-2-3 (Graph)</name>
|
<name>Lotus 1-2-3 1.0a (Graph)</name>
|
||||||
|
<file size="3597" time="1983-07-01 01:23:00" attr="0x20">BLOCK1.FON</file>
|
||||||
|
<file size="6593" time="1983-07-01 01:23:00" attr="0x20">BLOCK2.FON</file>
|
||||||
|
<file size="2139" time="1983-07-01 01:23:00" attr="0x20">GD.DRV</file>
|
||||||
|
<file size="384" time="1983-07-01 01:23:00" attr="0x20">GRAPH.CNF</file>
|
||||||
|
<file size="62080" time="1983-07-01 01:23:00" attr="0x20">GRAPH.EXE</file>
|
||||||
|
<file size="20747" time="1983-07-01 01:23:00" attr="0x20">GRAPH.HLP</file>
|
||||||
|
<file size="1920" time="1983-06-02 17:21:16" attr="0x20">IBMBIO.COM</file>
|
||||||
|
<file size="6400" time="1983-06-02 17:21:18" attr="0x20">IBMDOS.COM</file>
|
||||||
|
<file size="6507" time="1983-07-01 01:23:00" attr="0x20">ITALIC1.FON</file>
|
||||||
|
<file size="9076" time="1983-07-01 01:23:00" attr="0x20">ITALIC2.FON</file>
|
||||||
|
<file size="352" time="1983-07-01 01:23:00" attr="0x20">KB.DRV</file>
|
||||||
|
<file size="481" time="1983-07-01 01:23:00" attr="0x20">LOTUS.COM</file>
|
||||||
|
<file size="40889" time="1983-07-01 01:23:00" attr="0x20">LOTUS.DLB</file>
|
||||||
|
<file size="10144" time="1983-07-01 01:23:00" attr="0x20">LTSLOAD.COM</file>
|
||||||
|
<file size="329" time="1983-07-01 01:23:00" attr="0x20">PR.DRV</file>
|
||||||
|
<file size="4744" time="1983-07-01 01:23:00" attr="0x20">ROMAN1.FON</file>
|
||||||
|
<file size="9117" time="1983-07-01 01:23:00" attr="0x20">ROMAN2.FON</file>
|
||||||
|
<file size="5831" time="1983-07-01 01:23:00" attr="0x20">SCRIPT1.FON</file>
|
||||||
|
<file size="7726" time="1983-07-01 01:23:00" attr="0x20">SCRIPT2.FON</file>
|
||||||
|
<file size="5294" time="1983-07-01 01:23:00" attr="0x20">TD.DRV</file>
|
||||||
</disk>
|
</disk>
|
||||||
<disk id="disk04" size="368640" chs="40:2:9" img="archive/123-DISK4-TUTORIAL.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK4-TUTORIAL.json" md5="279acec5509aa07d3217789ce78eb622" md5json="4074f85008a692ca0ab37658506b6c82">
|
<disk id="disk04" size="368640" chs="40:2:9" img="archive/123-DISK4-TUTORIAL.img" href="/disks/pcx86/apps/lotus/123/1.0a/123-DISK4-TUTORIAL.json" md5="532be253f5efd4c43b1c72551eb005dd" md5json="bc32e9675734b2986f1bd25559163fe4">
|
||||||
<name>Lotus 1-2-3 (Tutorial)</name>
|
<name>Lotus 1-2-3 1.0a (Tutorial)</name>
|
||||||
|
<file size="2139" time="1983-07-01 01:23:00" attr="0x20">GD.DRV</file>
|
||||||
|
<file size="352" time="1983-07-01 01:23:00" attr="0x20">KB.DRV</file>
|
||||||
|
<file size="2944" time="1983-07-01 01:23:00" attr="0x20">LESNA_1.WKS</file>
|
||||||
|
<file size="1792" time="1983-07-01 01:23:00" attr="0x20">LESNA_2.WKS</file>
|
||||||
|
<file size="2816" time="1983-07-01 01:23:00" attr="0x20">LESNB_1.WKS</file>
|
||||||
|
<file size="2944" time="1983-07-01 01:23:00" attr="0x20">LESNC_1.WKS</file>
|
||||||
|
<file size="2560" time="1983-07-01 01:23:00" attr="0x20">LESND_1.WKS</file>
|
||||||
|
<file size="4224" time="1983-07-01 01:23:00" attr="0x20">LESNE_1.WKS</file>
|
||||||
|
<file size="4224" time="1983-07-01 01:23:00" attr="0x20">LESNF_1.WKS</file>
|
||||||
|
<file size="3456" time="1983-07-01 01:23:00" attr="0x20">LESNF_2.WKS</file>
|
||||||
|
<file size="329" time="1983-07-01 01:23:00" attr="0x20">PR.DRV</file>
|
||||||
|
<file size="5294" time="1983-07-01 01:23:00" attr="0x20">TD.DRV</file>
|
||||||
|
<file size="486" time="1983-07-01 01:23:00" attr="0x20">TUT0.TUT</file>
|
||||||
|
<file size="32356" time="1983-07-01 01:23:00" attr="0x20">TUTA.TUT</file>
|
||||||
|
<file size="19569" time="1983-07-01 01:23:00" attr="0x20">TUTB.TUT</file>
|
||||||
|
<file size="14548" time="1983-07-01 01:23:00" attr="0x20">TUTC.TUT</file>
|
||||||
|
<file size="24200" time="1983-07-01 01:23:00" attr="0x20">TUTD.TUT</file>
|
||||||
|
<file size="25061" time="1983-07-01 01:23:00" attr="0x20">TUTE.TUT</file>
|
||||||
|
<file size="21448" time="1983-07-01 01:23:00" attr="0x20">TUTF.TUT</file>
|
||||||
|
<file size="256" time="1983-07-01 01:23:00" attr="0x20">TUTOR.CNF</file>
|
||||||
|
<file size="108800" time="1983-07-01 01:23:00" attr="0x20">TUTOR.EXE</file>
|
||||||
|
<file size="4804" time="1983-07-01 01:23:00" attr="0x20">TUTOR.HLP</file>
|
||||||
</disk>
|
</disk>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -330,10 +330,10 @@
|
||||||
<disk path="/disks/pcx86/unix/sco/xenix/8086/2.1.3/GAMES.json">SCO Xenix 8086 (GAMES)</disk>
|
<disk path="/disks/pcx86/unix/sco/xenix/8086/2.1.3/GAMES.json">SCO Xenix 8086 (GAMES)</disk>
|
||||||
<disk path="/disks/pcx86/apps/ibm/topview/1.01/TOPVIEW101-PROGRAM.json">TopView 1.01 (Program)</disk>
|
<disk path="/disks/pcx86/apps/ibm/topview/1.01/TOPVIEW101-PROGRAM.json">TopView 1.01 (Program)</disk>
|
||||||
<disk path="/disks/pcx86/apps/ibm/topview/1.01/TOPVIEW101-TUTORIAL.json">TopView 1.01 (Tutorial)</disk>
|
<disk path="/disks/pcx86/apps/ibm/topview/1.01/TOPVIEW101-TUTORIAL.json">TopView 1.01 (Tutorial)</disk>
|
||||||
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK1-SYSTEM.json">Lotus 1-2-3 (System)</disk>
|
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK1-SYSTEM-PATCHED.json">Lotus 1-2-3 1.0a (System)</disk>
|
||||||
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK2-UTILITY.json">Lotus 1-2-3 (Utility)</disk>
|
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK2-UTILITY.json">Lotus 1-2-3 1.0a (Utility)</disk>
|
||||||
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK3-GRAPH.json">Lotus 1-2-3 (Graph)</disk>
|
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK3-GRAPH.json">Lotus 1-2-3 1.0a (Graph)</disk>
|
||||||
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK4-TUTORIAL.json">Lotus 1-2-3 (Tutorial)</disk>
|
<disk path="/disks/pcx86/apps/lotus/123/1.0a/123-DISK4-TUTORIAL.json">Lotus 1-2-3 1.0a (Tutorial)</disk>
|
||||||
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK1-INST.json">WordStar 3.30 (Disk 1)</disk>
|
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK1-INST.json">WordStar 3.30 (Disk 1)</disk>
|
||||||
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK2-PROG.json">WordStar 3.30 (Disk 2)</disk>
|
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK2-PROG.json">WordStar 3.30 (Disk 2)</disk>
|
||||||
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK3-SPELL.json">WordStar 3.30 (Disk 3)</disk>
|
<disk path="/disks/pcx86/apps/micropro/wordstar/3.30/WS330-DISK3-SPELL.json">WordStar 3.30 (Disk 3)</disk>
|
||||||
|
|
|
||||||
|
|
@ -427,7 +427,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x40, 0x00, // 0x11: root directory entries (0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
0x40, 0x00, // 0x11: root directory entries (0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
||||||
0x40, 0x01, // 0x13: number of sectors (0x140 or 320)
|
0x40, 0x01, // 0x13: number of sectors (0x140 or 320)
|
||||||
0xFE, // 0x15: media type (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
0xFE, // 0x15: media ID (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
||||||
0x01, 0x00, // 0x16: sectors per FAT (1)
|
0x01, 0x00, // 0x16: sectors per FAT (1)
|
||||||
0x08, 0x00, // 0x18: sectors per track (8)
|
0x08, 0x00, // 0x18: sectors per track (8)
|
||||||
0x01, 0x00, // 0x1A: number of heads (1)
|
0x01, 0x00, // 0x1A: number of heads (1)
|
||||||
|
|
@ -443,7 +443,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
||||||
0x80, 0x02, // 0x13: number of sectors (0x280 or 640)
|
0x80, 0x02, // 0x13: number of sectors (0x280 or 640)
|
||||||
0xFF, // 0x15: media type (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
0xFF, // 0x15: media ID (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
||||||
0x01, 0x00, // 0x16: sectors per FAT (1)
|
0x01, 0x00, // 0x16: sectors per FAT (1)
|
||||||
0x08, 0x00, // 0x18: sectors per track (8)
|
0x08, 0x00, // 0x18: sectors per track (8)
|
||||||
0x02, 0x00, // 0x1A: number of heads (2)
|
0x02, 0x00, // 0x1A: number of heads (2)
|
||||||
|
|
@ -459,7 +459,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x40, 0x00, // 0x11: root directory entries (0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
0x40, 0x00, // 0x11: root directory entries (0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
||||||
0x68, 0x01, // 0x13: number of sectors (0x168 or 360)
|
0x68, 0x01, // 0x13: number of sectors (0x168 or 360)
|
||||||
0xFC, // 0x15: media type (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
0xFC, // 0x15: media ID (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
||||||
0x02, 0x00, // 0x16: sectors per FAT (2)
|
0x02, 0x00, // 0x16: sectors per FAT (2)
|
||||||
0x09, 0x00, // 0x18: sectors per track (9)
|
0x09, 0x00, // 0x18: sectors per track (9)
|
||||||
0x01, 0x00, // 0x1A: number of heads (1)
|
0x01, 0x00, // 0x1A: number of heads (1)
|
||||||
|
|
@ -475,7 +475,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
||||||
0xD0, 0x02, // 0x13: number of sectors (0x2D0 or 720)
|
0xD0, 0x02, // 0x13: number of sectors (0x2D0 or 720)
|
||||||
0xFD, // 0x15: media type (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
0xFD, // 0x15: media ID (eg, 0xFF: 320Kb, 0xFE: 160Kb, 0xFD: 360Kb, 0xFC: 180Kb)
|
||||||
0x02, 0x00, // 0x16: sectors per FAT (2)
|
0x02, 0x00, // 0x16: sectors per FAT (2)
|
||||||
0x09, 0x00, // 0x18: sectors per track (9)
|
0x09, 0x00, // 0x18: sectors per track (9)
|
||||||
0x02, 0x00, // 0x1A: number of heads (2)
|
0x02, 0x00, // 0x1A: number of heads (2)
|
||||||
|
|
@ -491,7 +491,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
0x70, 0x00, // 0x11: root directory entries (0x70 or 112) 0x70 * 0x20 = 0xE00 (1 sector is 0x200 bytes, total of 7 sectors)
|
||||||
0xA0, 0x05, // 0x13: number of sectors (0x5A0 or 1440)
|
0xA0, 0x05, // 0x13: number of sectors (0x5A0 or 1440)
|
||||||
0xF9, // 0x15: media type
|
0xF9, // 0x15: media ID
|
||||||
0x03, 0x00, // 0x16: sectors per FAT (3)
|
0x03, 0x00, // 0x16: sectors per FAT (3)
|
||||||
0x09, 0x00, // 0x18: sectors per track (9)
|
0x09, 0x00, // 0x18: sectors per track (9)
|
||||||
0x02, 0x00, // 0x1A: number of heads (2)
|
0x02, 0x00, // 0x1A: number of heads (2)
|
||||||
|
|
@ -507,7 +507,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0xE0, 0x00, // 0x11: root directory entries (0xe0 or 224) 0xe0 * 0x20 = 0x1c00 (1 sector is 0x200 bytes, total of 14 sectors)
|
0xE0, 0x00, // 0x11: root directory entries (0xe0 or 224) 0xe0 * 0x20 = 0x1c00 (1 sector is 0x200 bytes, total of 14 sectors)
|
||||||
0x60, 0x09, // 0x13: number of sectors (0x960 or 2400)
|
0x60, 0x09, // 0x13: number of sectors (0x960 or 2400)
|
||||||
0xF9, // 0x15: media type (0xF9 was used for 1228800-byte diskettes, and later for 737280-byte diskettes)
|
0xF9, // 0x15: media ID (0xF9 was used for 1228800-byte diskettes, and later for 737280-byte diskettes)
|
||||||
0x07, 0x00, // 0x16: sectors per FAT (7)
|
0x07, 0x00, // 0x16: sectors per FAT (7)
|
||||||
0x0f, 0x00, // 0x18: sectors per track (15)
|
0x0f, 0x00, // 0x18: sectors per track (15)
|
||||||
0x02, 0x00, // 0x1A: number of heads (2)
|
0x02, 0x00, // 0x1A: number of heads (2)
|
||||||
|
|
@ -523,7 +523,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0xE0, 0x00, // 0x11: root directory entries (0xe0 or 224) 0xe0 * 0x20 = 0x1c00 (1 sector is 0x200 bytes, total of 14 sectors)
|
0xE0, 0x00, // 0x11: root directory entries (0xe0 or 224) 0xe0 * 0x20 = 0x1c00 (1 sector is 0x200 bytes, total of 14 sectors)
|
||||||
0x40, 0x0B, // 0x13: number of sectors (0xb40 or 2880)
|
0x40, 0x0B, // 0x13: number of sectors (0xb40 or 2880)
|
||||||
0xF0, // 0x15: media type (0xF0 was used for 1474560-byte diskettes)
|
0xF0, // 0x15: media ID (0xF0 was used for 1474560-byte diskettes)
|
||||||
0x09, 0x00, // 0x16: sectors per FAT (9)
|
0x09, 0x00, // 0x16: sectors per FAT (9)
|
||||||
0x12, 0x00, // 0x18: sectors per track (18)
|
0x12, 0x00, // 0x18: sectors per track (18)
|
||||||
0x02, 0x00, // 0x1A: number of heads (2)
|
0x02, 0x00, // 0x1A: number of heads (2)
|
||||||
|
|
@ -576,7 +576,7 @@ DiskDump.aDefaultBPBs = [
|
||||||
0x02, // 0x10: FAT copies (2)
|
0x02, // 0x10: FAT copies (2)
|
||||||
0x00, 0x02, // 0x11: root directory entries (0x200 or 512) 0x200 * 0x20 = 0x4000 (1 sector is 0x200 bytes, total of 0x20 or 32 sectors)
|
0x00, 0x02, // 0x11: root directory entries (0x200 or 512) 0x200 * 0x20 = 0x4000 (1 sector is 0x200 bytes, total of 0x20 or 32 sectors)
|
||||||
0x03, 0x51, // 0x13: number of sectors (0x5103 or 20739; * 512 bytes/sector = 10,618,368 bytes = 10,369Kb = 10Mb)
|
0x03, 0x51, // 0x13: number of sectors (0x5103 or 20739; * 512 bytes/sector = 10,618,368 bytes = 10,369Kb = 10Mb)
|
||||||
0xF8, // 0x15: media type (eg, 0xF8: hard drive w/FAT12)
|
0xF8, // 0x15: media ID (eg, 0xF8: hard drive w/FAT12)
|
||||||
0x08, 0x00, // 0x16: sectors per FAT (8)
|
0x08, 0x00, // 0x16: sectors per FAT (8)
|
||||||
//
|
//
|
||||||
// Wikipedia (http://en.wikipedia.org/wiki/File_Allocation_Table#BIOS_Parameter_Block) implies everything past
|
// Wikipedia (http://en.wikipedia.org/wiki/File_Allocation_Table#BIOS_Parameter_Block) implies everything past
|
||||||
|
|
@ -861,7 +861,7 @@ DiskDump.outputDisk = function(err, disk, sDiskPath, sOutputFile, fOverwrite, sM
|
||||||
var sDirName = path.dirname(sOutputFile);
|
var sDirName = path.dirname(sOutputFile);
|
||||||
if (!fs.existsSync(sDirName)) mkdirp.sync(sDirName);
|
if (!fs.existsSync(sDirName)) mkdirp.sync(sDirName);
|
||||||
fs.writeFileSync(sOutputFile, data.buf || data);
|
fs.writeFileSync(sOutputFile, data.buf || data);
|
||||||
DiskDump.logConsole(cbDisk + "-byte disk image saved to " + sOutputFile);
|
DiskDump.logConsole(cbDisk + "-byte disk image saved as " + sOutputFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
|
@ -2452,7 +2452,7 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
|
||||||
/*
|
/*
|
||||||
* If this BPB is for a hard drive but a disk size was not specified, skip it.
|
* If this BPB is for a hard drive but a disk size was not specified, skip it.
|
||||||
*/
|
*/
|
||||||
if ((abBoot[DiskAPI.BPB.MEDIA_TYPE] == DiskAPI.FAT.MEDIA_FIXED) != (this.kbTarget >= 10000)) continue;
|
if ((abBoot[DiskAPI.BPB.MEDIA_ID] == DiskAPI.FAT.MEDIA_FIXED) != (this.kbTarget >= 10000)) continue;
|
||||||
cRootEntries = abBoot[DiskAPI.BPB.ROOT_DIRENTS] | (abBoot[DiskAPI.BPB.ROOT_DIRENTS + 1] << 8);
|
cRootEntries = abBoot[DiskAPI.BPB.ROOT_DIRENTS] | (abBoot[DiskAPI.BPB.ROOT_DIRENTS + 1] << 8);
|
||||||
if (aFiles.length > cRootEntries) continue;
|
if (aFiles.length > cRootEntries) continue;
|
||||||
cbSector = abBoot[DiskAPI.BPB.SECTOR_BYTES] | (abBoot[DiskAPI.BPB.SECTOR_BYTES + 1] << 8);
|
cbSector = abBoot[DiskAPI.BPB.SECTOR_BYTES] | (abBoot[DiskAPI.BPB.SECTOR_BYTES + 1] << 8);
|
||||||
|
|
@ -2522,11 +2522,11 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
|
||||||
/*
|
/*
|
||||||
* Build the FAT, noting the starting cluster number that each file will use along the way.
|
* Build the FAT, noting the starting cluster number that each file will use along the way.
|
||||||
*
|
*
|
||||||
* Also, notice that the first byte of the FAT is the "media type" byte that's replicated in the
|
* Also, notice that the first byte of the FAT is the "media ID" byte that's replicated in the
|
||||||
* BPB at offset 0x15. For old BPB-less diskettes, this is where you must look for the media type.
|
* BPB at offset 0x15. For old BPB-less diskettes, this is where you must look for the media ID.
|
||||||
*/
|
*/
|
||||||
var abFAT = [];
|
var abFAT = [];
|
||||||
this.buildFATEntry(abFAT, 0, abBoot[DiskAPI.BPB.MEDIA_TYPE] | 0xF00);
|
this.buildFATEntry(abFAT, 0, abBoot[DiskAPI.BPB.MEDIA_ID] | 0xF00);
|
||||||
this.buildFATEntry(abFAT, 1, 0xFFF);
|
this.buildFATEntry(abFAT, 1, 0xFFF);
|
||||||
this.buildFAT(abFAT, aFiles, 2, cbCluster);
|
this.buildFAT(abFAT, aFiles, 2, cbCluster);
|
||||||
|
|
||||||
|
|
@ -2613,7 +2613,7 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
var aTracks = []; // track array (used only for disk images with track tables)
|
var aTracks = []; // track array (used only for disk images with track tables)
|
||||||
var iTrack, cbTrack, offTrack, bufTrack, bufSector;
|
var iTrack, cbTrack, offTrack, bufTrack, bufSector;
|
||||||
var cbSector = 512; // default sector size
|
var cbSector = 512; // default sector size
|
||||||
var bMediaType = 0;
|
var bMediaID = 0;
|
||||||
var offBootSector = 0;
|
var offBootSector = 0;
|
||||||
var cbDiskData = this.bufDisk.length, cbPartition = cbDiskData;
|
var cbDiskData = this.bufDisk.length, cbPartition = cbDiskData;
|
||||||
|
|
||||||
|
|
@ -2663,7 +2663,7 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
nHeads = diskFormat[1];
|
nHeads = diskFormat[1];
|
||||||
nSectorsPerTrack = diskFormat[2];
|
nSectorsPerTrack = diskFormat[2];
|
||||||
cbSector = diskFormat[3] || cbSector;
|
cbSector = diskFormat[3] || cbSector;
|
||||||
bMediaType = diskFormat[4] || bMediaType;
|
bMediaID = diskFormat[4] || bMediaID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2675,7 +2675,8 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
* size. I also check the first byte for an Intel JMP opcode (0xEB is JMP with a 1-byte displacement, and
|
* size. I also check the first byte for an Intel JMP opcode (0xEB is JMP with a 1-byte displacement, and
|
||||||
* 0xE9 is JMP with a 2-byte displacement). What else?
|
* 0xE9 is JMP with a 2-byte displacement). What else?
|
||||||
*/
|
*/
|
||||||
var fBPBExists = false;
|
var fBPBExists = false, bMediaIDBPB = 0;
|
||||||
|
|
||||||
if ((bByte0 == X86.OPCODE.JMP || bByte0 == X86.OPCODE.JMPS) && cbSectorBPB == cbSector) {
|
if ((bByte0 == X86.OPCODE.JMP || bByte0 == X86.OPCODE.JMPS) && cbSectorBPB == cbSector) {
|
||||||
|
|
||||||
var nHeadsBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.TOTAL_HEADS);
|
var nHeadsBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.TOTAL_HEADS);
|
||||||
|
|
@ -2684,27 +2685,28 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
if (nHeadsBPB && nSectorsPerTrackBPB) {
|
if (nHeadsBPB && nSectorsPerTrackBPB) {
|
||||||
|
|
||||||
fBPBExists = true;
|
fBPBExists = true;
|
||||||
var bMediaTypeBPB = this.bufDisk.readUInt8(offBootSector + DiskAPI.BPB.MEDIA_TYPE);
|
bMediaIDBPB = this.bufDisk.readUInt8(offBootSector + DiskAPI.BPB.MEDIA_ID);
|
||||||
|
|
||||||
var nSectorsTotalBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.TOTAL_SECS);
|
var nSectorsTotalBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.TOTAL_SECS);
|
||||||
var nSectorsPerCylinderBPB = nSectorsPerTrackBPB * nHeadsBPB;
|
var nSectorsPerCylinderBPB = nSectorsPerTrackBPB * nHeadsBPB;
|
||||||
var nSectorsHiddenBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.HIDDEN_SECS);
|
var nSectorsHiddenBPB = this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BPB.HIDDEN_SECS);
|
||||||
var nCylindersBPB = (nSectorsHiddenBPB + nSectorsTotalBPB) / nSectorsPerCylinderBPB;
|
var nCylindersBPB = (nSectorsHiddenBPB + nSectorsTotalBPB) / nSectorsPerCylinderBPB;
|
||||||
|
|
||||||
if (diskFormat) {
|
if (diskFormat) {
|
||||||
|
if (bMediaID && bMediaID != bMediaIDBPB) {
|
||||||
|
DiskDump.logWarning("BPB media ID (" + str.toHexByte(bMediaIDBPB) + ") do not match physical media ID (" + str.toHexByte(bMediaID) + ")");
|
||||||
|
}
|
||||||
if (nCylinders != nCylindersBPB) {
|
if (nCylinders != nCylindersBPB) {
|
||||||
DiskDump.logWarning("BPB cylinders (" + nCylindersBPB + ") do not match actual cylinders (" + nCylinders + ")");
|
DiskDump.logWarning("BPB cylinders (" + nCylindersBPB + ") do not match physical cylinders (" + nCylinders + ")");
|
||||||
if (nCylinders - nCylindersBPB == 1) {
|
if (nCylinders - nCylindersBPB == 1) {
|
||||||
DiskDump.logWarning("the BIOS may have reserved the last cylinder for diagnostics");
|
DiskDump.logWarning("the BIOS may have reserved the last cylinder for diagnostics");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nHeads != nHeadsBPB) {
|
if (nHeads != nHeadsBPB) {
|
||||||
DiskDump.logWarning("BPB heads (" + nHeadsBPB + ") do not match actual heads (" + nHeads + ")");
|
DiskDump.logWarning("BPB heads (" + nHeadsBPB + ") do not match physical heads (" + nHeads + ")");
|
||||||
}
|
}
|
||||||
if (nSectorsPerTrack != nSectorsPerTrackBPB) {
|
if (nSectorsPerTrack != nSectorsPerTrackBPB) {
|
||||||
DiskDump.logWarning("BPB sectors/track (" + nSectorsPerTrackBPB + ") do not match actual sectors/track (" + nSectorsPerTrack + ")");
|
DiskDump.logWarning("BPB sectors/track (" + nSectorsPerTrackBPB + ") do not match physical sectors/track (" + nSectorsPerTrack + ")");
|
||||||
}
|
|
||||||
if (bMediaType && bMediaType != bMediaTypeBPB) {
|
|
||||||
DiskDump.logWarning("BPB media type (" + bMediaTypeBPB + ") do not match actual media type (" + bMediaType + ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -2715,7 +2717,7 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
DiskDump.logWarning("total cylinders (" + nCylinders + ") not a multiple of heads (" + nHeads + ") and sectors/track (" + nSectorsPerTrack + ")");
|
DiskDump.logWarning("total cylinders (" + nCylinders + ") not a multiple of heads (" + nHeads + ") and sectors/track (" + nSectorsPerTrack + ")");
|
||||||
nCylinders |= 0;
|
nCylinders |= 0;
|
||||||
}
|
}
|
||||||
bMediaType = bMediaTypeBPB;
|
bMediaID = bMediaIDBPB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2755,9 +2757,9 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
* Let's see if we can find a corresponding BPB in our table of default BPBs.
|
* Let's see if we can find a corresponding BPB in our table of default BPBs.
|
||||||
*/
|
*/
|
||||||
var i, iBPB = -1;
|
var i, iBPB = -1;
|
||||||
if (bMediaType) {
|
if (bMediaID) {
|
||||||
for (i = 0; i < DiskDump.aDefaultBPBs.length; i++) {
|
for (i = 0; i < DiskDump.aDefaultBPBs.length; i++) {
|
||||||
if (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.MEDIA_TYPE] == bMediaType) {
|
if (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.MEDIA_ID] == bMediaID) {
|
||||||
var cbDiskBPB = (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.TOTAL_SECS] + (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.TOTAL_SECS + 1] * 0x100)) * cbSector;
|
var cbDiskBPB = (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.TOTAL_SECS] + (DiskDump.aDefaultBPBs[i][DiskAPI.BPB.TOTAL_SECS + 1] * 0x100)) * cbSector;
|
||||||
if (cbDiskBPB == cbDiskData) {
|
if (cbDiskBPB == cbDiskData) {
|
||||||
iBPB = i;
|
iBPB = i;
|
||||||
|
|
@ -2771,13 +2773,21 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
/*
|
/*
|
||||||
* In deference to the PC-DOS 2.0 BPB behavior discussed above, we stop our BPB verification
|
* In deference to the PC-DOS 2.0 BPB behavior discussed above, we stop our BPB verification
|
||||||
* after the first word of HIDDEN_SECS.
|
* after the first word of HIDDEN_SECS.
|
||||||
|
*
|
||||||
|
* Also, we permit a physical 360Kb disk image to contain a logical 320Kb image (and similarly, a physical
|
||||||
|
* 180Kb disk image to contain a logical 160Kb disk image), because it was entirely possible for someone to
|
||||||
|
* take a diskette formatted with 9 sectors/track and "DISKCOPY" another disk with only 8 sectors/track onto it.
|
||||||
|
* When we imaged the physical disk, we likely read all readable sectors, regardless of whether the file system
|
||||||
|
* contained within used them all or not.
|
||||||
*/
|
*/
|
||||||
for (i = DiskAPI.BPB.SECTOR_BYTES; i < DiskAPI.BPB.HIDDEN_SECS + 2; i++) {
|
if ((bMediaIDBPB != DiskAPI.FAT.MEDIA_320KB || bMediaID != DiskAPI.FAT.MEDIA_360KB) && (bMediaIDBPB != DiskAPI.FAT.MEDIA_160KB || bMediaID != DiskAPI.FAT.MEDIA_180KB)) {
|
||||||
var bDefault = DiskDump.aDefaultBPBs[iBPB][i];
|
for (i = DiskAPI.BPB.SECTOR_BYTES; i < DiskAPI.BPB.HIDDEN_SECS + 2; i++) {
|
||||||
var bActual = this.bufDisk.readUInt8(offBootSector + i);
|
var bDefault = DiskDump.aDefaultBPBs[iBPB][i];
|
||||||
if (bDefault != bActual) {
|
var bActual = this.bufDisk.readUInt8(offBootSector + i);
|
||||||
DiskDump.logWarning("BPB byte " + str.toHexByte(i) + " default (" + str.toHexByte(bDefault) + ") does not match actual byte: " + str.toHexByte(bActual));
|
if (bDefault != bActual) {
|
||||||
fBPBExists = false;
|
DiskDump.logWarning("BPB byte " + str.toHexByte(i) + " default (" + str.toHexByte(bDefault) + ") does not match actual byte: " + str.toHexByte(bActual));
|
||||||
|
fBPBExists = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2796,7 +2806,19 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
*
|
*
|
||||||
* However, if --forceBPB is specified, all those concerns go out the window: the goal is assumed to
|
* However, if --forceBPB is specified, all those concerns go out the window: the goal is assumed to
|
||||||
* be a mountable disk, not a bootable disk. So the BPB copy starts at offset 0 instead of SECTOR_BYTES.
|
* be a mountable disk, not a bootable disk. So the BPB copy starts at offset 0 instead of SECTOR_BYTES.
|
||||||
|
*
|
||||||
|
* And again, we must also deal with a physical 360Kb disk image containing a logical 320Kb image (and
|
||||||
|
* similarly, a physical 180Kb disk image containing a logical 160Kb disk image). So we check the FAT ID
|
||||||
|
* byte to make sure we're using a BPB that matches the logical disk image.
|
||||||
*/
|
*/
|
||||||
|
bMediaIDBPB = this.bufDisk.readUInt8(offBootSector + 512);
|
||||||
|
if (bMediaIDBPB == DiskAPI.FAT.MEDIA_320KB && bMediaID == DiskAPI.FAT.MEDIA_360KB) {
|
||||||
|
if (iBPB == 3) iBPB = 1;
|
||||||
|
}
|
||||||
|
else if (bMediaIDBPB == DiskAPI.FAT.MEDIA_160KB && bMediaID == DiskAPI.FAT.MEDIA_180KB) {
|
||||||
|
if (iBPB == 2) iBPB = 0;
|
||||||
|
}
|
||||||
|
bMediaID = DiskDump.aDefaultBPBs[iBPB][DiskAPI.BPB.MEDIA_ID];
|
||||||
for (i = this.forceBPB? 0 : DiskAPI.BPB.SECTOR_BYTES; i < DiskAPI.BPB.LARGE_SECS+4; i++) {
|
for (i = this.forceBPB? 0 : DiskAPI.BPB.SECTOR_BYTES; i < DiskAPI.BPB.LARGE_SECS+4; i++) {
|
||||||
this.bufDisk.writeUInt8(DiskDump.aDefaultBPBs[iBPB][i] || 0, offBootSector + i);
|
this.bufDisk.writeUInt8(DiskDump.aDefaultBPBs[iBPB][i] || 0, offBootSector + i);
|
||||||
}
|
}
|
||||||
|
|
@ -2807,7 +2829,7 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
* WARNING: I've added this "0xF6" hack expressly to fix boot sectors that may have been zapped by an
|
* WARNING: I've added this "0xF6" hack expressly to fix boot sectors that may have been zapped by an
|
||||||
* inadvertent reformat, or...?
|
* inadvertent reformat, or...?
|
||||||
*/
|
*/
|
||||||
DiskDump.logWarning("repairing damaged boot sector with BPB for media type " + str.toHexByte(bMediaType));
|
DiskDump.logWarning("repairing damaged boot sector with BPB for media ID " + str.toHexByte(bMediaID));
|
||||||
for (i = 0; i < DiskAPI.BPB.LARGE_SECS+4; i++) {
|
for (i = 0; i < DiskAPI.BPB.LARGE_SECS+4; i++) {
|
||||||
this.bufDisk.writeUInt8(DiskDump.aDefaultBPBs[iBPB][i] || 0, offBootSector + i);
|
this.bufDisk.writeUInt8(DiskDump.aDefaultBPBs[iBPB][i] || 0, offBootSector + i);
|
||||||
}
|
}
|
||||||
|
|
@ -2817,7 +2839,7 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (fBPBExists && this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BOOT.SIG_OFFSET) == DiskAPI.BOOT.SIGNATURE) {
|
if (fBPBExists && this.bufDisk.readUInt16LE(offBootSector + DiskAPI.BOOT.SIG_OFFSET) == DiskAPI.BOOT.SIGNATURE || this.forceBPB) {
|
||||||
/*
|
/*
|
||||||
* Overwrite the OEM string with our own, so that people know how the image originated. We do this
|
* Overwrite the OEM string with our own, so that people know how the image originated. We do this
|
||||||
* only for disks with pre-existing BPBs; it's not safe for pre-2.0 disks (and non-DOS disks, obviously).
|
* only for disks with pre-existing BPBs; it's not safe for pre-2.0 disks (and non-DOS disks, obviously).
|
||||||
|
|
@ -2980,12 +3002,12 @@ DiskDump.prototype.convertToJSON = function()
|
||||||
|
|
||||||
bufSector = bufTrack.slice(offSector, offSector + cbSectorThisTrack);
|
bufSector = bufTrack.slice(offSector, offSector + cbSectorThisTrack);
|
||||||
|
|
||||||
if (bMediaType && !iCylinder && !iHead && iSector == ((offBootSector/cbSector)|0) + 2) {
|
if (bMediaID && !iCylinder && !iHead && iSector == ((offBootSector/cbSector)|0) + 2) {
|
||||||
var bFATType = bufSector.readUInt8(0);
|
var bFATID = bufSector.readUInt8(0);
|
||||||
if (bMediaType != bFATType) {
|
if (bMediaID != bFATID) {
|
||||||
DiskDump.logWarning("media byte mismatch (" + str.toHexByte(bFATType) + ") in FAT, expected " + str.toHexByte(bMediaType));
|
DiskDump.logWarning("FAT ID (" + str.toHexByte(bFATID) + ") does not match physical media ID (" + str.toHexByte(bMediaID) + ")");
|
||||||
}
|
}
|
||||||
bMediaType = 0;
|
bMediaID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var preComma = (fOptimize? ',' : '');
|
var preComma = (fOptimize? ',' : '');
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ DiskAPI.BPB = {
|
||||||
TOTAL_FATS: 0x010, // 1 byte: FAT copies (eg, 2)
|
TOTAL_FATS: 0x010, // 1 byte: FAT copies (eg, 2)
|
||||||
ROOT_DIRENTS: 0x011, // 2 bytes: root directory entries (eg, 0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
ROOT_DIRENTS: 0x011, // 2 bytes: root directory entries (eg, 0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
||||||
TOTAL_SECS: 0x013, // 2 bytes: number of sectors (eg, 0x140 or 320); if zero, refer to LARGE_SECS
|
TOTAL_SECS: 0x013, // 2 bytes: number of sectors (eg, 0x140 or 320); if zero, refer to LARGE_SECS
|
||||||
MEDIA_TYPE: 0x015, // 1 byte: media type (see DiskAPI.FAT.MEDIA_*)
|
MEDIA_ID: 0x015, // 1 byte: media ID (see DiskAPI.FAT.MEDIA_*); should also match the first byte of the FAT (aka FAT ID)
|
||||||
FAT_SECS: 0x016, // 2 bytes: sectors per FAT (eg, 1)
|
FAT_SECS: 0x016, // 2 bytes: sectors per FAT (eg, 1)
|
||||||
TRACK_SECS: 0x018, // 2 bytes: sectors per track (eg, 8)
|
TRACK_SECS: 0x018, // 2 bytes: sectors per track (eg, 8)
|
||||||
TOTAL_HEADS: 0x01A, // 2 bytes: number of heads (eg, 1)
|
TOTAL_HEADS: 0x01A, // 2 bytes: number of heads (eg, 1)
|
||||||
|
|
@ -146,21 +146,21 @@ DiskAPI.BPB = {
|
||||||
*
|
*
|
||||||
* Each entry in GEOMETRIES is an array of values in "CHS" order:
|
* Each entry in GEOMETRIES is an array of values in "CHS" order:
|
||||||
*
|
*
|
||||||
* [# cylinders, # heads, # sectors/track, # bytes/sector, media type]
|
* [# cylinders, # heads, # sectors/track, # bytes/sector, media ID]
|
||||||
*
|
*
|
||||||
* If the 4th value is omitted, the sector size is assumed to be 512. The order of these "geometric" values mirrors
|
* If the 4th value is omitted, the sector size is assumed to be 512. The order of these "geometric" values mirrors
|
||||||
* the structure of our JSON-encoded disk images, which consist of an array of cylinders, each of which is an array of
|
* the structure of our JSON-encoded disk images, which consist of an array of cylinders, each of which is an array of
|
||||||
* heads, each of which is an array of sector objects.
|
* heads, each of which is an array of sector objects.
|
||||||
*/
|
*/
|
||||||
DiskAPI.GEOMETRIES = {
|
DiskAPI.GEOMETRIES = {
|
||||||
163840: [40,1,8,,0xFE], // media type 0xFE: 40 cylinders, 1 head (single-sided), 8 sectors/track, ( 320 total sectors x 512 bytes/sector == 163840)
|
163840: [40,1,8,,0xFE], // media ID 0xFE: 40 cylinders, 1 head (single-sided), 8 sectors/track, ( 320 total sectors x 512 bytes/sector == 163840)
|
||||||
184320: [40,1,9,,0xFC], // media type 0xFC: 40 cylinders, 1 head (single-sided), 9 sectors/track, ( 360 total sectors x 512 bytes/sector == 184320)
|
184320: [40,1,9,,0xFC], // media ID 0xFC: 40 cylinders, 1 head (single-sided), 9 sectors/track, ( 360 total sectors x 512 bytes/sector == 184320)
|
||||||
327680: [40,2,8,,0xFF], // media type 0xFF: 40 cylinders, 2 heads (double-sided), 8 sectors/track, ( 640 total sectors x 512 bytes/sector == 327680)
|
327680: [40,2,8,,0xFF], // media ID 0xFF: 40 cylinders, 2 heads (double-sided), 8 sectors/track, ( 640 total sectors x 512 bytes/sector == 327680)
|
||||||
368640: [40,2,9,,0xFD], // media type 0xFD: 40 cylinders, 2 heads (double-sided), 9 sectors/track, ( 720 total sectors x 512 bytes/sector == 368640)
|
368640: [40,2,9,,0xFD], // media ID 0xFD: 40 cylinders, 2 heads (double-sided), 9 sectors/track, ( 720 total sectors x 512 bytes/sector == 368640)
|
||||||
737280: [80,2,9,,0xF9], // media type 0xF9: 80 cylinders, 2 heads (double-sided), 9 sectors/track, (1440 total sectors x 512 bytes/sector == 737280)
|
737280: [80,2,9,,0xF9], // media ID 0xF9: 80 cylinders, 2 heads (double-sided), 9 sectors/track, (1440 total sectors x 512 bytes/sector == 737280)
|
||||||
1228800: [80,2,15,,0xF9], // media type 0xF9: 80 cylinders, 2 heads (double-sided), 15 sectors/track, (2400 total sectors x 512 bytes/sector == 1228800)
|
1228800: [80,2,15,,0xF9], // media ID 0xF9: 80 cylinders, 2 heads (double-sided), 15 sectors/track, (2400 total sectors x 512 bytes/sector == 1228800)
|
||||||
1474560: [80,2,18,,0xF0], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 18 sectors/track, (2880 total sectors x 512 bytes/sector == 1474560)
|
1474560: [80,2,18,,0xF0], // media ID 0xF0: 80 cylinders, 2 heads (double-sided), 18 sectors/track, (2880 total sectors x 512 bytes/sector == 1474560)
|
||||||
2949120: [80,2,36,,0xF0], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 36 sectors/track, (5760 total sectors x 512 bytes/sector == 2949120)
|
2949120: [80,2,36,,0xF0], // media ID 0xF0: 80 cylinders, 2 heads (double-sided), 36 sectors/track, (5760 total sectors x 512 bytes/sector == 2949120)
|
||||||
/*
|
/*
|
||||||
* The following are some common disk sizes and their CHS values, since missing or bogus MBR and/or BPB values
|
* The following are some common disk sizes and their CHS values, since missing or bogus MBR and/or BPB values
|
||||||
* might mislead us when attempting to determine the exact disk geometry.
|
* might mislead us when attempting to determine the exact disk geometry.
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ DiskAPI.BPB = {
|
||||||
TOTAL_FATS: 0x010, // 1 byte: FAT copies (eg, 2)
|
TOTAL_FATS: 0x010, // 1 byte: FAT copies (eg, 2)
|
||||||
ROOT_DIRENTS: 0x011, // 2 bytes: root directory entries (eg, 0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
ROOT_DIRENTS: 0x011, // 2 bytes: root directory entries (eg, 0x40 or 64) 0x40 * 0x20 = 0x800 (1 sector is 0x200 bytes, total of 4 sectors)
|
||||||
TOTAL_SECS: 0x013, // 2 bytes: number of sectors (eg, 0x140 or 320); if zero, refer to LARGE_SECS
|
TOTAL_SECS: 0x013, // 2 bytes: number of sectors (eg, 0x140 or 320); if zero, refer to LARGE_SECS
|
||||||
MEDIA_TYPE: 0x015, // 1 byte: media type (see DiskAPI.FAT.MEDIA_*)
|
MEDIA_ID: 0x015, // 1 byte: media ID (see DiskAPI.FAT.MEDIA_*); should also match the first byte of the FAT (aka FAT ID)
|
||||||
FAT_SECS: 0x016, // 2 bytes: sectors per FAT (eg, 1)
|
FAT_SECS: 0x016, // 2 bytes: sectors per FAT (eg, 1)
|
||||||
TRACK_SECS: 0x018, // 2 bytes: sectors per track (eg, 8)
|
TRACK_SECS: 0x018, // 2 bytes: sectors per track (eg, 8)
|
||||||
TOTAL_HEADS: 0x01A, // 2 bytes: number of heads (eg, 1)
|
TOTAL_HEADS: 0x01A, // 2 bytes: number of heads (eg, 1)
|
||||||
|
|
@ -215,21 +215,21 @@ DiskAPI.BPB = {
|
||||||
*
|
*
|
||||||
* Each entry in GEOMETRIES is an array of values in "CHS" order:
|
* Each entry in GEOMETRIES is an array of values in "CHS" order:
|
||||||
*
|
*
|
||||||
* [# cylinders, # heads, # sectors/track, # bytes/sector, media type]
|
* [# cylinders, # heads, # sectors/track, # bytes/sector, media ID]
|
||||||
*
|
*
|
||||||
* If the 4th value is omitted, the sector size is assumed to be 512. The order of these "geometric" values mirrors
|
* If the 4th value is omitted, the sector size is assumed to be 512. The order of these "geometric" values mirrors
|
||||||
* the structure of our JSON-encoded disk images, which consist of an array of cylinders, each of which is an array of
|
* the structure of our JSON-encoded disk images, which consist of an array of cylinders, each of which is an array of
|
||||||
* heads, each of which is an array of sector objects.
|
* heads, each of which is an array of sector objects.
|
||||||
*/
|
*/
|
||||||
DiskAPI.GEOMETRIES = {
|
DiskAPI.GEOMETRIES = {
|
||||||
163840: [40,1,8,,0xFE], // media type 0xFE: 40 cylinders, 1 head (single-sided), 8 sectors/track, ( 320 total sectors x 512 bytes/sector == 163840)
|
163840: [40,1,8,,0xFE], // media ID 0xFE: 40 cylinders, 1 head (single-sided), 8 sectors/track, ( 320 total sectors x 512 bytes/sector == 163840)
|
||||||
184320: [40,1,9,,0xFC], // media type 0xFC: 40 cylinders, 1 head (single-sided), 9 sectors/track, ( 360 total sectors x 512 bytes/sector == 184320)
|
184320: [40,1,9,,0xFC], // media ID 0xFC: 40 cylinders, 1 head (single-sided), 9 sectors/track, ( 360 total sectors x 512 bytes/sector == 184320)
|
||||||
327680: [40,2,8,,0xFF], // media type 0xFF: 40 cylinders, 2 heads (double-sided), 8 sectors/track, ( 640 total sectors x 512 bytes/sector == 327680)
|
327680: [40,2,8,,0xFF], // media ID 0xFF: 40 cylinders, 2 heads (double-sided), 8 sectors/track, ( 640 total sectors x 512 bytes/sector == 327680)
|
||||||
368640: [40,2,9,,0xFD], // media type 0xFD: 40 cylinders, 2 heads (double-sided), 9 sectors/track, ( 720 total sectors x 512 bytes/sector == 368640)
|
368640: [40,2,9,,0xFD], // media ID 0xFD: 40 cylinders, 2 heads (double-sided), 9 sectors/track, ( 720 total sectors x 512 bytes/sector == 368640)
|
||||||
737280: [80,2,9,,0xF9], // media type 0xF9: 80 cylinders, 2 heads (double-sided), 9 sectors/track, (1440 total sectors x 512 bytes/sector == 737280)
|
737280: [80,2,9,,0xF9], // media ID 0xF9: 80 cylinders, 2 heads (double-sided), 9 sectors/track, (1440 total sectors x 512 bytes/sector == 737280)
|
||||||
1228800: [80,2,15,,0xF9], // media type 0xF9: 80 cylinders, 2 heads (double-sided), 15 sectors/track, (2400 total sectors x 512 bytes/sector == 1228800)
|
1228800: [80,2,15,,0xF9], // media ID 0xF9: 80 cylinders, 2 heads (double-sided), 15 sectors/track, (2400 total sectors x 512 bytes/sector == 1228800)
|
||||||
1474560: [80,2,18,,0xF0], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 18 sectors/track, (2880 total sectors x 512 bytes/sector == 1474560)
|
1474560: [80,2,18,,0xF0], // media ID 0xF0: 80 cylinders, 2 heads (double-sided), 18 sectors/track, (2880 total sectors x 512 bytes/sector == 1474560)
|
||||||
2949120: [80,2,36,,0xF0], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 36 sectors/track, (5760 total sectors x 512 bytes/sector == 2949120)
|
2949120: [80,2,36,,0xF0], // media ID 0xF0: 80 cylinders, 2 heads (double-sided), 36 sectors/track, (5760 total sectors x 512 bytes/sector == 2949120)
|
||||||
/*
|
/*
|
||||||
* The following are some common disk sizes and their CHS values, since missing or bogus MBR and/or BPB values
|
* The following are some common disk sizes and their CHS values, since missing or bogus MBR and/or BPB values
|
||||||
* might mislead us when attempting to determine the exact disk geometry.
|
* might mislead us when attempting to determine the exact disk geometry.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue