Cleaned up disk types

This commit is contained in:
Jeff Parsons 2016-03-17 08:31:38 -07:00
commit 456aae0ebe
5 changed files with 63 additions and 64 deletions

View file

@ -10,7 +10,7 @@ machines:
automount: automount:
A: A:
path: /disks/pc/os2/ibm/1.1/OS211-INSTALLATION.json path: /disks/pc/os2/ibm/1.1/OS211-INSTALLATION.json
messages: fault|disk|data messages: fault
--- ---
IBM OS/2 1.1 IBM OS/2 1.1

View file

@ -30,8 +30,8 @@ banner is displayed:
88286 88286
The 5-digit number indicates the day the files were built. The first 2 digits are the year (88) and the 3 remaining The 5-digit number indicates the day the files were built. The first 2 digits (88) are the year and the 3 remaining
digits are the day of the year (286 or October 12). digits (286) are the day of the year (October 12).
A directory listing of this disk is provided [below](#directory-of-os2-10-debugger-boot-disk). A directory listing of this disk is provided [below](#directory-of-os2-10-debugger-boot-disk).

View file

@ -407,7 +407,7 @@ HTTPAPI.openUserVolume = function(sPath, sMachine, sUser, sMode, cbInit, done)
}; };
/** /**
* readUserVolume(sPath, fd, aCHS, aAddr, done) * readUserVolume(sPath, fd, aCHS, aRequest, done)
* *
* aCHS is filled in as follows: * aCHS is filled in as follows:
* *
@ -416,7 +416,7 @@ HTTPAPI.openUserVolume = function(sPath, sMachine, sUser, sMode, cbInit, done)
* [2]: total sectors per track * [2]: total sectors per track
* [3]: total bytes per sector (generally 512) * [3]: total bytes per sector (generally 512)
* *
* aAddr is filled in as follows: * aRequest is filled in as follows:
* *
* [0]: 0-based cylinder number * [0]: 0-based cylinder number
* [1]: 0-based head number * [1]: 0-based head number
@ -426,13 +426,13 @@ HTTPAPI.openUserVolume = function(sPath, sMachine, sUser, sMode, cbInit, done)
* @param {string} sPath * @param {string} sPath
* @param {number} fd * @param {number} fd
* @param {Array.<number>} aCHS * @param {Array.<number>} aCHS
* @param {Array.<number>} aAddr * @param {Array.<number>} aRequest
* @param {function(nResponse:number,sResponse:string)} done * @param {function(nResponse:number,sResponse:string)} done
*/ */
HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done) HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aRequest, done)
{ {
var pos = (aAddr[0] * (aCHS[1] * aCHS[2] * aCHS[3])) + (aAddr[1] * (aCHS[2] * aCHS[3])) + ((aAddr[2] - 1) * aCHS[3]); var pos = (aRequest[0] * (aCHS[1] * aCHS[2] * aCHS[3])) + (aRequest[1] * (aCHS[2] * aCHS[3])) + ((aRequest[2] - 1) * aCHS[3]);
var len = (aAddr[3] * aCHS[3]); var len = (aRequest[3] * aCHS[3]);
HTMLOut.logDebug('HTMLOut.readUserVolume("' + sPath + '"): pos: ' + pos + ', len: ' + len); HTMLOut.logDebug('HTMLOut.readUserVolume("' + sPath + '"): pos: ' + pos + ', len: ' + len);
@ -462,7 +462,7 @@ HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done)
}; };
/** /**
* writeUserVolume(sPath, fd, aCHS, aAddr, sData, done) * writeUserVolume(sPath, fd, aCHS, aRequest, sData, done)
* *
* aCHS is filled in as follows: * aCHS is filled in as follows:
* *
@ -471,7 +471,7 @@ HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done)
* [2]: total sectors per track * [2]: total sectors per track
* [3]: total bytes per sector (generally 512) * [3]: total bytes per sector (generally 512)
* *
* aAddr is filled in as follows: * aRequest is filled in as follows:
* *
* [0]: 0-based cylinder number * [0]: 0-based cylinder number
* [1]: 0-based head number * [1]: 0-based head number
@ -481,14 +481,14 @@ HTTPAPI.readUserVolume = function(sPath, fd, aCHS, aAddr, done)
* @param {string} sPath * @param {string} sPath
* @param {number} fd * @param {number} fd
* @param {Array.<number>} aCHS * @param {Array.<number>} aCHS
* @param {Array.<number>} aAddr * @param {Array.<number>} aRequest
* @param {string} sData * @param {string} sData
* @param {function(nResponse:number,sResponse:string)} done * @param {function(nResponse:number,sResponse:string)} done
*/ */
HTTPAPI.writeUserVolume = function(sPath, fd, aCHS, aAddr, sData, done) HTTPAPI.writeUserVolume = function(sPath, fd, aCHS, aRequest, sData, done)
{ {
var pos = (aAddr[0] * (aCHS[1] * aCHS[2] * aCHS[3])) + (aAddr[1] * (aCHS[2] * aCHS[3])) + ((aAddr[2] - 1) * aCHS[3]); var pos = (aRequest[0] * (aCHS[1] * aCHS[2] * aCHS[3])) + (aRequest[1] * (aCHS[2] * aCHS[3])) + ((aRequest[2] - 1) * aCHS[3]);
var len = (aAddr[3] * aCHS[3]); var len = (aRequest[3] * aCHS[3]);
HTMLOut.logDebug('HTMLOut.writeUserVolume("' + sPath + '"): pos: ' + pos + ', len: ' + len); HTMLOut.logDebug('HTMLOut.writeUserVolume("' + sPath + '"): pos: ' + pos + ', len: ' + len);
@ -615,7 +615,7 @@ HTTPAPI.processDiskAPI = function(req, res)
* [2]: total sectors per track * [2]: total sectors per track
* [3]: total bytes per sector (generally 512) * [3]: total bytes per sector (generally 512)
* *
* aAddr is filled in as follows: * aRequest is filled in as follows:
* *
* [0]: 0-based cylinder number * [0]: 0-based cylinder number
* [1]: 0-based head number * [1]: 0-based head number
@ -623,7 +623,7 @@ HTTPAPI.processDiskAPI = function(req, res)
* [3]: sector count * [3]: sector count
*/ */
var aCHS = HTTPAPI.parseDiskValues(sCHS, [0, 0, 0, 512]); var aCHS = HTTPAPI.parseDiskValues(sCHS, [0, 0, 0, 512]);
var aAddr = HTTPAPI.parseDiskValues(sAddr, [0, 0, 0, 0]); var aRequest = HTTPAPI.parseDiskValues(sAddr, [0, 0, 0, 0]);
HTMLOut.logDebug('HTTPAPI.processDiskAPI("' + sPath + '"): action=' + sAction + ', chs=' + sCHS + ', addr=' + sAddr); HTMLOut.logDebug('HTTPAPI.processDiskAPI("' + sPath + '"): action=' + sAction + ', chs=' + sCHS + ', addr=' + sAddr);
@ -641,7 +641,7 @@ HTTPAPI.processDiskAPI = function(req, res)
case DiskAPI.ACTION.READ: case DiskAPI.ACTION.READ:
HTTPAPI.openUserVolume(sPath, sMachine, sUser, sMode, cbInit, function(nResponse, sResponse, fd) { HTTPAPI.openUserVolume(sPath, sMachine, sUser, sMode, cbInit, function(nResponse, sResponse, fd) {
if (fd) { if (fd) {
HTTPAPI.readUserVolume(sPath, fd, aCHS, aAddr, function(nResponse, sResponse) { HTTPAPI.readUserVolume(sPath, fd, aCHS, aRequest, function(nResponse, sResponse) {
/* /*
* Without the addition of "no-store", Chrome will assume that a previous response to * Without the addition of "no-store", Chrome will assume that a previous response to
* a previously seen URL can be re-used without hitting the server again, which would be * a previously seen URL can be re-used without hitting the server again, which would be
@ -661,7 +661,7 @@ HTTPAPI.processDiskAPI = function(req, res)
case DiskAPI.ACTION.WRITE: case DiskAPI.ACTION.WRITE:
HTTPAPI.openUserVolume(sPath, sMachine, sUser, sMode, cbInit, function(nResponse, sResponse, fd) { HTTPAPI.openUserVolume(sPath, sMachine, sUser, sMode, cbInit, function(nResponse, sResponse, fd) {
if (fd) { if (fd) {
HTTPAPI.writeUserVolume(sPath, fd, aCHS, aAddr, sData, function(nResponse, sResponse) { HTTPAPI.writeUserVolume(sPath, fd, aCHS, aRequest, sData, function(nResponse, sResponse) {
res.status(nResponse).send(sResponse); res.status(nResponse).send(sResponse);
}); });
} else { } else {

View file

@ -2986,8 +2986,15 @@ ChipSet.prototype.advanceDMA = function(channel, fInit)
if (!channel.masked) { if (!channel.masked) {
chipset.bus.setByte(addrCur, b); chipset.bus.setByte(addrCur, b);
if (BACKTRACK) { if (BACKTRACK) {
if (!off && obj.file && chipset.messageEnabled(Messages.DISK)) { if (!off && obj.file) {
chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true); if (chipset.messageEnabled(Messages.DISK)) {
chipset.printMessage("loading " + obj.file.sPath + '[' + obj.offFile + "] at %" + str.toHex(addrCur), true);
}
/*
if (obj.file.sPath == "\\SYSBAS.EXE" && obj.offFile == 512) {
chipset.cpu.stopCPU();
}
*/
} }
bto = chipset.bus.addBackTrackObject(obj, bto, off); bto = chipset.bus.addBackTrackObject(obj, bto, off);
chipset.bus.writeBackTrackObject(addrCur, bto, off); chipset.bus.writeBackTrackObject(addrCur, bto, off);
@ -4411,14 +4418,14 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
break; break;
/* /*
* This case is reserved for command bytes that the 8042 is not expecting, which should therefore be passed on * This case is reserved for command bytes that the 8042 is not expecting, which should therefore be passed
* to the Keyboard itself. * on to the Keyboard itself.
* *
* Here's some relevant MODEL_5170 ROM BIOS code, "XMIT_8042" (missing from the original MODEL_5170 ROM BIOS listing), * Here's some relevant MODEL_5170 ROM BIOS code, "XMIT_8042" (missing from the original MODEL_5170 ROM BIOS
* which sends a command code in AL to the Keyboard and waits for a response, returning it in AL. Note that * listing), which sends a command code in AL to the Keyboard and waits for a response, returning it in AL.
* the only "success" exit path from this function involves LOOPing 64K times before finally reading the Keyboard's * Note that the only "success" exit path from this function involves LOOPing 64K times before finally reading
* response; either the hardware and/or this code seems a bit brain-damaged if that's REALLY what you had to do to ensure * the Keyboard's response; either the hardware and/or this code seems a bit brain-damaged if that's REALLY
* a valid response.... * what you had to do to ensure a valid response....
* *
* F000:1B25 86E0 XCHG AH,AL * F000:1B25 86E0 XCHG AH,AL
* F000:1B27 2BC9 SUB CX,CX * F000:1B27 2BC9 SUB CX,CX
@ -4453,9 +4460,9 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
* F000:1B62 83E901 SUB CX,0001 ; EXIT WITH SUCCESS (CX != 0) * F000:1B62 83E901 SUB CX,0001 ; EXIT WITH SUCCESS (CX != 0)
* F000:1B65 C3 RET * F000:1B65 C3 RET
* *
* But WAIT, the FUN doesn't end there. After this function returns, "KBD_RESET" waits for a Keyboard interrupt * But WAIT, the FUN doesn't end there. After this function returns, "KBD_RESET" waits for a Keyboard
* to occur, hoping for scan code 0xAA as the Keyboard's final response. "KBD_RESET" also returns CX to the caller, * interrupt to occur, hoping for scan code 0xAA as the Keyboard's final response. "KBD_RESET" also returns
* and the caller ("TEST.21") assumes there was no interrupt if CX is zero. * CX to the caller, and the caller ("TEST.21") assumes there was no interrupt if CX is zero.
* *
* MOV AL,0FDH * MOV AL,0FDH
* OUT INTA01,AL * OUT INTA01,AL
@ -4470,9 +4477,9 @@ ChipSet.prototype.out8042InBuffData = function(port, bOut, addrFrom)
* JNZ G11 * JNZ G11
* ... * ...
* *
* However, if [INTR_FLAG] is set immediately, the above code will exit immediately, without ever decrementing CX. * However, if [INTR_FLAG] is set immediately, the above code will exit immediately, without ever decrementing
* CX can be zero not only if the loop exhausted it, but also if no looping was required; the latter is not an * CX. CX can be zero not only if the loop exhausted it, but also if no looping was required; the latter is not
* error, but "TEST.21" assumes that it is. * an error, but "TEST.21" assumes that it is.
*/ */
default: default:
this.set8042CmdData(this.b8042CmdData & ~ChipSet.KBC.DATA.CMD.NO_CLOCK); this.set8042CmdData(this.b8042CmdData & ~ChipSet.KBC.DATA.CMD.NO_CLOCK);

View file

@ -794,20 +794,12 @@ FileInfo.prototype.getSymbol = function(off, fNearest)
* iCylinder: number, * iCylinder: number,
* iHead: number, * iHead: number,
* iModify: number, * iModify: number,
* cModify: number * cModify: number,
* file: FileInfo,
* offFile: number
* }} * }}
*/ */
var SectorData; var SectorInfo;
/**
* @class SectorInfo
* @property {number} 0 contains iCylinder
* @property {number} 1 contains iHead
* @property {number} 2 contains iSector
* @property {number} 3 contains nSectors
* @property {boolean} 4 contains fAsync
* @property {function(nErrorCode:number,fAsync:boolean)} 5 contains done
*/
/** /**
* initBus(cmp, bus, cpu, dbg) * initBus(cmp, bus, cpu, dbg)
@ -1923,7 +1915,7 @@ Disk.prototype.getSectorString = function(sector, off, len)
* Like getSector(), this must convert a PBA into CHS values; consider factoring that conversion code out. * Like getSector(), this must convert a PBA into CHS values; consider factoring that conversion code out.
* *
* @this {Disk} * @this {Disk}
* @param {Object} file * @param {FileInfo} file
* @param {number} pba (physical block address from the file's apba) * @param {number} pba (physical block address from the file's apba)
* @param {number} off (file offset corresponding to the given pba of the given file) * @param {number} off (file offset corresponding to the given pba of the given file)
* @return {boolean} true if successfully updated, false if not * @return {boolean} true if successfully updated, false if not
@ -2047,22 +2039,22 @@ Disk.prototype.readRemoteSectors = function(iCylinder, iHead, iSector, nSectors,
}; };
/** /**
* doneReadRemoteSectors(sURLName, sURLData, nErrorCode, sectorInfo) * doneReadRemoteSectors(sURLName, sURLData, nErrorCode, aRequest)
* *
* @this {Disk} * @this {Disk}
* @param {string} sURLName * @param {string} sURLName
* @param {string} sURLData * @param {string} sURLData
* @param {number} nErrorCode * @param {number} nErrorCode
* @param {Array} sectorInfo * @param {Array} aRequest ([iCylinder, iHead, iSector, nSectors, fAsync, done])
*/ */
Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode, sectorInfo) Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode, aRequest)
{ {
var fAsync = false; var fAsync = false;
var iCylinder = sectorInfo[0]; var iCylinder = aRequest[0];
var iHead = sectorInfo[1]; var iHead = aRequest[1];
var iSector = sectorInfo[2]; var iSector = aRequest[2];
var nSectors = sectorInfo[3]; var nSectors = aRequest[3];
if (!nErrorCode) { if (!nErrorCode) {
var abData = JSON.parse(sURLData); var abData = JSON.parse(sURLData);
@ -2092,13 +2084,13 @@ Disk.prototype.doneReadRemoteSectors = function(sURLName, sURLData, nErrorCode,
*/ */
iSector++; iSector++;
} }
fAsync = sectorInfo[4]; fAsync = aRequest[4];
} else { } else {
if (DEBUG && this.messageEnabled()) { if (DEBUG && this.messageEnabled()) {
this.printMessage("doneReadRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ") returned error " + nErrorCode); this.printMessage("doneReadRemoteSectors(CHS=" + iCylinder + ':' + iHead + ':' + iSector + ",N=" + nSectors + ") returned error " + nErrorCode);
} }
} }
var done = sectorInfo[5]; var done = aRequest[5];
if (done) done(nErrorCode, fAsync); if (done) done(nErrorCode, fAsync);
}; };
@ -2149,21 +2141,21 @@ Disk.prototype.writeRemoteSectors = function(iCylinder, iHead, iSector, nSectors
}; };
/** /**
* doneWriteRemoteSectors(sURLName, sURLData, nErrorCode, sectorInfo) * doneWriteRemoteSectors(sURLName, sURLData, nErrorCode, aRequest)
* *
* @this {Disk} * @this {Disk}
* @param {string} sURLName * @param {string} sURLName
* @param {string} sURLData * @param {string} sURLData
* @param {number} nErrorCode * @param {number} nErrorCode
* @param {Array} sectorInfo * @param {Array} aRequest ([iCylinder, iHead, iSector, nSectors, fAsync])
*/ */
Disk.prototype.doneWriteRemoteSectors = function(sURLName, sURLData, nErrorCode, sectorInfo) Disk.prototype.doneWriteRemoteSectors = function(sURLName, sURLData, nErrorCode, aRequest)
{ {
var iCylinder = sectorInfo[0]; var iCylinder = aRequest[0];
var iHead = sectorInfo[1]; var iHead = aRequest[1];
var iSector = sectorInfo[2]; var iSector = aRequest[2];
var nSectors = sectorInfo[3]; var nSectors = aRequest[3];
var fAsync = sectorInfo[4]; var fAsync = aRequest[4];
this.fWriteInProgress = false; this.fWriteInProgress = false;
if (iCylinder >= 0 && iCylinder < this.aDiskData.length && iHead >= 0 && iHead < this.aDiskData[iCylinder].length) { if (iCylinder >= 0 && iCylinder < this.aDiskData.length && iHead >= 0 && iHead < this.aDiskData[iCylinder].length) {