[syslinux] gpllib write_sectors() patch

H. Peter Anvin hpa at zytor.com
Wed Apr 28 11:53:26 PDT 2010


On 04/27/2010 10:15 AM, Don Hiatt wrote:
> Here is a partial patch that I'm using to illustrate a few questions
> that I have.
> 
> Looking at the gpllib write_sectors (com32/gpllib/disk/write.c) it
> looks like the allocated
> size is wrong; size is in sectors so we should adjust the alloc/memcpy
> by size*SECTOR.
> 
> Also, comparing core/diskio.c it looks like the registers aren't even
> setup right. In the patch below I put an #if 0 around the old code to demonstrate
> how it differs from diskio.c

In doing that, you rather defeat the purpose of a diff, and so it's a
lot harder to read.

>         dapa->lba = lba;
> -
> +#if 0
>         inreg.esi.w[0] = OFFS(dapa);
>         inreg.ds = SEG(dapa);
>         inreg.edx.b[0] = drive_info->disk;
>         inreg.eax.w[0] = 0x4300;        /* Extended write */
> +#endif
> +       inreg.eax.b[1] = 0x43;
> +       inreg.edx.b[0] = drive_info->disk;
> +       inreg.ds       = SEG(dapa);
> +       inreg.esi.w[0] = OFFS(dapa);
> +
> 

The only difference (other than a gratuitous reshuffling) that I see is
the value of AL, which *should* be cleared: AL is a subfunction
identifier for type 0x43.

	-hpa




More information about the Syslinux mailing list