allow variable bios size
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1496 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
0289b2c1df
commit
4157a66212
@ -526,7 +526,7 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
m48t59_t *nvram;
|
m48t59_t *nvram;
|
||||||
int PPC_io_memory;
|
int PPC_io_memory;
|
||||||
int ret, linux_boot, i, nb_nics1;
|
int linux_boot, i, nb_nics1, bios_size;
|
||||||
unsigned long bios_offset;
|
unsigned long bios_offset;
|
||||||
uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
|
uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
|
||||||
ppc_def_t *def;
|
ppc_def_t *def;
|
||||||
@ -544,13 +544,14 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
|
|||||||
/* allocate and load BIOS */
|
/* allocate and load BIOS */
|
||||||
bios_offset = ram_size + vga_ram_size;
|
bios_offset = ram_size + vga_ram_size;
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
|
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME);
|
||||||
ret = load_image(buf, phys_ram_base + bios_offset);
|
bios_size = load_image(buf, phys_ram_base + bios_offset);
|
||||||
if (ret != BIOS_SIZE) {
|
if (bios_size < 0 || bios_size > BIOS_SIZE) {
|
||||||
fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf);
|
fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
cpu_register_physical_memory((uint32_t)(-BIOS_SIZE),
|
bios_size = (bios_size + 0xfff) & ~0xfff;
|
||||||
BIOS_SIZE, bios_offset | IO_MEM_ROM);
|
cpu_register_physical_memory((uint32_t)(-bios_size),
|
||||||
|
bios_size, bios_offset | IO_MEM_ROM);
|
||||||
|
|
||||||
if (linux_boot) {
|
if (linux_boot) {
|
||||||
kernel_base = KERNEL_LOAD_ADDR;
|
kernel_base = KERNEL_LOAD_ADDR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user