Create separate IPL entry for each CD/DVD
[seabios.git] / src / cdrom.c
index 349e401bbd65346bcc3a3291906df47477f7fcdb..31ceaaaa86fb3ee7f8f5ae4f217a0c54e4b5d9c9 100644 (file)
@@ -241,12 +241,13 @@ atapi_is_ready(struct disk_op_s *op)
 }
 
 int
-cdrom_boot(int cdid)
+cdrom_boot(struct drive_s *drive_g)
 {
     struct disk_op_s dop;
+    int cdid = getDriveId(EXTTYPE_CD, drive_g);
     memset(&dop, 0, sizeof(dop));
-    dop.drive_g = getDrive(EXTTYPE_CD, cdid);
-    if (!dop.drive_g)
+    dop.drive_g = drive_g;
+    if (!dop.drive_g || cdid < 0)
         return 1;
 
     int ret = atapi_is_ready(&dop);