diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-30 00:52:44 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-30 01:59:37 +0100 |
commit | 5cea8590eaa099be8087f363f80d0e6917382385 (patch) | |
tree | 485aa34f5047dd2835642d88957d8236adf45b3c /hw/mips_jazz.c | |
parent | abc0754527e30acf278765f66d2157b6c75dc549 (diff) | |
download | qemu-5cea8590eaa099be8087f363f80d0e6917382385.tar.gz qemu-5cea8590eaa099be8087f363f80d0e6917382385.tar.bz2 qemu-5cea8590eaa099be8087f363f80d0e6917382385.zip |
Use relative path for bios
Look for bios and other support files relative to qemu binary, rather than
a hardcoded prefix.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/mips_jazz.c')
-rw-r--r-- | hw/mips_jazz.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c index e496c2868b..e683421d86 100644 --- a/hw/mips_jazz.c +++ b/hw/mips_jazz.c @@ -118,7 +118,7 @@ void mips_jazz_init (ram_addr_t ram_size, const char *cpu_model, enum jazz_model_e jazz_model) { - char buf[1024]; + char *filename; int bios_size, n; CPUState *env; qemu_irq *rc4030, *i8259; @@ -161,11 +161,17 @@ void mips_jazz_init (ram_addr_t ram_size, /* load the BIOS image. */ if (bios_name == NULL) bios_name = BIOS_FILENAME; - snprintf(buf, sizeof(buf), "%s/%s", bios_dir, bios_name); - bios_size = load_image_targphys(buf, 0xfff00000LL, MAGNUM_BIOS_SIZE); + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (filename) { + bios_size = load_image_targphys(filename, 0xfff00000LL, + MAGNUM_BIOS_SIZE); + qemu_free(filename); + } else { + bios_size = -1; + } if (bios_size < 0 || bios_size > MAGNUM_BIOS_SIZE) { fprintf(stderr, "qemu: Could not load MIPS bios '%s'\n", - buf); + bios_name); exit(1); } |