Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff659d13ed91dd0b237064aba91a5259f827aeb3 Commit: ff659d13ed91dd0b237064aba91a5259f827aeb3 Parent: 8b608d2f5a1b3552363a3161566645a409ff8530 Author: H. Peter Anvin <[EMAIL PROTECTED]> AuthorDate: Tue Jul 31 16:17:13 2007 -0400 Committer: H. Peter Anvin <[EMAIL PROTECTED]> CommitDate: Tue Jul 31 16:18:05 2007 -0400
[x86 setup] EDD: Fix the computation of the MBR sector buffer Some BIOSes require that sector buffers not cross 64K boundaries. As a result, we compute a dynamic address on the setup heap. Unfortunately, this address computation was just totally wrong. Signed-off-by: H. Peter Anvin <[EMAIL PROTECTED]> --- arch/i386/boot/edd.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/i386/boot/edd.c b/arch/i386/boot/edd.c index 25a2824..77d92da 100644 --- a/arch/i386/boot/edd.c +++ b/arch/i386/boot/edd.c @@ -72,17 +72,18 @@ static u32 read_mbr_sig(u8 devno, struct edd_info *ei) u32 mbrsig; u32 buf_base, mbr_base; extern char _end[]; - static char mbr_buf[1024]; sector_size = ei->params.bytes_per_sector; if (!sector_size) sector_size = 512; /* Best available guess */ + /* Produce a naturally aligned buffer on the heap */ buf_base = (ds() << 4) + (u32)&_end; mbr_base = (buf_base+sector_size-1) & ~(sector_size-1); - mbrbuf_ptr = mbr_buf + (mbr_base-buf_base); + mbrbuf_ptr = _end + (mbr_base-buf_base); mbrbuf_end = mbrbuf_ptr + sector_size; + /* Make sure we actually have space on the heap... */ if (!(boot_params.hdr.loadflags & CAN_USE_HEAP)) return 0; if (mbrbuf_end > (char *)(size_t)boot_params.hdr.heap_end_ptr) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html