@kas1e I don't know but I don't think any OF implementation is still developed since Sun and Apple stopped using it so the one from 20 years ago may still be the latest. If you try to get that ported I'd suggest to first try to reconstruct the pegasos2 ROM so you know better what to do than trying to port it right away to a different platform but maybe it's easier to port in a different way, I don't know. 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. This also includes a low level monitor called IKARUS low level console that is entered when no memory is found. You can force that on QEMU with removing the SPD EEPROM by commenting these lines (and the variable definitions) in qemu/hw/ppc/pegasos.c::pegasos_init()
$ qemu-system-ppc -M pegasos2 -serial mon:stdio -bios pegasos2.rom
PegasosII Boot Strap (c) 2002-2003 bplan GmbH
Running on CPU PVR:80020102
Enable L1 ICache... Done.
Clean/Flush Block enabled
Reading W83194 : FAILED.
Setting Front Side Bus to 133MHz... FAILED.
Configuring DDR... Done.
Configuring PCI0... Done.
Configuring PCI1... Done.
Configuring ETH... Done.
Releasing IDE reset ... Done.
Configuring Legacy Devices
Initializing KBD... Done.
Testing 00000000 Bytes, Pass: 00000000 Failed: 00000000
RAM TEST (fill linear)... Done.
FFFFFFFF
Entering IKARUS low level console
>
This has a helpful help command: pressing ? prints #RTFM but there's some info on this here. The output above shows what this code is doing and you can probably trace on QEMU what registers these access so to reconstruct it you'd need to reverse and reimplement it then combine with the SmartFirmware. If SmartFirmware has a compressed loader then this may be based on that with the above hardware init added. if that loader is not in SmartFirmware it may be similar to what PMON does. The most complex part is probably getting SPD data over i2c and init the memory controller based on that. I've asked bPlan before if they could open source their part but I never got any answer from them. Genesi open sourced what they had including the full schematics that I've linked from my page about Pegasos2 emulation.
@balaton So if this 20 years old one is one used by peg2 and broadcom (and then x1000 with fixes) then yeah, that one way to go. And yes, if go that way firstly pegasos2 then, because easy to test basics on qemu before real reflashing. Then after can be adapted to x1000.
Yes, it looks for all block devices : i already made USB boot working by adding to relevant pci@13 a node with "block" and correct methods and amigaboot finds it fine (together with HDD and CD), see (UDH2n that usb stick + CD + DH0):
Amazing that it worked. I would have expected it to be harder. Needing to hook into USB driver routines and code a custom seek and read method.
Quote:
I didn't use static addresses already : because i even with sata have issues when user have added one or more PCI card at top, or have 2 gfx cards at the same time, and addresses shifts.
Quote:
For sata i scan heap on known range for a pci@12\0 string + some checks. The same i do now for USB, i simple scan for "pci@13\0", and then scans for usbmass_driver struct for "Mass-Storage Device" string.
I would have expected the SATA ports to be mapped to one hardware address for IDE registers. I suppose it's not as simple as serial, if it's sitting on PCI bus and SATA ports don't have an exact hardware address.
I wonder if CFE reads a static device tree from ROM or dynamic from memory? With the devtree option. The extra SATA devices were "blocked" in but when I listed the devtree I didn't see any extra "block" devices for any USB devices. I saved a serial log so can go back and check.
The extra SATA devices were "blocked" in but when I listed the devtree I didn't see any extra "block" devices for any USB devices. I saved a serial log so can go back and check.
All i can say currently that i know where in memory dev tree placed, and how to change/add things to it, but how it were build by CFE dunno..
By default CFE didn't create "block" devices in devtree for USB massstorages, as well as it didn't use channel1 at all so also not add any blocks there.
More of it, devtree is static, so nothing updated in (except some easy bits like envs, etc), it just builds one time on run.
What i did for both sata and usbsticks is create "block" devices + correct method for read/seek/etc. But this method i simple copy by memory dump from working block devices in channel0 , and then create new nodes with block devices for other originally non working sata ports as well as for usb devices. But by default, there is simple channel0 (port0 and 2) in cfe, and no port 1/3 , and no usb. For usb i hook detach/attach usb functions, so when attach - create node with block, when detach - remove one. And amigaboot happy about )
@Joerg Want to create SFS2 reading-loading supportIs in CFE, and can you plz say if SFS sources on os4depot is SFS0/1 ones, but the one OS4's SFS2 is the same just large file support added with a bit changed structure ?
AFAIK amigaboot.(of|ub) includes (a port of) my SFS functions from SLB_v2, which should support both SFS\0 and SFS\2.
SFS sources on os4depot.net??? The (sources of the) SFS tools included in https://os4depot.net/?function=showfil ... driver/filesystem/sfs.lha should work with any SFS version since they just use the SFS specific DOS packets and don't access SFS blocks on the disk directly.
All public SFS sources, https://sourceforge.net/p/smartfilesystem/code/ (IIRC an old version, maybe 1.58, GPL), ACube's Parthenope/ub2lb SFS implementation and the AROS port are SFS\0 only. MorphOS is SFS\0 only as well, but like me, Olsen and several other developers, one of the AROS developers, one of the MorphOS developers (IIRC Ralph Schmidt), etc. got the last version of John's SFS sources, version 1.84. In total there should be about 5-6 developers who got John's last version of the SFS sources, without any usage restrictions like GPL.
Additionally there is, or was, a very broken SFS re-implenaation in Linux not based on the original SFS sources but only on it's documentation, but only use it in read-only mode, unless you need an easy way to destroy SFS partitions
@joerg Amigaboot support it for sure, but CFE is not : i.e. i can't dir/boot amigaboot from SFS2 formatted media, so that what i add.
I just add it as "Read only", because i only need dir, load, boot to work, and find out that when i tried to make it based on this sources from os4depot, that structure in compare changes in sfs2, so i had again to shifts offsets, etc.
@All I start to have some issues , called "i run out of space for all hooks/trampolines/structs/buffers i use for all the pathes". On the boot i see that:
Total memory used by CFE: 0x7FD1DF60 - 0x80000000 (3023008)
Initialized Data: 0x7FDD8420 - 0x7FDF8B00 (132832)
BSS Area: 0x7FDF8B00 - 0x7FDFF000 (25856)
Local Heap: 0x7FDFF000 - 0x7FFFF000 (2097152)
Stack Area: 0x7FFFF000 - 0x80000000 (4096)
Text (code) segment: 0x7FD1DF60 - 0x7FDCBE60 (712448)
Relocation Factor: I:7FE1DF60 - D:7FE1DF60
I start to use this GAP area for all my things, and, find out now that this GAP not _that_ GAP i were hoping for and seems used for some CFE base things, because once i reach 0x7FDD7200, i cause issues with CFE parts (freezes after programs execution, etc). Another address prior that are fine (well, at least i think so, who know for what it also used).
Before i tried to use some other areas, but meet with kernel allocations after the modules loads up.
Question is: what the area is 100% safe to be used, at least 1-2megabytes, which stays the same does not matter which memory-config user have. Any ideas ?