PS2 Julian's various PS2 projects (Worklog)

What's left to RE in terms of IOP system modules?

CDVDFSV - see https://www.psx-place.com/threads/various-ps2-projects.20977/page-17#post-367696
CDVDMAN - see https://www.psx-place.com/threads/various-ps2-projects.20977/page-17#post-367696
CLEARSPU - need to label some register writes
DMACMAN - done
EESYNC - done
EXCEPMAN - need module relocation first
FILEIO - done
HEAPLIB - need to check on structure offsets
IGREETING - need to check on some flash ROM identification related commands
INTRMANI/INTRMANP - need module relocation first
IOMAN - done
LOADCORE - need module relocation first
LOADFILE - done
MODLOAD - done
REBOOT - done
SECRMAN - done
SIFCMD - haven't really looked yet
SIFINIT - haven't really looked yet
SIFMAN - haven't really looked yet
SIO2MAN - done
SSBUSC - done
STDIO - done
SYSCLIB - done
SYSMEM - need module relocation first
THREADMAN - done
TIMEMANI/TIMEMANP - need to diff "p" variant
UDNL - done
VBLANK - haven't really looked yet
 
It seems like a recently announced product will have support for managing save files from another device using a web browser. But it is most likely specific to that product and can't access files from real memory cards, HDD, or USB. And it can't access VMCs either.

But I guess "wait and see" may be an option... Would be nice to have a "Browser" implementation where you can see all your save data from one program.
 
So I've been looking into WebAudio, XAudio/FAudio, OpenSLES, and SDL3's AudioStreams lately.

