Skip to content

Commit

Permalink
Fix booting from cd while hda present, booting from hda while cd present
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeOsborn committed Aug 18, 2023
1 parent b8a39b1 commit 65ef743
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 118 deletions.
3 changes: 3 additions & 0 deletions debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ <h4>Debugger</h4>

<input type="button" value="MS-DOS" id="start_msdos">
<input type="button" value="FreeDOS" id="start_freedos">
<input type="button" value="FreeDOS Live" id="start_freedos-live">
<input type="button" value="FreeDOS 13" id="start_freedos-13">
<input type="button" value="Debian Wheezy" id="start_debian-wheezy">
<input type="button" value="FreeDOS with FreeGEM" id="start_freegem">
<input type="button" value="FreeDOS CD with games" id="start_fdgame">
<input type="button" value="FreeDOS with QBasic" id="start_qbasic">
Expand Down
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ <h4>Select profile</h4>
With Enhanced Tools, QBasic, vim, games and demos.</td></tr>
<tr id="start_freedos"><td><a href="?profile=freedos">FreeDOS</a> <small>0.5 MB</small></td><td>
With nasm, vim, debug.com, Rogue, some games and demos.</td></tr>
<tr id="start_freedoslive"><td><a href="?profile=freedos-live">FreeDOS Live</a> <small>400 MB</small></td><td>
With nasm, vim, debug.com, Rogue, some games and demos.</td></tr>
<tr id="start_freedos13"><td><a href="?profile=freedos-13">FreeDOS 13</a> <small>2 GB</small></td><td>
A full freedos install.</td></tr>

<tr id="start_freebsd"><td><a href="?profile=freebsd">FreeBSD</a> <small>17 MB</small></td><td>
FreeBSD 12.0 base install. Restored from snapshot.</td></tr>
Expand Down
52 changes: 51 additions & 1 deletion src/browser/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@
size: 8 * 1024 * 1024,
async: false,
},
cdrom: {
url: host + "msdos.img",
size: 8 * 1024 * 1024,
async: false,
},
fda: {
url: host + "freedos722.img",
async: false,
},
boot_order: 0x132,
name: "MS-DOS",
},
Expand All @@ -355,6 +364,32 @@
},
name: "FreeDOS",
},
{
id: "freedos-live",
cdrom: {
url: host + "FD13LIVE.iso",
async: false,
},
name: "FreeDOS-Live",
},
{
id: "freedos-13",
hda: {
url: host + "freedos13.img",
async: false,
},
name: "FreeDOS 13",
boot_order: 0x312
},
{
id: "debian-wheezy",
hda: {
url: host + "debian_wheezy.img",
async: false,
},
name: "Debian Wheezy",
boot_order: 0x312
},
{
id: "psychdos",
hda: {
Expand Down Expand Up @@ -392,6 +427,10 @@
size: 6547456,
async: false,
},
fda: {
url: host + "freedos722.img",
async: false,
},
name: "Linux",
},
{
Expand Down Expand Up @@ -585,7 +624,7 @@
hda: {
url: host + "windows2k.img",
size: 2 * 1024 * 1024 * 1024,
async: true,
async: false,
fixed_chunk_size: 256 * 1024,
use_parts: !ON_LOCALHOST,
},
Expand Down Expand Up @@ -695,6 +734,12 @@
url: host + "Win30.iso",
async: false,
},
hda: {
url: host + "win31.img",
async: false,
size: 34463744,
},
boot_order: 0x213,
name: "Windows 3.0",
},
{
Expand All @@ -705,7 +750,12 @@
async: false,
size: 34463744,
},
cdrom: {
url: host + "Win30.iso",
async: false,
},
name: "Windows 3.1",
boot_order: 0x312
},
{
id: "freebsd",
Expand Down
6 changes: 3 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ var DUMP_UNCOMPILED_ASSEMBLY = false;
*/
var TRACK_FILENAMES = false;

var LOG_LEVEL = LOG_ALL & ~LOG_PS2 & ~LOG_PIT & ~LOG_VIRTIO & ~LOG_9P & ~LOG_PIC &
~LOG_DMA & ~LOG_SERIAL & ~LOG_NET & ~LOG_FLOPPY & ~LOG_DISK & ~LOG_VGA & ~LOG_SB16;

// var LOG_LEVEL = LOG_ALL & ~LOG_PS2 & ~LOG_PIT & ~LOG_VIRTIO & ~LOG_9P & ~LOG_PIC &
// ~LOG_DMA & ~LOG_SERIAL & ~LOG_NET & ~LOG_FLOPPY & ~LOG_DISK & ~LOG_VGA & ~LOG_SB16;
var LOG_LEVEL = LOG_PCI | LOG_IO | LOG_DISK;
/**
* @const
* Draws entire buffer and visualizes the layers that would be drawn
Expand Down
5 changes: 1 addition & 4 deletions src/cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,10 +876,7 @@ CPU.prototype.init = function(settings, device_bus)
this.devices.hda = new IDEDevice(this, settings.hda, settings.hdb, false, ide_device_count++, device_bus);
}

if(settings.cdrom)
{
this.devices.cdrom = new IDEDevice(this, settings.cdrom, undefined, true, ide_device_count++, device_bus);
}
this.devices.cdrom = new IDEDevice(this, settings.cdrom, undefined, true, ide_device_count++, device_bus);

this.devices.pit = new PIT(this, device_bus);

Expand Down
Loading

0 comments on commit 65ef743

Please sign in to comment.