Enable ata1 under Bochs if hdc or hdd is needed.
[pintos-anon] / src / utils / pintos
index 867f2c1c056348866aaad710edc456425fe263d5..a2168d225dc5405c1eea49bcb3e731f29f096f7c 100755 (executable)
@@ -51,7 +51,7 @@ while (@ARGV) {
        copy_pad ($hostfn, "scratch.dsk", 512);
 
        # Do copy.
-       run_vm ("-ci", $hostfn, $size, "-q");
+       run_vm ("-ci", $guestfn, $size, "-q");
        exit 0;
     } elsif ($arg eq 'get') {
        usage () if @ARGV != 1 && @ARGV != 2;
@@ -164,6 +164,8 @@ sub run_vm {
        print BOCHSRC "vgaromimage: $vgaromimage\n";
        print BOCHSRC bochs_disk_line ("ata0-master", $disks[0]);
        print BOCHSRC bochs_disk_line ("ata0-slave", $disks[1]);
+       print BOCHSRC "ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15\n"
+           if defined ($disks[2]) || defined ($disks[3]);
        print BOCHSRC bochs_disk_line ("ata1-master", $disks[2]);
        print BOCHSRC bochs_disk_line ("ata1-slave", $disks[3]);
        print BOCHSRC "boot: c\n";
@@ -284,7 +286,7 @@ sub bochs_disk_line {
     return "" if !defined $file;
     my (%geom) = disk_geometry ($file);
     return "$device: type=disk, path=$file, mode=flat, "
-       . " cylinders=$geom{C}, heads=$geom{H}, spt=$geom{S}, "
+       . "cylinders=$geom{C}, heads=$geom{H}, spt=$geom{S}, "
        . "translation=none\n";
 }