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

H. Peter Anvin hpa at zytor.com
Thu Apr 30 07:45:27 PDT 2009


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...

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfxboot.patch
Type: text/x-patch
Size: 3671 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20090430/543578ca/attachment.bin>


More information about the Syslinux mailing list