[syslinux:fsc] core/diskio: correct the EDD parameter query
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Thu Jan 21 21:42:04 PST 2010
Commit-ID: 8f189531a58aef0655cd04a620931da3a0157eaa
Gitweb: http://syslinux.zytor.com/commit/8f189531a58aef0655cd04a620931da3a0157eaa
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Thu, 21 Jan 2010 21:36:52 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Thu, 21 Jan 2010 21:38:50 -0800
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 at yahoo.co.uk>
Isolated-by: Alek Du <alek.du at intel.com>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
core/diskio.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/core/diskio.c b/core/diskio.c
index 911e4dd..eddcd8d 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;
More information about the Syslinux-commits
mailing list