qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: [PATCH 0/3] m68k: virt: add a firmware to the virt machine (petit boot)
Date: Wed,  2 Feb 2022 23:35:25 +0100	[thread overview]
Message-ID: <20220202223528.1260154-1-laurent@vivier.eu> (raw)

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



             reply	other threads:[~2022-02-02 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 22:35 Laurent Vivier [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220202223528.1260154-1-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).