qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] m68k: virt: add a firmware to the virt machine (petit boot)
@ 2022-02-02 22:35 Laurent Vivier
  2022-02-02 22:35 ` [PATCH 1/3] m68k: bootinfo entry size must be aligned on 4 bytes Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laurent Vivier @ 2022-02-02 22:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

For the moment, the virt machine can only be started by using
QEMU "-kernel" parameter, and thus can only load the kernel/initramfs
from the host filesystem.

Adding a firmware is a good way to allow the machine to boot and update
a kernel from the guest point of view (disk, network, cdrom, ...).

As I don't want to port a firmware to this machine, the easy way to do
that is to use linux. This approach is already in use by petit boot on
the bare metal POWER systems.

This series adds a bootstrap ROM to load the firmware (petit boot),
and a buildroot environment to build the petit boot firmware for
the m68k virt machine.

To build the bootstram ROM:

$ git submodule init roms/m68k-virt
$ git submodule updage roms/m68k-virt
$ make -C roms m68k-virt-bootrom

To build the firmware:

$ git submodule init roms/buildroot
$ git submodule update roms/buildroot
$ make -C roms m68k-virt-firmware

Build qemu-system-m68k and then you can start QEMU and
play with petit boot:
$ ./qemu-system-m68k -M virt -nographic

Petit boot supports various bootloader configuration files, like
grub, pxe, kboot, syslinux...

For instance:

menuentry "Linux 5.16.0-virt (debian 10.0)" {
	search --set=root --label root
	linux /boot/vmlinux-5.16.0-virt ro root=/dev/vda2 console=ttyGF0
}

default="vmlinux-5.16.0-virt"
vmlinux-5.16.0-virt='/boot/vmlinux-5.16.0-virt root=/dev/vda2 console=ttyGF0'

default vmlinux-5.16.0-virt (debian 10.0)
label vmlinux-5.16.0-virt (debian 10.0)
 kernel /boot/vmlinux-5.16.0-virt
 append root=/dev/vda2 console=ttyGF0

Laurent Vivier (3):
  m68k: bootinfo entry size must be aligned on 4 bytes
  m68k: virt: add a bootstrap ROM
  m68k: virt: add a firmware (petitboot)

 configure                   |   3 +-
 hw/m68k/bootinfo.h          |   4 +-
 include/hw/misc/virt_ctrl.h |   6 ++
 hw/m68k/virt.c              |  38 ++++++++++++
 hw/misc/virt_ctrl.c         | 111 +++++++++++++++++++++++++++++++++++-
 .gitmodules                 |   6 ++
 pc-bios/meson.build         |   3 +
 roms/Makefile               |  15 +++++
 roms/buildroot              |   1 +
 roms/m68k-virt              |   1 +
 10 files changed, 183 insertions(+), 5 deletions(-)
 create mode 160000 roms/buildroot
 create mode 160000 roms/m68k-virt

-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-02 23:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-02 22:35 [PATCH 0/3] m68k: virt: add a firmware to the virt machine (petit boot) Laurent Vivier
2022-02-02 22:35 ` [PATCH 1/3] m68k: bootinfo entry size must be aligned on 4 bytes Laurent Vivier
2022-02-02 22:35 ` [PATCH 2/3] m68k: virt: add a bootstrap ROM Laurent Vivier
2022-02-02 23:27   ` Philippe Mathieu-Daudé via
2022-02-02 22:35 ` [PATCH 3/3] m68k: virt: add a firmware (petitboot) Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).