Originally Posted by doctorxyz
It's strange why I didn't find these posts with Google though. :S
But then again, I didn't search really hard this time.
So in other words, all these weak functions were added in, just to work around issues that arise from the GCC/newlib/PS2SDK hybrid toolchain? That's fine.
In that case, if the weak functions are all still required, I'll leave them there.
I'll like to propose the following changes to the CRT:
- The new ExecPS2 patch (for the protokernel) should be run before main() is called.
- The code that runs after main() returns should be fixed, as it seems like the PS2 always freezes when main() returns. :S
- The BSS sections shouldn't need to be wiped in the CRT, as the loader should take care of it (If loaded by LoadExecPS2(), the EE kernel will take care of it. If loaded with SifLoadElf + ExecPS2(), the ELF loader should take care of it).
And, about the different SDK module versions: Maybe we should split up the PS2SDK, like Sony has been doing (Every IOPRP image has a matching PS2SDK version).
One will support the default modules, while one will support the newer modules that are found in ROM (Those X-modules, which will be loaded by reseting the IOP with rom0:OSDCNF) and those free* modules.
The boot ROM actually contains modules that are used in two separate PS2SDK versions, hence why we have the non-X modules and X-modules.
The developer should probably choose which SDK would be used, and develop using it. The IOP should be reset to contain the right modules (If not using the default modules), using the right IOPRP image. We can then not worry about IOP module incompatibility. There won't be a need to write modules that automatically adapt to the different standards used by different modules like SIO2MAN, and those "extension" modules like IOMANX can be converted into full, standalone modules.
In other words, maybe it should be structured like this:
1. PS2SDK -> Base PS2SDK that fits the default modules in rom0:
2. XPS2SDK -> Extended PS2SDK that fits the X-modules and the free* replacement modules in the PS2SDK. IOMANX can become a full IOMAN module that will go into an IOPRP image.
3. PS2SDK-common -> Everything else in the current PS2SDK that isn't dependent on the IOP modules used (e.g. sound, graphics and network libraries).
Oh, and I learned why Sony software may not reset the IOP: When a program is loaded, it can be assumed that the IOP has been already reset with the default modules (NULL was specified). In other words, an IOP reset is not required if the default modules are being used with a matching PS2SDK version.
I don't know if all the homebrew loaders currently reset the IOP before invoking ExecPS2 (Like EELOAD does) though. :/
(If we now do what Sony has always been doing, the new software generated may not work well on some of the existing non-Sony loaders)
Last edited by SP193; 03-13-2013 at 03:25 AM.
SCPH-10000 S. MINOKAMO v1.01 (Defunct)
SCPH-10000 S. KISARAZU v1.00 (faulty)
SCPH-15000 S. KOHDA (With warranty seal!) :D
DESR-5100 S. EMCS