ps2dev / gsKit

gsKit is a C interface to the PS2 Graphics Synthesizer
Other
107 stars 28 forks source link

Move libc from ps2sdk to newlib #28

Closed rickgaiser closed 5 years ago

rickgaiser commented 5 years ago

This pull request is 1 of 5 pull requests in 5 different repositories. The goal of these pull requests is to completely remove libc from ps2sdk, and use newlib's libc. The result is both a much smaller codebase (19k lines removed, 1k lines added), and also will the ps2 development environment be a lot more standard. So porting an application to (or from) the ps2 will be more easy.

The interface between newlib and ps2sdk is now in the old ps2sdk/ee/libc folder, that compiles into libps2sdkc.a. All file io functions from newlib can now be used and will automatically map to fio, or to fileXio when it's loaded.

The downside to all of this, is that there are some minor incompatibility issues between newlib's libc, and ps2sdk's libc. For instance the include file in ps2sdk included a lot of things from and . So existing code will have to add a few extra header files. Another more problematic incompatibility is with the file 'open' function, and 'fioOpen' and 'fileXioOpen'. Becouse the flags O_RDONLY, O_WRONLY and O_RDWR have been defined differently in newlib and ps2sdk. This has to be fixed by no longer using fioOpen and fileXioOpen, and only using 'open'.

This pull request series consists of 5 parts, resulting in a bootable working OPL elf file:

  1. ps2toolchain, for removing a lot of hacks and updating the ps2 assembly files in newlib. Upgrading to newer versions of newlib will be a lot simpler after this patch. For now it's updated from v1.10.0 to v1.14.0
  2. ps2sdk, mostly for removing libc
  3. gsKit, for compatibility
  4. ps2sdk-ports, for compatibility
  5. open-ps2-loader, for compatbility and a bugfix

It's likely thhat we will run into some small problems for the next couple of weeks, but I'll be actively trying to fix all the problems that may be caused by these changes.

rickgaiser commented 5 years ago

I found some crashes in applications that should not have happened. These need to be fixed first. So to prevent some (or all) PR's to be merged I'm closing them all for now. Apologies for the inconvenience.