On 26/05/18 20:29, Mark Cave-Ayland wrote:
The current PReP firmware provided with OpenBIOS is OpenHackWare which provides a basic set of OpenFirmware interfaces but does this without providing any kind of Forth implementation which limits its usefulness and compatibility.
Whilst the project has allowed QEMU PReP development to continue to date, it is sadly now abandonware with no patches for over 4 years, and with no-one willing to take on maintenance it is now time for a different approach.
This patchset adds PReP support for the QEMU 40p machine allowing it to start booting NetBSD and the sandalfoot Linux zImage. The main features required for this are support for the LSI SCSI controller, resdidual data and PReP boot partitions.
In order to test these patches you'll need a recent QEMU with the following patches applied:
https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg05480.html https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg05964.html
Next you'll need an updated openbios-ppc binary, and for those without access to a cross-compiler setup I've uploaded the resulting binary to https://www.ilande.co.uk/tmp/qemu/openbios-ppc.prep.
To boot the sandalfoot zImage from http://www.juneau-lug.org/zImage.initrd.sandalfoot you can do:
qemu-system-ppc -M 40p -bios openbios-ppc.prep -cdrom zImage.initrd.sandalfoot -boot d
Note that it seems to get stuck trying to initialise the LSI SCSI controller, presumably due to a bug in the existing QEMU emulation.
NetBSD works much better and in fact boots all the way to userspace:
qemu-system-pcc -M 40p -bios openbios-ppc.prep -cdrom NetBSD-7.1.2-prep.iso -boot d -nographic
In terms of functionality I think this patchset is just about there: there are a few questions around device names but hopefully someone with real PReP experience can point me in the right direction.
Finally I've added various people on CC who have expressed interest in PReP and/or OpenHackWare in the past: if this is no longer of any interest to you, do let me know and I'll drop your email address from future versions.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (11): pc_kbd: ensure that we properly reset the 8042 controller and keyboard device pci: rename i82378 keyboard device from 8042 to keyboard pci: add AMD PCNET information to PCI database bootcode_load: ensure LOADER_NOT_SUPPORT is returned if no bootcode is present ppc: add PReP support to dma-map-in pci: add driver for LSI 53C810 SCSI controller ppc: add PReP residual data block ppc: use proper context when pre-loading kernels pc-parts: allow successful detection of PReP boot partitions libopenbios: add PReP boot partition loader for PPC prep: disable VBE extensions when executing client program
arch/ppc/qemu/context.c | 129 ++++++- arch/ppc/qemu/context.h | 1 + arch/ppc/qemu/init.c | 34 ++ arch/ppc/qemu/kernel.h | 1 - arch/ppc/qemu/main.c | 11 +- arch/ppc/qemu/switch.S | 43 --- arch/ppc/qemu/tree.fs | 5 - config/examples/ppc_config.xml | 2 + drivers/build.xml | 1 + drivers/lsi.c | 770 ++++++++++++++++++++++++++++++++++++++++ drivers/pc_kbd.c | 22 +- drivers/pci.c | 21 +- drivers/pci_database.c | 14 + drivers/pci_database.h | 1 + drivers/vga.fs | 11 + forth/debugging/client.fs | 1 + include/arch/ppc/residual.h | 116 ++++++ include/drivers/drivers.h | 4 + include/drivers/pci.h | 6 + include/libopenbios/prep_load.h | 24 ++ libopenbios/bootcode_load.c | 2 + libopenbios/build.xml | 1 + libopenbios/initprogram.c | 8 + libopenbios/load.c | 11 + libopenbios/prep_load.c | 106 ++++++ packages/pc-parts.c | 10 + 26 files changed, 1300 insertions(+), 55 deletions(-) create mode 100644 drivers/lsi.c create mode 100644 include/arch/ppc/residual.h create mode 100644 include/libopenbios/prep_load.h create mode 100644 libopenbios/prep_load.c
This passes all my local tests, so I've applied it to master.
ATB,
Mark.