On Aug 12, 2018, at 9:24 AM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
These patches add support for booting from virtio-blk (PCI) devices as used by QEMU.
Patches 1 and 2 add bootindex support which is the new way for passing boot order information from QEMU to OpenBIOS. Note that there are also corresponding patches for QEMU required, without which the generated device paths will be incorrect and cause virtio boot to fail.
Patch 3 adds the legacy virtio-blk driver (it follows the 0.9 rather than the 1.0 specification).
Patch 4 enables the new driver for both PPC and SPARC64 architectures so that virtio-blk devices will be usable out-of-the-box with QEMU.
Once these patches have been applied to OpenBIOS (along with the corresponding fw path fixes for QEMU) it is possible to boot from virtio-blk devices like this:
PPC:
./qemu-system-ppc -drive file=debian-9.0-powerpc-NETINST.iso,if=none,index=0,id=cd,media=cdrom \ -device virtio-blk-pci,drive=cd,bootindex=0 -m 256 -boot d
SPARC:
./qemu-system-sparc64 -drive debian-9.0-sparc64-NETINST.iso,if=none,index=0,id=cd,media=cdrom \ -device virtio-blk-pci,bus=pciB,drive=cd,bootindex=0 -m 256 -boot d -nographic
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (4): ppc: add bootindex support SPARC64: add bootindex support drivers: add legacy virtio-blk driver config: enable virtio-blk driver for default PPC and SPARC64 builds
arch/ppc/qemu/init.c | 55 ++++- arch/sparc64/boot.c | 2 +- arch/sparc64/boot.h | 2 +- arch/sparc64/openbios.c | 38 +++- config/examples/ppc_config.xml | 1 + config/examples/sparc64_config.xml | 1 + drivers/build.xml | 1 + drivers/pci.c | 18 ++ drivers/pci_database.c | 4 +- drivers/pci_database.h | 1 + drivers/virtio.c | 424 +++++++++++++++++++++++++++++++++++++ drivers/virtio.h | 331 +++++++++++++++++++++++++++++ include/drivers/drivers.h | 4 + 13 files changed, 862 insertions(+), 20 deletions(-) create mode 100644 drivers/virtio.c create mode 100644 drivers/virtio.h
-- 2.11.0
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
That’s pretty cool Mark, is the virtue-blk driver only good for CDROM image files, or can we use it on HD images as well.
I gave it a go with a Mac OS 9 image file, and was able to boot over the Trampoline into the Mac OS Nano Kernel, but it couldn’t find the System Folder, so booting halted with the ? Icon.
Not surprising, I think we would need a Openbios based ’NDRV’ for the virtio-blk device.
Booting the Trampoline was much faster with this driver, at least 2-3x.