What they all have in common is a way to put data into a stream, and a callback notifying that the data has finished playing.
(OpenAL doesn't have the callback functionality).

It would be nice to have something similar for the SPU for smooth audio playback and mixing.
 
How to create a shared library...

Code:
mips64r5900el-ps2-elf-gcc input_source.c -Wl,-Bshareable -nostartfiles -fPIC -mabicalls -G0 -Wl,-Bdynamic -Wl,-zdefs library_to_link_against.so -Wl,-Bstatic -o output_library.so

---

Toolchain changes for shared object enablement
https://github.com/ps2dev/binutils-gdb/pull/2
https://github.com/ps2dev/gcc/pull/3

After changes...
Code:
mips64r5900el-ps2-elf-gcc input_source.c -Wl,-Bshareable -nostartfiles -Wl,-Bdynamic -Wl,-zdefs library_to_link_against.so -Wl,-Bstatic -o output_library.so
 
Last edited:
Made some progress on the shared object loader.
Mainly, I'm basing it on musl libc's implementation.

DSO means Dynamic Shared Object
musl libc has a dlclose function, but basically all it does is it checks if it is loaded and returns the correct result. Doesn't actually unmap or clean up anything

Basically the following has been removed:
* TLS relocation support
* Multi threaded guards
* Library path
* Library rpath
* Library preload
* dlerror (outputs to stderr instead)
* kernel mapped handling
* FDPIC/loadmap handling
* 64 bit filesystem symbol redirection
* Self loading protection
* Malloc donate extra space
* mmap on existing mapping
* inode check
* fork handling
* Code for jumping to executable
* aux vector related
* uid/gid/secure checks
* vdso support
* malloc/aligned_alloc replacements
* time64 redirection
* dl_iterate_phdr
 
Raspberry Pi 5 seems to be announced.

The headliner feature for me is that the PCIe bus is exposed through a connector (no more needing to desolder the USB3/ethernet chip).
So maybe once I dabble into PCB design I could take a look at making my own PICMG 1.2 half card...
 
Compiling GCC 2.95.2 using newer GCC is a pain. It would be simpler to use a similar GCC version during that time period.

RedHat Linux 6.2 uses EGCS 1.1.2.
PS2 Linux uses GCC 2.95.2.
RedHat Linux 7.0 uses GCC 2.96.

Also, it would be easier to use a similar rpm version for building them. Packages built with RPM 4.x are incompatible with RPM 3.x. Thankfully, RH6.2 already has the same RPM version as PS2L.
Someone attempted to cross compile rpm packages. https://rpm-list.redhat.narkive.com/ZLK76m2C/cross-compiling-rpm-packages
 
Probably when I add more posix path syntax support to ps2sdk, this is how I plan for it to work on user facing side:
1. call function e.g. ps2sdk_enable_posix_path()
2. instead of e.g. mc0:/filepath, can do e.g. /mnt/mc/0/filepath

I plan to implement it using a mount table. E.g. pass in a path and it will find the ioman path corresponding to the longest matching posix path
Bind mounts should also be possible using this method also.

This idea is inspired by cygwin. References:
https://github.com/mirror/newlib-cy...586f61a7b83d5cb5af501194/winsup/utils/path.cc
https://github.com/mirror/newlib-cy...86f61a7b83d5cb5af501194/winsup/utils/mount.cc

Maybe I can get closer to fchdir support...

---

To differentiate between ioman paths and web browser URIs, just check the amount of slashes at the end.

If it is an ioman path, it has 0 (relative) or 1 (absolute) slashes.
Example:
mc0:APPS/BOOT.ELF
mc0:/APPS/BOOT.ELF

If it is a web browser path, it has at least 2 slashes.
Example:
https://www.psx-place.com/forums/
file:///home/uyjulian/Documents/test.html
file://mc0:/APPS/BOOT.ELF
 
If I decide to do some converter for savefile ICO 3D model files, I'll probably write a converter to/from glTF 2.0.
I initially looked at writing a Blender plugin but decided against it due to breaking API changes, basically making it not portable to newer version and stuck at that specific version.

---

I'd like to eventually make ps2sdk-ports use the ExternalProject support of CMake.
 
Last edited:
Some ideas have been made more generalized. So, they are no longer PS2 specific projects anymore, and as such I removed them from the OP.

I'm already pretty doing this as a KVM over IP ( https://github.com/pikvm/pikvm ):
* TOOL as a service (Remote access to a PS2 TOOL using ssh including video streaming, and dsnet access)

Can be made more portable using OpenAL/OpenSLES:
* POSIX/SDL2 port of libsd
* SPC700 (SFC) playback over libsd
* CSL RE/reimplementation

Qt and/or ncurses can probably do this better (and is better maintained):
* libosd RE/reimplementation
* Open source UI library based on OSDSYS assets
 
There seems to be basically 3 options for USB network:

* RNDIS
* CDC-ECM (cdc_ether)
* usbnet (e.g. Prolific based transfer cable)

Would be really nice if you could just plug in your phone into your PS2, enable tethering, and boom, you are online. No network adapters, no wireless bridges, no Ethernet.
 
It seems like the driver for the Kawasaki LSI KL5KUSB101B USB Ethernet device in ps2eth is based off one in FreeBSD. I wonder if it actually works and how the porting process goes... I bought a Netgear EA101 off of eBay for cheap so I wonder how that will go. It seems this one requires firmware to be loaded, and the FreeBSD driver has that embedded as an AOB.

In SCE software there exists a driver for ADMtek AN986/ADM8511 Pegasus family 10/100 USB Ethernet device. Apparently they say it is based on reversed engineered information, not an official driver, couldn't get the official manufacturer to provide specific drivers for the network stack, and to not ship the driver with titles. I wonder if it is based on the FreeBSD driver. I also bought a Netgear FA101 off of eBay for cheap so I can check that also.
 
Last edited:
A problem with building ps2dev for macOS and Windows is that e.g. msys2 and Xcode will update stuff, and compilation will break.
Also, another problem is needing to build binaries for three different platforms.

I've been taking a look at Cosmopolitan libc, which is a component that allows building a single executable that can run on all three platforms: https://github.com/jart/cosmopolitan

---

The shared loader library will probably be incubated in another project before being submitted to ps2sdk-ports. I'd like to at least iron out the issues in an environment where there is a debugger more easily available (instead of just black screen)

---

Things I would really like to do:
* Fix the libcurl random hang issue
* Make it easier to connect PS2 to the Internet with things you already have, like a smartphone

These are some steps in making the user experience more friendly...
 

Similar threads

Back
Top