VirtualBox

Ignore:
Timestamp:
Aug 14, 2024 1:16:30 PM (8 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164367
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/RiscVVirt/README.md

    r101291 r105670  
    7070        -device virtio-blk-device,drive=hd0 \
    7171        -drive file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0
     72
     73    Note: the `acpi=off` machine property is specified because Linux guest
     74    support for ACPI (that is, the ACPI consumer side) is a work in progress.
     75    Currently, `acpi=off` is recommended unless you are developing ACPI support
     76    yourself.
     77
     783) Running QEMU with direct kernel boot
     79
     80    The following example boots the same guest, but loads the kernel image and
     81    the initial RAM disk (which were extracted from
     82    `openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw`) from the host filesystem.
     83    It also sets the guest kernel command line on the QEMU command line.
     84
     85        CMDLINE=(root=UUID=76d9b92d-09e9-4df0-8262-c1a7a466f2bc
     86                 systemd.show_status=1
     87                 ignore_loglevel
     88                 console=ttyS0
     89                 earlycon=uart8250,mmio,0x10000000)
     90
     91        qemu-system-riscv64 \
     92        -M virt,pflash0=pflash0,pflash1=pflash1,acpi=off \
     93        -m 4096 -smp 2 \
     94        -serial mon:stdio \
     95        -device virtio-gpu-pci -full-screen \
     96        -device qemu-xhci \
     97        -device usb-kbd \
     98        -device virtio-rng-pci \
     99        -blockdev node-name=pflash0,driver=file,read-only=on,filename=RISCV_VIRT_CODE.fd \
     100        -blockdev node-name=pflash1,driver=file,filename=RISCV_VIRT_VARS.fd \
     101        -netdev user,id=net0 \
     102        -device virtio-net-pci,netdev=net0 \
     103        -device virtio-blk-device,drive=hd0 \
     104        -drive file=openSUSE-Tumbleweed-RISC-V-E20-efi.riscv64.raw,format=raw,id=hd0 \
     105        -kernel Image-6.5.2-1-default \
     106        -initrd initrd-6.5.2-1-default \
     107        -append "${CMDLINE[*]}"
     108
     109## Test with your own OpenSBI binary
     110Using the above QEMU command lines, **RISCV_VIRT_CODE.fd** is launched by the
     111OpenSBI binary that is bundled with QEMU. You can build your own OpenSBI binary
     112as well:
     113
     114    OPENSBI_DIR=...
     115    git clone https://github.com/riscv/opensbi.git $OPENSBI_DIR
     116    make -C $OPENSBI_DIR \
     117        -j $(getconf _NPROCESSORS_ONLN) \
     118        CROSS_COMPILE=riscv64-linux-gnu- \
     119        PLATFORM=generic
     120
     121then specify that binary for QEMU, with the following additional command line
     122option:
     123
     124    -bios $OPENSBI_DIR/build/platform/generic/firmware/fw_dynamic.bin
     125
     126Note that the above only makes a difference with software emulation (which you
     127can force with `-M accel=tcg`). With hardware virtualization (`-M accel=kvm`),
     128KVM services the SBI (Supervisor Binary Interface) calls internally, therefore
     129any OpenSBI binary specified with `-bios` is rejected.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette