[syslinux] [PATCH] core: Incorrect detection of EDD in /core/fs/diskio_bios.c

Andy Alex andy at r-tt.com
Sun Feb 23 11:16:52 PST 2014


I agree. This line was removed during testing because it didn't make big 
sense (EFLAGS_CF, ebx, and ecx are checked after int 0x13).
But it's better to leave it in code to make sure that BIOS conforms 
standards and clears CF flag on successful call.
Adjusted patch is given below.

Andy Alex

Signed-off-by: Andy Alex <andy at r-tt.com>
---
diff -uprN syslinux-6.02.orig/core/fs/diskio_bios.c 
syslinux-6.02/core/fs/diskio_bios.c
--- syslinux-6.02.orig/core/fs/diskio_bios.c    2013-10-13 
13:59:03.000000000 -0400
+++ syslinux-6.02/core/fs/diskio_bios.c    2014-02-23 14:04:17.876084866 
-0500
@@ -337,6 +337,7 @@ struct disk *bios_disk_init(void *privat
      /* Get EBIOS support */
      ireg.eax.b[1] = 0x41;
      ireg.ebx.w[0] = 0x55aa;
+    ireg.edx.b[0] = devno;
      ireg.eflags.b[0] = 0x3;    /* CF set */

      __intcall(0x13, &ireg, &oreg);
@@ -353,6 +354,7 @@ struct disk *bios_disk_init(void *privat
          edd_params.len = sizeof edd_params;

          ireg.eax.b[1] = 0x48;
+        ireg.edx.b[0] = devno;
          ireg.ds = SEG(&edd_params);
          ireg.esi.w[0] = OFFS(&edd_params);
          __intcall(0x13, &ireg, &oreg);
---


On 22.02.2014 16:59, Geert Stappers wrote:
> Op 2014-02-20 om 13:23 schreef Andy Alex:
>> DL register is not set to drive number when detecting EDD for drive, so detection may fail.
>>
>> Signed-off-by: Andy Alex<andy at r-tt.com>
>> ---
>> diff -uprN syslinux-6.02.orig/core/fs/diskio_bios.c syslinux-6.02/core/fs/diskio_bios.c
>> --- syslinux-6.02.orig/core/fs/diskio_bios.c	2013-10-13 21:59:03.000000000 +0400
>> +++ syslinux-6.02/core/fs/diskio_bios.c	2014-02-20 12:15:08.000000000 +0400
>> @@ -337,7 +337,7 @@ struct disk *bios_disk_init(void *privat
>>   	/* Get EBIOS support */
>>   	ireg.eax.b[1] = 0x41;
>>   	ireg.ebx.w[0] = 0x55aa;
>> -	ireg.eflags.b[0] = 0x3;	/* CF set */
> I don't understand where the removal of that line matches
> with 'DL register is not set' from the description of this patch.
>
>
>> +        ireg.edx.b[0] = devno;
>>
>>   	__intcall(0x13,&ireg,&oreg);
>>   	
>> @@ -353,6 +353,7 @@ struct disk *bios_disk_init(void *privat
>>   	    edd_params.len = sizeof edd_params;
>>
>>   	    ireg.eax.b[1] = 0x48;
>> +            ireg.edx.b[0] = devno;
>>   	    ireg.ds = SEG(&edd_params);
>>   	    ireg.esi.w[0] = OFFS(&edd_params);
>>   	    __intcall(0x13,&ireg,&oreg);
>>
>
>
> Groeten
> Geert Stappers


More information about the Syslinux mailing list