The pegasos2 rom seems to have two parts: a compressed image at around 0x20000 that is called oftest_64M.rom which I think is actual SmartFirmware that you could build from the open sources maybe with some patches and a loader called PegasosII Boot Strap that first starts, inits the machine and memory and then uncompresses and starts SmartFirmware. This is the bPlan code that isn't open sourced.
Just checked it a bit, and that what i found so far:
For first, on my real pegasos2 i do have version marked as "Boot Strap (c) 2002-2004 bplan GmbH", while the rom from up050404 is 2002-2003. So i fully dump rom via serial by "FFF80000 80000 dump", then making a binary from it, and compare with all update-files i have, and actually this is : update_1.2_08.10.2004.gz That probably the real last vesion was. And i take this one from there : https://www.morphos-storage.net/?id=1532864
Next, using this rom i extract from this archive (and my own, which identical) extracted oftest_64M.rom and grep on strings, it have: "bplan GmbH CODEGEN,vendor", "GT-64260", "MV6436x", "VT8231", "Pegasos2", etc. So then i go to the https://github.com/openbios/smartfirmware , download master, and check if it have any mention of those in the sources : and no, nothing.
That mean, that it's not only bootstrap code used for init the hardware and all heavy DDR/PCI lifting, but smartfirmware also modified .. Seeing original SmartFirmware it seems need implementation of some "machdep layer" to talk to the hardware that bootstrap set up, and as start point i can probably reuse BeBox one, as it already ppc exceptions, serial via isa, pci probing, etc, and "only" will need to change some bits.
But firstly will try to build SmartFirmware for BeBox, and then some stubs etc for peg2.
Was able to build stubbed OF for pegasos2, zip it, put it together with bootstrap to the rom , and:
(hit open in new tab)
I.e. SmartFirmware even didn't starts, messed with checksums and stuff , need to analyze that all first, but at least
1). I can build SF for peg2 (through, all stubbed, not sure how it all will work out in end) 2). I can construct rom in which at least bootstrap works as expected :)
@kas1e Version 1.2, ‘update_1.2_08.10.2004.gz’, has been available on morphos-storage.net for for a long time. Balaton did not recommend using this version. It had not been properly tested with QEMU. Using firmware limits memory to 1GB under QEMU. Currently, it is better to use bboot, which also patches the kernel issue under PEG2. You must use it for QEMU PCI passthrough and probably only for that.
Not sure i get what you mean : bboot and pegasos2.rom completely different things. pegasos2.rom is what i trying to reconstruct (for later use on real pegasos2, like imporve it and reflash it). Qemu there only used for tests and exactly for tests of original and my constructed rom. Bboot there of no help
1). were able to build own SF for pegasos2 with just serial working and no devices 2). were able to construct pegasos2.rom by usage of bplan's original bootstrap code 3). were able to pass all the checksum/etc bplan's bootstrap do
Lots to do , but at least base is done !
@Balaton Currently i do -vga none , so to have compare original SF and my one in terms how it works, but , is ati-vga in a shape that i can see OF output on it with this "bplan" logo at top ? If not, how much need to fix about ? I see it bring unimplemented opcodes, so probably some bits to implement in ?
And one more questin : is qemu emulate can AMD flash command sequences, i.e. in other words i want to try to add flash read/write support and test it via qemu if possible
Edited by kas1e on 2026/4/17 9:12:14 Edited by kas1e on 2026/4/17 10:12:29 Edited by kas1e on 2026/4/17 12:46:08 Edited by kas1e on 2026/4/17 12:50:57
@smarkusg First I only had the older up050404 ROM and that's what I tested with QEMU and documented. Later the one on MorphOS storage surfaced and first did not work with older QEMU versions but should work now with more recent QEMU versions (I don't remember which version exactly but quite a few years ago) but since AFAIK newer ROM only tweaks memory init which is not needed on QEMU it should not matter which version one uses.
@kas1e What I know about pegasos2 firmware I documented at my QEMU pegasos2 development page that I linked to in the previous thread already. I don't think you'd see a bPlan logo from SF built without bPlan's changes and maybe you would not see output a PCI VGA before your SF can see PCI devices. The open source SmartFirmware lacks the machine specific parts so you need to adapt the bebox or whatever you used for the pegasosII but then the pegasosII SF also has the x86 emulator hacked in to initialise PC VGA cards which I think is also not in the open source version and may be a bPlan addition too. But maybe it's not needed on QEMU as SF has a vga driver that accesses the ISA ports so needs at least that part working (but it may already work if it can find the ISA ports of the serial). This driver only accesses the default VGA (or even CGA compatibility?) mode so that should work with QEMU VGA or ati-vga without any ROM and the x68 emulator is only needed for real cards. For machine specific init for the Marvell Discovery II chip and the bios emulator you could get inspiration and code from U-Boot. Apparently there was a development board from Marvell called DB64360 that was once supported by U-Boot and mentioned in u-boot/doc/README.scrapyard that it was removed on 2014-10-27 so it should still be in versions before that. That's probably most of the init code in bPlan bootstrap part. For the bios emu I think you want the latest from the Sam U-Boot that supports RX cards so you can look there. For flash emulation look in qemu/hw/block/pflash_cfi*.c or qemu/hw/block/m25p80.c If your flash chip is compatible to any of these you might try to use these but maybe they are not fully emulating all the features or exactly what you need. Otherwise I don't know if QEMU can emulate it.
I don't think you'd see a bPlan logo from SF built without bPlan's changes and maybe you would not see output a PCI VGA before your SF can see PCI devices.
No no, i mean about original pegasos2.rom, without my changes. Is there no way currently to make it work with ati-vga ? All i have with original rom is:
So i tried to figure out what issue are with ati-vga there. The same happens if i not specify ati-vga, but use default , which probably the same ati-vga or so ..
In other words, my current issue is to make ati-vga to work with oririnal rom (not my one), just to have some reference to fully working original.
As for my own rom : i already have progress. I already implement pegasos2 related parts, and serial, CD , HDD , PCI all already works. I even can load up the amigaboot which then stuck on loader.of (which i need to understand why):
(open in new tab for full size):
But firstly i need to fix ati-vga so original rom works as expected first, as i need proper reference to working original. At least, i hope it's just ati-vga.
No no, i mean about original pegasos2.rom, without my changes. Is there no way currently to make it work with ati-vga ?
I have a page about that too. I admit these aren't easy to find but I've documented everything somewhere. This is mentioned on ati-vga development page but that refers to an earlier bug ticket with sam460ex that wasn't moved to codeberg so maybe it's not obvious. TL;DR: BIOS emulators in PPC firmwares can't run QEMU default vgabios, it still works, you can type commands and they run but you'll only get errors instead of output. You need a VGA ROM that works, either the generic Bochs VGABIOS or a ROM matching the emulated card. There are some BIOSes at the Rage128Pro vgamuseum page from which rage128progl16mb.VBI should work as -device ati-vga,romfile= rage128progl16mb.VBI
@kas1e ati-vga is also very useful for configuring u-boot for the A1 and for simply booting Linux on QEMU for the A1 and PEG2. I always try to provide the syntax I use to run QEMU Here’s an example and a ROM that works https://www.amigans.net/modules/newbb/ ... id=160195#forumpost160195
If you need to quickly run Linux on QEMU PEG2 – I once made a quick image with kernel 5.15 https://github.com/smarkusg/adelielinux-pegasos-2/releases this file ‘Adelie_qemu_test.tar.xz’ Don’t worry about the kernel errors (they stem from things that are partially unimplemented in QEMU, such as the network card... on Peg2).
For sure not work on latest public QEMU, just casual "guest has not initialized display" and in console :
UNHANDLED INT 10 FUNCTION 0007 WITHIN EMULATION
EA: BYTE READ FROM UNINITIALIZED LOW MEM 0000:0487
EA: BYTE READ FROM UNINITIALIZED LOW MEM 0000:048A
entering main read/eval loop...
@smarkusg Only "VGABIOS-lgpl-latest.banshee.bin" were working for you ? I tried now just "./qemu-system-ppc -machine pegasos2 -bios pegasos2.rom -serial stdio -vga none -device ati-vga,romfile=rage128progl16mb.VBI" , and all i have on serial when video should be initialized that:
SmartFirmware:
cpu0: PowerPC,74x7 CPUClock 1533 Mhz BUSClock 133 Mhz (Version 0x8002,0x0102)
no/bad nvramrc - performing default startup script
channel 1 unit 0 : atapi | QEMU DVD-ROM | 2.5+
ATA device not present or not responding
UNHANDLED INT 10 FUNCTION 0007 WITHIN EMULATION
EA: BYTE READ FROM UNINITIALIZED LOW MEM 0000:0487
EA: BYTE READ FROM UNINITIALIZED LOW MEM 0000:048A
entering main read/eval loop...
@kas1e I'm on a different machine at the moment – have a look at the one that's working for me right now. I'll send you a link if you want one qemu-system-ppc -machine pegasos2 -bios pegasos2.rom -serial stdio -vga none -device ati-vga,vgamem_mb=32,romfile=‘rage128pro 32mb.BIN’,guest_hwcursor=true -m 1024
Various ‘bin’ files work – even the one I remember from Voodoo3
@kas1e On this machine, I checked and took a screenshot: "QEMU emulator version 8.0.90 (v8.1.0-rc0-dirty) Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers " This isn’t my testing/work machine. It’s an old X86_64 laptop because I had to remove the NVMe drive from it and connect an SSD for other tests. I booted up a copy of Ubuntu from a backup and am checking how it works. Hmm... if it’s not working for you, that’s odd. Have a look at QEMU9 to see if it works for you. Or I don’t know what... lately I’ve got the impression that everything’s working for me
@kas1e I haven’t used PEG2 with a “ROM” for ages. I often test things starting with the “PRE” version of QEM9 (which was the most efficient for me) and then check on newer versions. You might be right – have a look at QEM9/10 and the ROM I sent you, e.g. via PM. Sorry for misleading you. As I said, I haven’t tested the PEG2 ROM for quite some time. I’ve no way of checking right now. I’ll check it and add to this message.
@kas1e These used to work but haven't tested it recently. The parallel port issue you found has not been fixed and as I predicted I forgot. I've tried now and these VGA ROMs indeed don't seem to work for me either but did not debug it yet. However your problem with amigaboot.of is very likely not related to display as it should boot even without any vga card (like -vga none -device sm501) so if you get output on serial you can use that and stop trying ati-vga. To find the issue with amigaboot.of here are some tips: If there's a debug in SF that you compile for the openfirmware client interface enable it to see what amigaboot.of calls. Also make a dump-all with the original firmware and yours and compare them if there are any differences. Maybe those can show where something is missing. EDIT: OK quick patch is to comment out:
qemu/hw/isa/vt82c686.c::vt8231_superio_cfg_write()
case 0xf6:
// isa_parallel_set_iobase(sc->superio.parallel[0], data << 2);
that disables remapping parallel port address so it won't cover the vga and with that at least rage128progl16mb.VBI works. But as I said this likely won't make a differnce for your problem. (I likely won't be able to make a proper fix because this stems from interaction of different devices vga and parallel that are only indirectly used and not controlled by vt82xx. Two possible fixes I've noted before could be changing priorities but that's out of control of vt82xx or emulating enabling/disabling ECP+EPP features of parallel which could be done but: 1. currently parallel device emulation has no switch for advanced features so it's always enabled 2. vga and parallel are very basic devices used by a lot of machines so changing it could break something I don't know about or would need migration compatibility that I can't test so it's just too much work for something that does not normally cause problems for most users.)
Edited by balaton on 2026/4/17 21:03:09 Edited by balaton on 2026/4/17 21:04:10
EDIT: OK quick patch is to comment out: qemu/hw/isa/vt82c686.c::vt8231_superio_cfg_write() case 0xf6: // isa_parallel_set_iobase(sc->superio.parallel[0], data << 2);
Thanks! This works !
Quote:
However your problem with amigaboot.of is very likely not related to display
It surely not related, it just i were in need of proper VGA test of original pegasos2.rom, so when i will add uboot'x x86 emulator i will be able to test it the same way on qemu with new ROM, so without fear that i reflash something very broken.
@Balaton amigaboot.of now works, and loader.of load all modules till 100% now, the same exactly 1:1 as original rom !
Issue with loader.of was : i use in SF 0x400000 for its own malloc pool, while its loader.of's area to which it hardcoded to jump. So i moved malloc pool to the top of the ram and it works !
Now, i need to understand why be it original rom or my rom, when i simple boot it like this:
And then do "boot cd amigaboot.of" , and all modules loads up, nothing happens after. Sure i miss something in the command line or so , because botch roms original and my one acts the same : after 100% loading nothing happens.
@kas1e Do you have siliconmotion502.chip in your Kickstart (the Pegasos2 CD does not have it so you need a boot partition on your test disk I think)? You can also set os4_commandline env var to get serial debug and use kernel.debug to see if kernel starts or not.