[syslinux] [1/1] [gfxboot] align buffer used to read data from disk to a 512 byte boundary

Sebastian Herbszt herbszt at gmx.de
Fri May 1 11:01:19 PDT 2009


H. Peter Anvin wrote:
> [Apologies for the resend]
> 
> Christophe Fergeau wrote:
>> The COM API provides a function to read from disk (int 22h, AX=07h)
>> which needs a destination buffer aligned on a 512 byte boundary. gfxboot
>> uses this function but doesn't ensure its data buffer is properly
>> aligned. This leads to failures on a few machines (HP Pavillion dv5):
>> 
>> gfxboot:
>> isolinux: Disk error 09, AX = 424F, drive FE
>> 
>> https://qa.mandriva.com/show_bug.cgi?id=48814 has a bit more details.
>> This patch just makes sure the buffer used to read from disk is properly
>> aligned, this fixes the boot failures on the aforementioned machines.
> 
> The data segment isn't directly aligned, so this won't work.
> Furthermore, there is no reason for this stuff to be in the .data
> segment; I was rather shocked to find out that 90% of gfxboot.com is
> empty space caused by putting temporary buffers in the .data segment.
> 
> This patch handles the alignment, and also moves as many
> all-zero-initialized variables as I felt safe to into the .bss section.
> 
> I have not tested this at all, so I have no idea if I clobbered anything
> important.  This patch should be reviewed by someone who knows what the
> heck the code is doing...
> 
> Note also the resulting difference in size of gfxboot.com.
> 
> -hpa
> 

Acked-by: Sebastian Herbszt <herbszt at gmx.de>

Too bad all my previous testing didn't reveal this alignment problem. With this
patch applied the module still works fine here with syslinux, isolinux and pxelinux.

- Sebastian




More information about the Syslinux mailing list