[SeaBIOS] [PATCH] Add config option to disable MTRR initialization.

2011-03-06 Thread Kevin O'Connor
Some versions of Bochs don't like the MTRR initialization, so add
CONFIG_MTRR_INIT to control whether SeaBIOS will touch the MTRRs.
---
 src/Kconfig |6 ++
 src/mtrr.c  |2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index fca73e4..f064b27 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -194,6 +194,12 @@ menu Hardware support
 default y
 help
 Support System Management Mode (on emulators).
+config MTRR_INIT
+depends on !COREBOOT
+bool Initialize MTRRs
+default y
+help
+Initialize the Memory Type Range Registers (on emulators).
 endmenu
 
 menu BIOS interfaces
diff --git a/src/mtrr.c b/src/mtrr.c
index ed239c8..0502c18 100644
--- a/src/mtrr.c
+++ b/src/mtrr.c
@@ -32,7 +32,7 @@
 
 void mtrr_setup(void)
 {
-if (CONFIG_COREBOOT)
+if (!CONFIG_MTRR_INIT || CONFIG_COREBOOT)
 return;
 
 u32 eax, ebx, ecx, edx, cpuid_features;
-- 
1.7.4


___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH] Allow to run option roms with bad checksums

2011-03-06 Thread Kevin O'Connor
On Fri, Feb 11, 2011 at 01:26:43PM -0800, Stefan Reinauer wrote:
 See patch
 
 -- 
 Stefan Reinauer
 Google Inc.

 Allow running option roms with a wrong checksum.
 
 Signed-off-by: Stefan Reinauer reina...@google.com

Thanks.  I changed the name of the option and then committed this
patch.

-Kevin


From cc975646af69f279396d4d5e1379ac6af80ee637 Mon Sep 17 00:00:00 2001
Message-Id: 
cc975646af69f279396d4d5e1379ac6af80ee637.1299457605.git.ke...@koconnor.net
From: Kevin O'Connor ke...@koconnor.net
Date: Sun, 6 Mar 2011 19:22:46 -0500
Subject: [PATCH] Add config option to permit running option roms with bad 
checksums.
To: seabios@seabios.org

Based on a patch by: Stefan Reinauer reina...@google.com
---
 src/Kconfig  |   11 +++
 src/optionroms.c |3 ++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index f064b27..6d55b23 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -250,6 +250,17 @@ menu BIOS interfaces
 Select this if option ROMs are already copied to
 0xc-0xf.  This must only be selected when using
 Bochs or QEMU versions older than 0.12.
+config OPTIONROMS_CHECKSUM
+depends on OPTIONROMS
+bool Require correct checksum on option ROMs
+default y
+help
+Option ROMs are required to have correct checksums.
+However, some option ROMs in the wild don't correctly
+follow the specifications and have bad checksums.
+Say N here to allow SeaBIOS to execute them anyways.
+
+If unsure, say Y.
 config PMM
 depends on OPTIONROMS
 bool PMM interface
diff --git a/src/optionroms.c b/src/optionroms.c
index a94b46c..37a4e6c 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -131,7 +131,8 @@ is_valid_rom(struct rom_header *rom)
 if (sum != 0) {
 dprintf(1, Found option rom with bad checksum: loc=%p len=%d sum=%x\n
 , rom, len, sum);
-return 0;
+if (CONFIG_OPTIONROMS_CHECKSUM)
+return 0;
 }
 return 1;
 }
-- 
1.7.4


___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios