When zero'ing memory, zero the section MEMORY size, not the FILE size.
trivial fix. Linux now boots on BOTH bochs and qemu. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@206 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
d8e330ef72
commit
6f5301afb3
1 changed files with 3 additions and 2 deletions
|
|
@ -87,6 +87,7 @@ static int load_elf_segments(struct lb_memory *mem,unsigned char *header, int he
|
|||
ehdr = (Elf_ehdr *)header;
|
||||
phdr = (Elf_phdr *)(&header[ehdr->e_phoff]);
|
||||
|
||||
printk(BIOS_DEBUG, "%s: header %p #headers %d\n", header, headers);
|
||||
int i;
|
||||
int size;
|
||||
for(i = 0; i < headers; i++) {
|
||||
|
|
@ -116,8 +117,8 @@ static int load_elf_segments(struct lb_memory *mem,unsigned char *header, int he
|
|||
* then copy out the data, which may be a subset of the total area.
|
||||
* the cache, after all, is your friend.
|
||||
*/
|
||||
printk(BIOS_INFO, "set %p to 0 for %d bytes\n", (unsigned char *)phdr[i].p_paddr, 0, size);
|
||||
memset((unsigned char *)phdr[i].p_paddr, 0, size);
|
||||
printk(BIOS_INFO, "set %p to 0 for %d bytes\n", (unsigned char *)phdr[i].p_paddr, phdr[i].p_memsz);
|
||||
memset((unsigned char *)phdr[i].p_paddr, 0, phdr[i].p_memsz);
|
||||
/* ok, copy it out */
|
||||
printk(BIOS_INFO, "Copy to %p from %p for %d bytes\n", (unsigned char *)phdr[i].p_paddr, &header[phdr[i].p_offset], size);
|
||||
memcpy((unsigned char *)phdr[i].p_paddr, &header[phdr[i].p_offset], size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue