diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-10-01 16:42:33 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-06 14:36:08 -0500 |
commit | 45a50b1668822c23afc2a89f724654e176518bc4 (patch) | |
tree | 0dc2589b1b21401e50f54666c70e42df29c245eb /vl.c | |
parent | dbbaaff6867af255d2cc84dbade4f9b58d823397 (diff) | |
download | qemu-45a50b1668822c23afc2a89f724654e176518bc4.zip qemu-45a50b1668822c23afc2a89f724654e176518bc4.tar.gz qemu-45a50b1668822c23afc2a89f724654e176518bc4.tar.bz2 |
Reorganize option rom (+linux kernel) loading.
This patch adds infrastructure to maintain memory regions which must be
restored on reset. That includes roms (vga bios and option roms on pc),
but is also used when loading linux kernels directly. Features:
- loading files is supported.
- passing blobs is supported.
- target address range is supported (for optionrom area).
- fixed target memory address is supported (linux kernel).
New in v2:
- writes to ROM are done only at initial boot.
- also handle aout and uimage loaders.
- drop unused fread_targphys() function.
The final memory layout is created once all memory regions are
registered. The option roms get addresses assigned and the
registered regions are checked against overlaps. Finally all data
is copyed to the guest memory.
Advantages:
(1) Filling memory on initial boot and on reset takes the same
code path, making reset more robust.
(2) The need to keep track of the option rom load address is gone.
(3) Due to (2) option roms can be loaded outside pc_init(). This
allows to move the pxe rom loading into the nic drivers for
example.
Additional bonus: There is a 'info roms' monitor command now.
The patch also switches over pc.c and removes the
option_rom_setup_reset() and load_option_rom() functions.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -143,6 +143,7 @@ int main(int argc, char **argv) #include "hw/smbios.h" #include "hw/xen.h" #include "hw/qdev.h" +#include "hw/loader.h" #include "bt-host.h" #include "net.h" #include "monitor.h" @@ -5955,6 +5956,8 @@ int main(int argc, char **argv, char **envp) qdev_machine_creation_done(); + rom_load_all(); + if (loadvm) { if (load_vmstate(cur_mon, loadvm) < 0) { autostart = 0; |