]> git.ipfire.org Git - thirdparty/qemu.git/commit
linuxboot: compute initrd loading address
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Oct 2014 14:49:57 +0000 (16:49 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 14 Jan 2015 23:08:43 +0000 (17:08 -0600)
commit6a47ae2d411e79ab06bd4da233b480282f95f498
treece33a231c78ae8988fb0d9fd06a21202bece7758
parent5f0681e1c3f47c680ca31fea4c7627648aedabdf
linuxboot: compute initrd loading address

Even though hw/i386/pc.c tries to compute a valid loading address for the
initrd, close to the top of RAM, this does not take into account other
data that is malloced into that memory by SeaBIOS.

Luckily we can easily look at the memory map to find out how much memory is
used up there.  This patch places the initrd in the first four gigabytes,
below the first hole (as returned by INT 15h, AX=e801h).

Without this patch:
[    0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
[    0.000000] RAMDISK: [mem 0x0710a000-0x07fd7fff]

With this patch:
[    0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
[    0.000000] RAMDISK: [mem 0x07112000-0x07fdffff]

So linuxboot is able to use the 64k that were added as padding for
QEMU <= 2.1.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit cdebec5e40bd0af82da0659f37af85ee2aa2c9d1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
pc-bios/linuxboot.bin
pc-bios/optionrom/linuxboot.S
pc-bios/optionrom/optionrom.h