526 |
char buf[1024]; |
char buf[1024]; |
527 |
m48t59_t *nvram; |
m48t59_t *nvram; |
528 |
int PPC_io_memory; |
int PPC_io_memory; |
529 |
int ret, linux_boot, i, nb_nics1; |
int linux_boot, i, nb_nics1, bios_size; |
530 |
unsigned long bios_offset; |
unsigned long bios_offset; |
531 |
uint32_t kernel_base, kernel_size, initrd_base, initrd_size; |
uint32_t kernel_base, kernel_size, initrd_base, initrd_size; |
532 |
ppc_def_t *def; |
ppc_def_t *def; |
544 |
/* allocate and load BIOS */ |
/* allocate and load BIOS */ |
545 |
bios_offset = ram_size + vga_ram_size; |
bios_offset = ram_size + vga_ram_size; |
546 |
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); |
snprintf(buf, sizeof(buf), "%s/%s", bios_dir, BIOS_FILENAME); |
547 |
ret = load_image(buf, phys_ram_base + bios_offset); |
bios_size = load_image(buf, phys_ram_base + bios_offset); |
548 |
if (ret != BIOS_SIZE) { |
if (bios_size < 0 || bios_size > BIOS_SIZE) { |
549 |
fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf); |
fprintf(stderr, "qemu: could not load PPC PREP bios '%s'\n", buf); |
550 |
exit(1); |
exit(1); |
551 |
} |
} |
552 |
cpu_register_physical_memory((uint32_t)(-BIOS_SIZE), |
bios_size = (bios_size + 0xfff) & ~0xfff; |
553 |
BIOS_SIZE, bios_offset | IO_MEM_ROM); |
cpu_register_physical_memory((uint32_t)(-bios_size), |
554 |
|
bios_size, bios_offset | IO_MEM_ROM); |
555 |
|
|
556 |
if (linux_boot) { |
if (linux_boot) { |
557 |
kernel_base = KERNEL_LOAD_ADDR; |
kernel_base = KERNEL_LOAD_ADDR; |