Core: fix the hybride mode detection code
authorLiu Aleaxander <Aleaxander@gmail.com>
Mon, 13 Jul 2009 07:56:51 +0000 (15:56 +0800)
committerLiu Aleaxander <Aleaxander@gmail.com>
Mon, 13 Jul 2009 07:56:51 +0000 (15:56 +0800)
core/diskio.c
core/isolinux.asm

index 90dccbe..cbd9305 100644 (file)
@@ -246,15 +246,6 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start,
     bool ebios = cdrom;
     int sector_size = cdrom ? 2048 : 512;
 
-    /*
-     * set the size be 512 when we are in iso_hybrid mode. 
-     * we estimate  it by the devno, As far as I know, the 
-     * cdrom will use 0xe0 and above as the devno, well I'm
-     * not sure it's right or not.
-     */
-    if (devno < 0xe0)
-        sector_size = 512;
-
     memset(&ireg, 0, sizeof ireg);
 
     /* Get EBIOS support */
index 4b11b43..f369e59 100644 (file)
@@ -1168,7 +1168,13 @@ all_read:
                extern iso_fs_ops
                mov eax,iso_fs_ops
                mov dl,[DriveNumber]
-               mov dh,1                  ; it's cdrom
+                       cmp word [BIOSType],bios_cdrom
+                jne hybrid
+                mov dh,1                  ; it's cdrom
+                jmp end
+hybrid:
+                mov dh,0                  ; it's in hybrid mode
+end:
                mov ecx,[bsHidden]
                mov ebx,[bsHidden+4]
                 mov si,[bsHeads]