]> xenbits.xen.org Git - xenclient/xen-pq.git/commitdiff
Allow boot from second cdrom:wq
authorJames Mckenzie <jamesmck@bob.uk.xensource.com>
Mon, 7 Sep 2009 15:30:09 +0000 (16:30 +0100)
committerJames Mckenzie <jamesmck@bob.uk.xensource.com>
Mon, 7 Sep 2009 15:30:09 +0000 (16:30 +0100)
master/boot-second-cd [new file with mode: 0644]

diff --git a/master/boot-second-cd b/master/boot-second-cd
new file mode 100644 (file)
index 0000000..3a37ad7
--- /dev/null
@@ -0,0 +1,43 @@
+diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c
+index bb1c8e7..3baf417 100644
+--- a/tools/firmware/rombios/rombios.c
++++ b/tools/firmware/rombios/rombios.c
+@@ -960,7 +960,7 @@ void   cdemu_init();
+ Bit8u  cdemu_isactive();
+ Bit8u  cdemu_emulated_drive();
+-Bit16u cdrom_boot();
++Bit16u cdrom_boot(Bit16u);
+ #endif // BX_ELTORITO_BOOT
+@@ -3703,7 +3703,7 @@ static char eltorito[24]="EL TORITO SPECIFICATION";
+ // Returns ah: emulated drive, al: error code
+ //
+   Bit16u
+-cdrom_boot()
++cdrom_boot(Bit16u which)
+ {
+   Bit16u ebda_seg=read_word(0x0040,0x000E);
+   Bit8u  atacmd[12], buffer[2048];
+@@ -3713,7 +3713,8 @@ cdrom_boot()
+   // Find out the first cdrom
+   for (device=0; device<BX_MAX_ATA_DEVICES;device++) {
+-    if (atapi_is_cdrom(device)) break;
++    if (atapi_is_cdrom(device)) 
++      if (!(which--)) break;
+     }
+   // if not found
+@@ -8330,7 +8331,9 @@ ASM_END
+ #if BX_ELTORITO_BOOT
+   case IPL_TYPE_CDROM: /* CD-ROM */
+-    status = cdrom_boot();
++    status = cdrom_boot(0);
++    if ((status & 0x00ff)!=0)
++    status = cdrom_boot(1);
+     // If failure
+     if ( (status & 0x00ff) !=0 ) {