Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
74 user(s) are online (49 user(s) are browsing Forums)

Members: 1
Guests: 73

Georg, more...

Support us!

Headlines

 
  Register To Post  

(1) 2 »
pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Balaton
Quote:

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.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Balaton

Was able to build stubbed OF for pegasos2, zip it, put it together with bootstrap to the rom , and:

(hit open in new tab)
Resized Image

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 :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@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.

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@smarkusg

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

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@kas1e
Oh, OK.
I misunderstood what you wanted to do, and the QEMU screenshot misled me.
Good luck

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@All

(open in new tab for full size)
Resized Image

That mean:

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
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@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.

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Balaton
Quote:

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:

PS D:\qemu-test\qemu-win-install> .\qemu-system-ppc -machine pegasos2 -bios pegasos2.rom_orig -serial stdio -vga none -device ati-vga -m 1024
PegasosII Boot Strap 
(c2002-2003 bplan GmbH
Running on CPU PVR
:80020102
Enable L1 ICache
...                                                    Done.
..... 
snip ....

SmartFirmware:
cpu0PowerPC,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
INTERNAL ERROR
0000000E=UNIMPLEMENTED EXTENDED OPCODE

EAX
=0000 EBX=0000 ECX=2222 EDX=3333 ESP=0000 EBP=0000 ESI=6666 EDI=0000
 AX
=FF55  BX=FFA6  CX=2222  DX=3333  SP=FF82  BP=FF9A  SI=6666  DI=0000
 DS
=1000  ES=BAD0  SS=1000  CS=C000  IP=2CDF   NV UP -- PL NZ NA PE NC
CS
:IP 0F
STACK
0000 0000 0000 0000 0000 0000 FFDA 0000
  00
FE00 F000 FE01 F000 FE02 F000 FE03 F000
  10
FE04 F000 FE05 F000 FE06 F000 FE07 F000
  20
FE08 F000 FE09 F000 FE0A F000 FE0B F000
  30
FE0C F000 FE0D F000 FE0E F000 FE0F F000
  40
FE10 F000 FE11 F000 FE12 F000 FE13 F000
  50
FE14 F000 FE15 F000 FE16 F000 FE17 F000
  60
FE18 F000 FE19 F000 FE1A F000 FE1B F000
  70
FE1C F000 FE1D F000 FE1E F000 FE1F F000
  80
FE20 F000 FE21 F000 FE22 F000 FE23 F000
  90
FE24 F000 FE25 F000 FE26 F000 FE27 F000
  A0
FE28 F000 FE29 F000 FE2A F000 FE2B F000
  B0
FE2C F000 FE2D F000 FE2E F000 FE2F F000
  C0
FE30 F000 FE31 F000 FE32 F000 FE33 F000
  D0
FE34 F000 FE35 F000 FE36 F000 FE37 F000


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):

Resized Image

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.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@kas1e
Quote:
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

Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@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).

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@balaton
Thanks for point , but this one:
./qemu-system-ppc -machine pegasos2 -bios pegasos2.rom -serial stdio -vga none -device ati-vga,romfile=rage128progl16mb.VBI


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
EABYTE 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:
cpu0PowerPC,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
EABYTE READ FROM UNINITIALIZED LOW MEM 0000:048A
entering main read
/eval loop...


And screen not initialized, same "no guest blabla". But i also found from year 2025 this mail: https://lists.nongnu.org/archive/html/ ... vel/2025-05/msg05898.html Like it was broken since, not sure if it was fixed or not..

Tried VGABIOS-lgpl-latest.banshee.bin:

./qemu-system-ppc -machine pegasos2 -bios pegasos2.rom -serial stdio -device ati-vga,romfile=VGABIOS-lgpl-latest-banshee.bin


Also fail! Wtf ..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@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

Resized Image

Various ‘bin’ files work – even the one I remember from Voodoo3

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@smarkusg
What version of qemu you use btw ? Just can't get it to work with exactly your strings. Just same "guest has not initalized the display"..

I just fear is that "35a6380b4ed27f^" commit which still not fixed step in


Edited by kas1e on 2026/4/17 20:11:16
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@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

Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Smarkusg
See: https://lists.nongnu.org/archive/html/ ... vel/2025-05/msg05898.html

it start to looks like all versions after ~2025 somewhere (or even 2024) start to have this bug.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Quite a regular
Quite a regular


See User information
@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.

Go to top
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@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
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@Balaton
Quote:

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.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Home away from home
Home away from home


See User information
@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:

.\qemu-system-ppc-debug.exe -M pegasos2 -bios .\pegasos2.rom_orig -vga none -serial stdio -device sm501 -m 1024 -cdrom Pegasos2InstallCD-53.54.iso -hda test_disk.img


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.

Need to re-read your installation docs!

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: pegasos2: rom reconstruction
Just can't stay away
Just can't stay away


See User information
@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.

Go to top

  Register To Post
(1) 2 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )



Polls
Running AmigaOS 4 on?
AmigaOne SE/XE or microA1 12% (26)
Pegasos2 3% (8)
X5000 22% (48)
X1000 14% (30)
A1222 8% (19)
Sam 440/460 18% (40)
Classic PowerPC Amiga 2% (6)
WinUAE emulation 7% (16)
Qemu emulation 9% (21)
Total Votes: 214
The poll closed at 2025/12/1 12:00
8 Comments


Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project