diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-04-12 14:00:49 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-04-12 14:00:49 +0100 |
commit | 1e7545fd7cf40876121ab3ce185c90e555a81dc2 (patch) | |
tree | fbddb39ce4134a0be619ffb3eaf300ea8e3916d1 /tools/firmware | |
parent | 575f9fbdfaf960880e04034de41c04e7323585b1 (diff) | |
download | xen-1e7545fd7cf40876121ab3ce185c90e555a81dc2.tar.gz xen-1e7545fd7cf40876121ab3ce185c90e555a81dc2.tar.bz2 xen-1e7545fd7cf40876121ab3ce185c90e555a81dc2.zip |
tools: hvmloader: select BIOS through xenstore.
Allow the toolstack to select the BIOS to use via a xenstore key.
Defaults to "rombios" for compatibility with toolstacks which do not
write the key (e.g. xend).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/firmware')
-rw-r--r-- | tools/firmware/hvmloader/hvmloader.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index 4fcbd9c499..bbbc964f9c 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -337,10 +337,30 @@ static void cmos_write_memory_size(void) cmos_outb(0x35, (uint8_t)( alt_mem >> 8)); } +struct bios_info { + const char *key; + const struct bios_config *bios; +} bios_configs[] = { + { "rombios", &rombios_config, }, + { NULL, NULL } +}; static const struct bios_config *detect_bios(void) { - return &rombios_config; + const struct bios_info *b; + const char *bios; + + bios = xenstore_read("hvmloader/bios"); + if ( !bios ) + bios = "rombios"; + + for ( b = &bios_configs[0]; b->key != NULL; b++ ) + if ( !strcmp(bios, b->key) ) + return b->bios; + + printf("Unknown BIOS %s, no ROM image found\n", bios); + BUG(); + return NULL; } int main(void) |