Commit de12d6369bec323e9198c85b9cd60e52812442ba
1 parent
bc9ed47b
kernel load fix (Ralf Baechle)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1467 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
3 deletions
hw/mips_r4k.c
@@ -257,8 +257,9 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device, | @@ -257,8 +257,9 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device, | ||
257 | if (linux_boot) { | 257 | if (linux_boot) { |
258 | kernel_base = KERNEL_LOAD_ADDR; | 258 | kernel_base = KERNEL_LOAD_ADDR; |
259 | /* now we can load the kernel */ | 259 | /* now we can load the kernel */ |
260 | - kernel_size = load_image(kernel_filename, phys_ram_base + kernel_base); | ||
261 | - if (kernel_size < 0) { | 260 | + kernel_size = load_image(kernel_filename, |
261 | + phys_ram_base + (kernel_base - 0x80000000)); | ||
262 | + if (kernel_size == (target_ulong) -1) { | ||
262 | fprintf(stderr, "qemu: could not load kernel '%s'\n", | 263 | fprintf(stderr, "qemu: could not load kernel '%s'\n", |
263 | kernel_filename); | 264 | kernel_filename); |
264 | exit(1); | 265 | exit(1); |
@@ -268,7 +269,7 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device, | @@ -268,7 +269,7 @@ void mips_r4k_init (int ram_size, int vga_ram_size, int boot_device, | ||
268 | initrd_base = INITRD_LOAD_ADDR; | 269 | initrd_base = INITRD_LOAD_ADDR; |
269 | initrd_size = load_image(initrd_filename, | 270 | initrd_size = load_image(initrd_filename, |
270 | phys_ram_base + initrd_base); | 271 | phys_ram_base + initrd_base); |
271 | - if (initrd_size < 0) { | 272 | + if (initrd_size == (target_ulong) -1) { |
272 | fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", | 273 | fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", |
273 | initrd_filename); | 274 | initrd_filename); |
274 | exit(1); | 275 | exit(1); |