[coreboot] [PATCH] Fix zeroes decompression algo

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat Feb 16 13:55:00 CET 2008


On 16.02.2008 07:41, ron minnich wrote:
> Alix1c won't boot with the zero decompress code. So I have disabled it
> in a simple way:
>   

[...]

> I think the code is using the wrong address on decompress, but I have
> no idea and I want to rest.
>   

Indeed, r601 broke all targets, you were just lucky that qemu didn't
explode as well.
It's the seemingly easy patches which break booting. With your hint, I
found the bug. Myles made a small, but important mistake with the memset
for the "zeroes" decompression.
The memset zeroed the archive instead of the destination. No wonder it
did explode.
This patch fixes it and also reverts the emergency commit r604 because
that one is no longer necessary.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: LinuxBIOSv3-zerofixup/lib/lar.c
===================================================================
--- LinuxBIOSv3-zerofixup/lib/lar.c	(Revision 604)
+++ LinuxBIOSv3-zerofixup/lib/lar.c	(Arbeitskopie)
@@ -172,7 +172,7 @@
 #endif
 	/* zeroes */
 	if (archive->compression == 3) {
-		memset(archive->start, 0, archive->reallen);
+		memset(where, 0, archive->reallen);
 		return 0;
 	}
 	printk(BIOS_INFO, "LAR: Compression algorithm #%i not supported!\n", archive->compression);
Index: LinuxBIOSv3-zerofixup/util/lar/stream.c
===================================================================
--- LinuxBIOSv3-zerofixup/util/lar/stream.c	(Revision 604)
+++ LinuxBIOSv3-zerofixup/util/lar/stream.c	(Arbeitskopie)
@@ -148,7 +148,6 @@
 			continue;
 		}
 		thisalgo = zeroes;
-		thisalgo = algo;
 		if (verbose())
 			fprintf(stderr,  "New section addr %#x size %#x\n",
 			(u32)shdr[i].sh_addr, (u32)shdr[i].sh_size);


-- 
http://www.hailfinger.org/





More information about the coreboot mailing list