Added new IBM PC AT configuration (8Mhz model, currently not booting)

This commit is contained in:
Jeff Parsons 2014-10-13 12:16:27 -07:00 committed by jeffpar
commit 093099d980
38 changed files with 3848 additions and 1558 deletions

View file

@ -579,8 +579,20 @@ DiskDump.updateManifest = function(disk, sManifestFile, sDiskPath, sOutputFile,
} else if (disk.fDir === undefined) {
sParm = "img";
}
var sXMLDisk = '\t<disk id="' + sIDDisk + '"' + (sParm? ' ' + sParm + '="' + sDiskPath + '"' : '') + ' href="' + sOutputFile + '"' + (md5Disk? ' md5="' + md5Disk + '"' : '') + (md5JSON? ' md5json="' + md5JSON + '"' : '') + '>\n';
sName = null;
/*
* Build a "size" attribute with the total disk size in bytes and a "chs" attribute that describes the disk geometry; eg:
*
* size="368640" chs="40:2:9"
*/
var size = 0, sCHS = "";
if (disk.dataDisk) {
sCHS = disk.dataDisk.length + ':' + disk.dataDisk[0].length + ':' + disk.dataDisk[0][0].length;
size = disk.dataDisk.length * disk.dataDisk[0].length * disk.dataDisk[0][0].length * disk.dataDisk[0][0][0].length;
}
var sXMLDisk = '\t<disk id="' + sIDDisk + '"' + (size? ' size="' + size + '"' : '') + (sCHS? ' chs="' + sCHS + '"' : '') + (sParm? ' ' + sParm + '="' + sDiskPath + '"' : '') + ' href="' + sOutputFile + '"' + (md5Disk? ' md5="' + md5Disk + '"' : '') + (md5JSON? ' md5json="' + md5JSON + '"' : '') + '>\n';
sName = "";
if (sMatchDisk && (match = sMatchDisk.match(/<name>([^>]*)<\/name>/))) {
sName = match[1];
}
@ -2103,7 +2115,7 @@ 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
* 0xE9 is JMP with a 2-byte displacement). What else?
*/
if ((bByte0 == X86.OPCODE.JMP16 || bByte0 == X86.OPCODE.JMP8) && cbSectorBPB == cbSector) {
if ((bByte0 == X86.OPCODE.JMP || bByte0 == X86.OPCODE.JMPS) && cbSectorBPB == cbSector) {
var nHeadsBPB = this.bufDisk.readUInt16LE(offBootSector + DiskDump.BPB.HEAD_TOTAL);
var nSectorsTotalBPB = this.bufDisk.readUInt16LE(offBootSector + DiskDump.BPB.SECTOR_TOTAL);
var nSectorsPerTrackBPB = this.bufDisk.readUInt16LE(offBootSector + DiskDump.BPB.TRACK_SECS);
@ -2581,7 +2593,7 @@ DiskDump.prototype.convertToIMG = function()
*/
var bByte0 = buf.readUInt8(DiskDump.BPB.JMP_OPCODE);
var cbSectorBPB = buf.readUInt16LE(DiskDump.BPB.SECTOR_BYTES);
if ((bByte0 == X86.OPCODE.JMP16 || bByte0 == X86.OPCODE.JMP8) && cbSectorBPB == 512) {
if ((bByte0 == X86.OPCODE.JMP || bByte0 == X86.OPCODE.JMPS) && cbSectorBPB == 512) {
/*
* Overwrite the OEM string with our own, so that people know how the image originated
*/

View file

@ -81,6 +81,10 @@ FileDump.sCopyright = "© 2012-2014 by Jeff Parsons (@jeffpar)";
FileDump.sNotice = FileDump.sAPIURL + " " + FileDump.sCopyright;
FileDump.sUsage = "Usage: " + FileDump.sAPIURL + "?" + DumpAPI.QUERY.FILE + "=({path}|{URL})&" + DumpAPI.QUERY.FORMAT + "=(json|data|hex|bytes|rom)";
FileDump.asBadExts = [
"js", "log"
];
/*
* Class methods
*/
@ -134,8 +138,8 @@ FileDump.CLI = function()
var argv = args.argv;
var sFile = argv['file'];
if (!sFile) {
FileDump.logError(new Error("no filename specified"));
if (!sFile || FileDump.asBadExts.indexOf(str.getExtension(sFile)) >= 0) {
FileDump.logError(new Error("bad or missing input filename"));
return;
}

View file

@ -1043,7 +1043,7 @@ ChipSet.prototype.reset = function()
this.abDMAPageSpare = new Array(7);
this.bCMOSAddr = 0; // NMI is enabled, since the ChipSet.CMOS.ADDR.NMI_DISABLE bit is not set in bCMOSAddr
/*
* Now that we call reset() from the ChipSet constructor, enabling other components can to update
* their CMOS information, we must not allow a reset() from powerUp() to toss that information, so
@ -1051,8 +1051,9 @@ ChipSet.prototype.reset = function()
*/
if (!this.abCMOSData) {
this.abCMOSData = new Array(ChipSet.CMOS.ADDR.TOTAL);
this.initRTCDate(this.sRTCDate);
}
this.initRTCDate(this.sRTCDate);
/*
* initCMOSData() will initialize a variety of "legacy" CMOS bytes, but it will NOT overwrite any memory

View file

@ -272,7 +272,8 @@ Component.assert = function(f, s)
/*
* TODO: An accompanying source file/line number/function call would be nice, if there was a browser-independent way....
*/
Component.log(s || "assertion failure");
if (!s) s = "assertion failure";
Component.log(s);
throw new Error(s);
}
}