Try to be more consistent when referring to disks vs. drives (eg, Drive Controllers, not Disk Controllers)

This commit is contained in:
Jeff Parsons 2016-05-01 13:47:58 -07:00
commit b04ef7e49f
40 changed files with 5266 additions and 68 deletions

View file

@ -504,7 +504,7 @@ DiskDump.aDefaultBPBs = [
0x02, 0x00, // 0x1A: number of heads (2)
0x00, 0x00, 0x00, 0x00 // 0x1C: number of hidden sectors (always 0 for non-partitioned media)
],
[ // define BPB for 10Mb hard disk
[ // define BPB for 10Mb hard drive
0xEB, 0xFE, 0x90, // 0x00: JMP instruction, following by 8-byte OEM signature
0x50, 0x43, 0x4A, 0x53, 0x2E, 0x4F, 0x52, 0x47, // MY_OEM_STRING
// 0x49, 0x42, 0x4D, 0x20, 0x20, 0x32, 0x2E, 0x30, // "IBM 2.0" (this is a real OEM signature)
@ -514,7 +514,7 @@ DiskDump.aDefaultBPBs = [
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)
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 disk w/FAT12)
0xF8, // 0x15: media type (eg, 0xF8: hard drive w/FAT12)
0x08, 0x00, // 0x16: sectors per FAT (8)
// Wikipedia (http://en.wikipedia.org/wiki/File_Allocation_Table#BIOS_Parameter_Block) implies everything past this point was introduced
// post-DOS 2.0. I think that's wrong, because I just formatted a diskette with PC-DOS 2.0 and it properly initialized the next 3 fields as well.
@ -557,7 +557,7 @@ DiskDump.asTextFileExts = [".MD", ".ME", ".ASM", ".BAS", ".TXT", ".XML"];
*
* Additional command-line arguments include:
*
* --mbhd={number}: requests a hard disk image with the given number of megabytes (DEPRECATED)
* --mbhd={number}: requests a hard drive image with the given number of megabytes (DEPRECATED)
* --size={number}: requests a target disk size with the given number of kilobytes (eg, 360, 720, 1200, 1440, 10000)
* --exclude={filename}: specifies a filename that should be excluded from the image; repeat as often as needed
* --overwrite: allows the --output option to overwrite an existing file; default is to NOT overwrite
@ -2306,7 +2306,7 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
*/
for (var iBPB = 1; iBPB < DiskDump.aDefaultBPBs.length; iBPB++) {
/*
* If this BPB is for a hard disk but a hard disk size was not specified, skip it.
* If this BPB is for a hard drive but a disk size was not specified, skip it.
*/
abBoot = DiskDump.aDefaultBPBs[iBPB];
if ((abBoot[0x15] == 0xF8) != (this.kbTarget >= 10000)) continue;
@ -2356,7 +2356,7 @@ DiskDump.prototype.buildImageFromFiles = function(aFiles, done)
this.bufDisk.fill(0);
/*
* Output a Master Boot Record (MBR), if a hard disk image was requested
* Output a Master Boot Record (MBR), if a hard drive image was requested
*/
if (this.kbTarget >= 10000) {
abSector = this.buildMBR(cHeads, cSectorsPerTrack, cbSector, cTotalSectors);
@ -2464,7 +2464,7 @@ DiskDump.prototype.convertToJSON = function()
var offBootSector = 0;
var cbDiskData = this.bufDisk.length;
if (cbDiskData >= 3000000) { // arbitrary threshold between diskette image sizes and hard disk image sizes
if (cbDiskData >= 3000000) { // arbitrary threshold between diskette image sizes and hard drive image sizes
var wSig = this.bufDisk.readUInt16LE(0x1FE);
if (wSig == 0xAA55) {
/*
@ -3084,7 +3084,7 @@ DiskDump.prototype.convertToIMG = function()
* fJSONComments as another way of disabling "branding" via the API; requesting an IMG file with comments
* is otherwise a nonsensical request.
*/
if (!fDebug && !this.fJSONComments && buf.length < 3000000) { // arbitrary size threshold between diskette images and hard disk images
if (!fDebug && !this.fJSONComments && buf.length < 3000000) { // arbitrary size threshold between diskette images and hard drive images
/*
* Mimic the BPB test in convertToJSON(), because we don't want to blast an OEM string into non-DOS diskette images
*/

View file

@ -344,7 +344,7 @@ MarkOut.aHTMLEntities = {
* 'template' (eg, "machine.xsl")
* 'uncompiled' (eg, true)
* 'autoMount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}})
* 'drives' (eg, [{name:"68Mb Hard Disk",type:4,path:"http://archive.pcjs.org/disks/pc/fixed/68mb/win95.json"}])
* 'drives' (eg, [{name:"68Mb Hard Drive",type:4,path:"http://archive.pcjs.org/disks/pc/fixed/68mb/win95.json"}])
* 'parms'
*
* Non-reserved properties include:

View file

@ -92,11 +92,11 @@
*
* An example of #1 is in /devices/pc/machine/5160/cga/256kb/demo/machine.xml:
*
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",type:3}]'/>
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Drive",type:3}]'/>
*
* and an example of #2 is in /disks/pc/fixed/win101.xml:
*
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",path:"/disks/pc/fixed/win101/10mb.json",type:3}]'/>
* <hdc id="hdcXT" drives='[{name:"10Mb Hard Drive",path:"/disks/pc/fixed/win101/10mb.json",type:3}]'/>
*
* The HDC component expects an array of drive entries. Array position determines drive numbering
* (the first entry is drive 0, the second is drive 1, etc), and each entry contains the following
@ -150,7 +150,7 @@
* The real challenge here is avoiding revocation of a machine that still has critical changes to commit,
* but since we can't even solve the problem of a user closing their browser at an inopportune time
* and potentially leaving a disk image in an inconsistent state, premature revocation is the least of
* our problems. Since a real hard disk could suffer the same fate if the machine's power was turned off
* our problems. Since a real hard drive could suffer the same fate if the machine's power was turned off
* at the wrong time, you could say that we're simply providing a faithful simulation of reality.
*/
@ -1062,7 +1062,7 @@ Disk.prototype.load = function(sDiskName, sDiskPath, file, fnNotify, controller)
var sDiskParm = DumpAPI.QUERY.PATH;
var sSizeParm = '&' + DumpAPI.QUERY.MBHD + "=10";
/*
* 'mbhd' is a new parm added for hard disk support. In the case of 'file' or 'dir' requests,
* 'mbhd' is a new parm added for hard drive support. In the case of 'file' or 'dir' requests,
* 'mbhd' informs DumpAPI.ENDPOINT that it should create a hard disk image, and one not larger than
* the specified size (eg, 10mb). In fact, until DumpAPI.ENDPOINT is changed to create custom hard
* disk BPBs, you'll always get a standard PC XT 10mb disk image, so if the 'file' or 'dir' contains

View file

@ -343,7 +343,7 @@ FDC.REG_DATA = {
/*
* FDC "Fixed Disk" Register (0x3F6, write-only)
*
* Since this register's functions are all specific to the Hard Disk Controller, see the HDC component for details.
* Since this register's functions are all specific to the Hard Drive Controller, see the HDC component for details.
* The fact that this HDC register is in the middle of the FDC I/O port range is an oddity of the "HFCOMBO" controller.
*/
@ -351,8 +351,8 @@ FDC.REG_DATA = {
* FDC Digital Input Register (0x3F7, read-only, MODEL_5170 only)
*
* Bit 7 indicates a diskette change (the MODEL_5170 introduced change-line support). Bits 0-6 are for the selected
* hard disk drive, so this port must be shared with the HDC; bits 0-6 are valid for 50 microseconds after a write to
* the Drive Head Register.
* hard drive, so this port must be shared with the HDC; bits 0-6 are valid for 50 microseconds after a write to the
* Drive Head Register.
*/
FDC.REG_INPUT = {
PORT: 0x3F7,

View file

@ -132,7 +132,7 @@ HDC.DEFAULT_DRIVE_NAME = "Hard Drive";
* perfectly justified in retaining my original understanding of Kb and Mb and completely ignoring the
* existence of KiB and MiB.
*
* Besides, I suspect these changes were nothing more than a self-serving push by hard disk manufacturers,
* Besides, I suspect these changes were nothing more than a self-serving push by hard drive manufacturers,
* who wanted to exaggerate their disk capacities by treating Mb as 1,000,000 bytes.
*
* Also, I capitalize only the first letter of units like Kb and Mb, because kilobyte and megabyte are
@ -578,7 +578,7 @@ HDC.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
var sAlert = web.downloadFile(disk.encodeAsBase64(), "octet-stream", true, disk.sDiskFile.replace(".json", ".img"));
web.alertUser(sAlert);
} else {
hdc.notice("Hard disk " + iDrive + " is not available.");
hdc.notice("Hard drive " + iDrive + " is not available.");
}
};
}(+sBinding.slice(-1));
@ -1195,7 +1195,7 @@ HDC.prototype.seekDrive = function(drive, iSector, nSectors)
/*
* Important difference between the FDC and the XTC: the XTC uses 0-based sector numbers, so unlike
* FDC.seekDrive(), we must NOT add 1 to bSector below. I could change how sector numbers are stored in
* hard disk images, but it seems preferable to keep the image format consistent and controller-independent.
* hard drive images, but it seems preferable to keep the image format consistent and controller-independent.
*/
drive.bSector = (iSector % nSectorsPerTrack);
drive.nBytes = nSectors * aDiskInfo[3];
@ -1324,8 +1324,8 @@ HDC.prototype.doneLoadDisk = function(drive, disk, sDiskName, sDiskPath)
/**
* unloadDrive(iDrive)
*
* NOTE: At the moment, we support only auto-mounts; there is no user interface for selecting hard disk images,
* let alone unloading them, so there is currently no need for the following function.
* NOTE: At the moment, we support only auto-mounts; there is no user interface for selecting hard drive
* images, let alone unloading them, so there is currently no need for the following function.
*
* @this {HDC}
* @param {number} iDrive
@ -2158,7 +2158,7 @@ HDC.prototype.setATCIRR = function(fWrite)
if (!(this.regFDR & HDC.ATC.FDR.INT_DISABLE)) {
/*
* TODO: Determine what the "correct" instruction delay should be here. When the OS/2 1.0 Install Disk
* begins copying files to the hard disk, at one point it performs the following 125-sector write (use the
* begins copying files to the hard drive, at one point it performs the following 125-sector write (use the
* Debugger's "m hdc on" and "m pic on" commands to enable HDC and PIC messages, along with "m data on"
* if you also want to see the actual sector data being written):
*
@ -2953,7 +2953,7 @@ HDC.prototype.intBIOSDisk = function(addr)
* controller the caller really wants to reset.
*
* An unfortunate side-effect of this behavior: when the HDC BIOS is initialized for the first time, it may
* issue several resets internally, depending on whether there are 0, 1 or 2 hard disks installed, and each
* issue several resets internally, depending on whether there are 0, 1 or 2 hard drives installed, and each
* of those resets also triggers completely useless diskette resets, each wasting up to two seconds waiting
* for the FDC to interrupt. The FDC tries to interrupt, but it can't, because at this early stage of
* ROM BIOS initialization, IRQ.FDC hasn't been unmasked yet.

View file

@ -85,9 +85,9 @@ DiskAPI.DISKETTE_FORMATS = {
1474560: [80,2,18], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 18 sectors/track, (2880 total sectors x 512 bytes/sector == 1474560)
2949120: [80,2,36], // media type 0xF0: 80 cylinders, 2 heads (double-sided), 36 sectors/track, (5760 total sectors x 512 bytes/sector == 2949120)
/*
* The following are common early hard disk sizes, which we explicitly map to CHS values, since the BPB can mislead us when attempting to calculate total cylinders
* The following are common early hard drive sizes, which we explicitly map to CHS values, since the BPB can mislead us when attempting to calculate total cylinders
*/
21368320:[615,4,17] // PC AT 20Mb hard disk (type 2)
21368320:[615,4,17] // PC AT 20Mb hard drive (type 2)
};
DiskAPI.MBR = {

View file

@ -63,7 +63,7 @@ var DumpAPI = {
FORMAT: "format", // value is one of FORMAT values below
COMMENTS: "comments", // value is either "true" or "false"
DECIMAL: "decimal", // value is either "true" to force all numbers to decimal, "false" or undefined otherwise
MBHD: "mbhd", // value is hard disk size in Mb (formerly "mbsize") (DiskDump only) (DEPRECATED)
MBHD: "mbhd", // value is hard drive size in Mb (formerly "mbsize") (DiskDump only) (DEPRECATED)
SIZE: "size" // value is target disk size in Kb (supersedes "mbhd") (DiskDump only)
},
FORMAT: {