aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-01-21 21:36:52 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-01-21 21:38:50 -0800
commit8f189531a58aef0655cd04a620931da3a0157eaa (patch)
treeff0e2832725fb9dc0afe19d474942138151cf9e4
parent10bc1d024e41c545ddd2a820e6da656e4f4b0f4b (diff)
downloadsyslinux-8f189531a58aef0655cd04a620931da3a0157eaa.tar.gz
syslinux-8f189531a58aef0655cd04a620931da3a0157eaa.tar.xz
syslinux-8f189531a58aef0655cd04a620931da3a0157eaa.zip
core/diskio: correct the EDD parameter query
We need to tell the BIOS how big of a buffer we have for the EDD parameter query. This caused us to *never* use EDD, which meant that large filesystems never worked. Reported-by: Gert Hulselmans <kimmik999999@yahoo.co.uk> Isolated-by: Alek Du <alek.du@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/diskio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/diskio.c b/core/diskio.c
index 911e4ddf..eddcd8d8 100644
--- a/core/diskio.c
+++ b/core/diskio.c
@@ -254,14 +254,20 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start,
if (cdrom || (!(oreg.eflags.l & EFLAGS_CF) &&
oreg.ebx.w[0] == 0xaa55 && (oreg.ecx.b[0] & 1))) {
+ ebios = true;
+
/* Query EBIOS parameters */
+ edd_params.len = sizeof edd_params;
+
ireg.eax.b[1] = 0x48;
ireg.ds = SEG(&edd_params);
ireg.esi.w[0] = OFFS(&edd_params);
__intcall(0x13, &ireg, &oreg);
if (!(oreg.eflags.l & EFLAGS_CF) && oreg.eax.b[1] == 0) {
- ebios = true;
+ if (edd_params.len < sizeof edd_params)
+ memset((char *)&edd_params + edd_params.len, 0,
+ sizeof edd_params - edd_params.len);
if (edd_params.sector_size >= 512 &&
is_power_of_2(edd_params.sector_size))
sector_size = edd_params.sector_size;