diff options
author | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-03-09 01:12:37 -0500 |
---|---|---|
committer | Shao Miller <shao.miller@yrdsb.edu.on.ca> | 2010-03-30 21:09:59 -0400 |
commit | b5d635ad26b00ce242af7c1b31e34f41cb798fc9 (patch) | |
tree | c61cc8a3f50e045cb8b92db27b4b5fbd73bc1050 | |
parent | 246798735d0628f23727b63234325b62084d8d5f (diff) | |
download | syslinux-b5d635ad26b00ce242af7c1b31e34f41cb798fc9.tar.gz |
memdisk: Calculate mBFT checksum later
We were calculating the mBFT checksum too early; dpt_ptr could
change after checksumming, so we now do it after that possibility.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
-rw-r--r-- | memdisk/setup.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c index cec25ad3..db1c4bcf 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -1,8 +1,9 @@ /* ----------------------------------------------------------------------- * * * Copyright 2001-2009 H. Peter Anvin - All Rights Reserved - * Copyright 2009 Intel Corporation; author: H. Peter Anvin - * Portions copyright 2009 Shao Miller [El Torito code, mBFT, safe hook] + * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin + * Portions copyright 2009-2010 Shao Miller + * [El Torito code, mBFT, "safe hook"] * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1212,18 +1213,6 @@ void setup(const struct real_mode_args *rm_args_ptr) /* Re-fill the "safe hook" mBFT field with the physical address */ safe_hook->mBFT += (uint32_t)hptr; - /* Complete the mBFT */ - { - struct mBFT *mBFT = (struct mBFT *)safe_hook->mBFT; - - mBFT->acpi.signature[0] = 'm'; /* "mBFT" */ - mBFT->acpi.signature[1] = 'B'; - mBFT->acpi.signature[2] = 'F'; - mBFT->acpi.signature[3] = 'T'; - mBFT->safe_hook = (uint32_t)safe_hook; - mBFT->acpi.checksum = -checksum_buf(mBFT, mBFT->acpi.length); - } - /* Update various BIOS magic data areas (gotta love this shit) */ if (geometry->driveno & 0x80) { @@ -1257,6 +1246,18 @@ void setup(const struct real_mode_args *rm_args_ptr) } } + /* Complete the mBFT */ + { + struct mBFT *mBFT = (struct mBFT *)safe_hook->mBFT; + + mBFT->acpi.signature[0] = 'm'; /* "mBFT" */ + mBFT->acpi.signature[1] = 'B'; + mBFT->acpi.signature[2] = 'F'; + mBFT->acpi.signature[3] = 'T'; + mBFT->safe_hook = (uint32_t)safe_hook; + mBFT->acpi.checksum = -checksum_buf(mBFT, mBFT->acpi.length); + } + /* Install the interrupt handlers */ printf("old: int13 = %08x int15 = %08x int1e = %08x\n", rdz_32(BIOS_INT13), rdz_32(BIOS_INT15), rdz_32(BIOS_INT1E)); |