diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c
-index bb1c8e7..b2a5627 100644
+index bb1c8e7..8157e33 100644
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
-@@ -3702,8 +3702,9 @@ static char eltorito[24]="EL TORITO SPECIFICATION";
+@@ -755,6 +755,7 @@ typedef struct {
+ #if BX_ELTORITO_BOOT
+ // El Torito Emulation data
+ cdemu_t cdemu;
++ Bit8u boot_cdrom_device;
+ #endif // BX_ELTORITO_BOOT
+ } ebda_data_t;
+
+@@ -3702,8 +3703,9 @@ static char eltorito[24]="EL TORITO SPECIFICATION";
//
// Returns ah: emulated drive, al: error code
//
{
Bit16u ebda_seg=read_word(0x0040,0x000E);
Bit8u atacmd[12], buffer[2048];
-@@ -3713,7 +3714,8 @@ cdrom_boot()
+@@ -3713,12 +3715,15 @@ cdrom_boot()
// Find out the first cdrom
for (device=0; device<BX_MAX_ATA_DEVICES;device++) {
}
// if not found
-@@ -8330,7 +8332,9 @@ ASM_END
+ if(device >= BX_MAX_ATA_DEVICES) return 2;
+
++ write_byte(ebda_seg,&EbdaData->boot_cdrom_device,device);
++
+ if(error = atapi_is_ready(device) != 0)
+ BX_INFO("ata_is_ready returned %d\n",error);
+
+@@ -5861,7 +5866,11 @@ int13_cdrom(EHBX, DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
+ }
+
+ // Get the ata channel
+- device=read_byte(ebda_seg,&EbdaData->ata.cdidmap[GET_ELDL()-0xE0]);
++ if (GET_ELDL() == 0xE0) {
++ device=read_byte(ebda_seg,&EbdaData->boot_cdrom_device);
++ } else {
++ device=read_byte(ebda_seg,&EbdaData->ata.cdidmap[GET_ELDL()-0xE0]);
++ }
+
+ /* basic check : device has to be valid */
+ if (device >= BX_MAX_ATA_DEVICES) {
+@@ -8330,7 +8339,9 @@ ASM_END
#if BX_ELTORITO_BOOT
case IPL_TYPE_CDROM: /* CD-ROM */