aldostools / webMAN-MOD

Extended services for PS3 console (web server, ftp server, netiso, ntfs, ps3mapi, etc.)
https://aldostools.github.io/webMAN-MOD/
GNU General Public License v3.0
1.29k stars 176 forks source link

PS3NetSrv MIPS version #36

Closed Xa6ep closed 7 years ago

Xa6ep commented 7 years ago

Hi, i try to use OLD version of ps3netsrv for MIPS, but it is don't work on my NAS (MIPS32 24KEc Little Endian). Can you compile compatible version, please? Also i asked update ps3netsrv in Entware-NG repository to your version, but they answered this source optimized for Windows and doesn't compatible with Entware toolchain. Entware use old version by dirkvdb. It can't install pkg's and sometimes lose some ISO's.

masterzorag commented 7 years ago

you can run it on linux, with glibc

it's not a static executable, so it must found needed shared libraries

 ps3netsrv: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 2.6.18, BuildID[sha1]=69f1249462d2d2002b638e52179c06a252cbb578, not stripped

Dynamic section at offset 0x1c0 contains 23 entries:
Tag        Type             Name/Value
0x00000001 (NEEDED)         Shared library: [libpthread.so.0]
0x00000001 (NEEDED)         Shared library: [libc.so.6]

Version References:
required from libc.so.6:
0x0d696912 0x00 05 GLIBC_2.2
0x0d696917 0x00 04 GLIBC_2.7
0x0d696910 0x00 03 GLIBC_2.0
required from libpthread.so.0:
0x0d696912 0x00 06 GLIBC_2.2
0x0d696910 0x00 02 GLIBC_2.0

also, on your NAS I can assume is running an uClibc implementation, not a full glibc

Xa6ep commented 7 years ago

Yes, you are absolutely right! It use uClibc instead glibc. I searched on the web, and found one solution for install Glibc libraries on my NAS. It recommended to change Entware-NG to Entware-NG-3X. I'll write about results later. Some more info about my system:

Linux version 3.4.113 ldconfig -v | grep -E "libc.so|libpthread.so" libc.so.0 => libuClibc-1.0.16.so libpthread.so.0 => libpthread-1.0.16.so ld-uClibc.so.1 => ld-uClibc-1.0.16.so

Xa6ep commented 7 years ago

I changed Entware, but nothing changes. Working ps3netsrv from dirkvdb and don't working aldostools.

file ps3netsrv

ps3netsrv: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /opt/lib/ld.so.1, for GNU/Linux 2.6.32, stripped

file ps3netsrv_mips_aldostools

ps3netsrv_mips_aldostools: ELF 32-bit LSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld.so.1, for GNU/Linux 2.6.18, BuildID[sha1]=69f1249462d2d2002b638e52179c06a252cbb578, not stripped

masterzorag commented 7 years ago

try this one

Toolchain from https://github.com/Entware-ng/Entware-ng/commit/80b982e7f71327de6a09eaccb0d54ee9a3915281, built on ppc64 HOST

Xa6ep commented 7 years ago

This one runs, but still doesn't work.

ps3netsrv_MIPS32_r2_static ps3netsrv build 20161211 (mod by aldostools) ps3netsrv_MIPS32_r2_static /media/Main/ ps3netsrv build 20161211 (mod by aldostools) ps3netsrv_MIPS32_r2_static --help ps3netsrv build 20161211 (mod by aldostools)

masterzorag commented 7 years ago

./ps3netsrv_MIPS32_r2_static /path 38008

Xa6ep commented 7 years ago

Same result...

./ps3netsrv_MIPS32_r2_static /media/Main 38008 ps3netsrv build 20161211 (mod by aldostools)

masterzorag commented 7 years ago

this one is built with buildroot toolchain:

sadly, my router is BE and can't do native test qemu-mipsel at least runs included mipsel-test

masterzorag commented 7 years ago

just to do some test on my hardware router, ps3netsrv exits...

shot

Xa6ep commented 7 years ago

Try2 result

./mipsel-test Hello world! ./ps3netsrv /media/Main 38008 ps3netsrv build 20161211 (mod by aldostools) off_t too small!

masterzorag commented 7 years ago

shot here we exit(-1) fine, we have to patch some code to go on... mips 32bits uses 32bits (4byte) data, all is fine

masterzorag commented 7 years ago

@Xa6ep check #39

Xa6ep commented 7 years ago

@masterzorag yes! This version works. Thanks a lot!

masterzorag commented 7 years ago

@Xa6ep, check #40, testing is required

Xa6ep commented 7 years ago

webMAN-MOD/ps3netsrv/bins/mips32/ps3netsrv_mipsel is works. I can't test ps3netsrv_mipseb.

masterzorag commented 7 years ago

Thanks for testing and feedback, I'll keep updating mips32 builds when required...

Kamillux commented 7 years ago

Hi, I have a openwrt on a TL-Wr1043ND v2 router which is a mips32 according to https://wiki.openwrt.org/toh/tp-link/tl-wr1043nd#info but when I try every ps3netsrv from MIPS32 folder i get: root@OpenWrt:/mnt/usb# ls mipsel-test ps3netsrv_MIPS32_r2_static ps3netsrv root@OpenWrt:/mnt/usb# /mnt/usb/ps3netsrv /mnt/usb/ps3netsrv: line 1: syntax error: unexpected "(" root@OpenWrt:/mnt/usb# /mnt/usb/mipsel-test /mnt/usb/mipsel-test: line 1: syntax error: unexpected "(" root@OpenWrt:/mnt/usb# /mnt/usb/ps3netsrv_MIPS32_r2_static /mnt/usb/ps3netsrv_MIPS32_r2_static: line 1: syntax error: unexpected "("

masterzorag commented 7 years ago

@Kamillux I was getting that kind of error due endianess, on your link we can have 2 different chips for the product:
24Kc or 74Kc makes difference, also, you are trying an old ps3netsrv build, last one is at PR #40:
for little or big endian, try them and report back. To get sure, take an executable out from your router and pass it to file program under linux: MSB or LSB executable tells you the endianess.

Kamillux commented 7 years ago

After testing i can tell that i have big endian. ps3netsrv_mipseb works kind of.

'root@OpenWrt:~# /mnt/usb/ps3netsrv_mipseb /mnt/usb/playstation3 38008 ps3netsrv build 20170106 (mod by aldostools) Path: /mnt/usb/playstation3

Waiting for client... Connection from 192.168.1.144`

It connects but doesn't show games on playstation3 webMAN-MOD. I tried ps3netsrv64 1.43.28 on my linux machine and that also did not work (same result as in OpenWrt) but version 1.43.27 works great on desktop linux.

`Waiting for client...

Connection from 192.168.1.144

Connection from 192.168.1.144

Connection from 192.168.1.144

open /PS3ISO/Blur [BLUS30295].iso`

masterzorag commented 7 years ago

To get games shown on webman coloumn you have to refresh xml file (once) or do something asking for connection... I'm used load/unmount/test by using the Web(MAN) interface from pc, refreshing ps3netsrv connection by using NET button in GAMES panel
Did NET games appears in web interface?

Kamillux commented 7 years ago

What I did: load ps3netsrv_mipseb on my router: `_root@OpenWrt:~# /mnt/usb/ps3netsrvmipseb /mnt/usb/playstation3 38008 ps3netsrv build 20170106 (mod by aldostools) Path: /mnt/usb/playstation3

Waiting for client...`

and the on webman interface i click "refresh xml", then i see on router: _`root@OpenWrt:~# /mnt/usb/ps3netsrvmipseb /mnt/usb/playstation3 38008 ps3netsrv build 20170106 (mod by aldostools) Path: /mnt/usb/playstation3

Waiting for client... Connection from 192.168.1.144` <-- my playstation 3

It seems there is a connection but there are no NET games in web interface, list is empty but should be one game.

The same behaviour I get when I try ps3netsrv64 version 1.43.28 on my linux desktop but ps3netsrv64 version 1.43.27 works, there is 1 game in NET folder on WebMan. Maybe some difference between versions

masterzorag commented 7 years ago

@Kamillux at least we have same endianess, we can test on 2 different hardware. I'll take in account, I'll build a debug one for our tests, stay tuned Diff between versions are small, we can track down the issue just adding some debugging messages...

Kamillux commented 7 years ago

@masterzorag ok, I love debugging :)

masterzorag commented 7 years ago

@Kamillux mipseb_debug_static: check commit f6af958d29c31a79dd35efd4e67c9c10edb53a4c It's upx compressed, but not stripped, it includes GDB debugging informations!
Since you love debugging and you running OpenWRT, maybe you can install the GNU Debugger and use it directly on the target...

Kamillux commented 7 years ago

Did initial test without GDB: _root@OpenWrt:~# /mnt/usb/ps3netsrv_mipseb_debug /mnt/usb/playstation3 38008 ps3netsrv build 20170106 (mod by aldostools) offt too small! (4) Path: /mnt/usb/playstation3

_Waiting for client... Connection from 192.168.1.144 client_thread(), client @0x7719f644 command received: 2A12 Unknown command received: 2A12 finalizeclient()

I'll update when I compile GDB

masterzorag commented 7 years ago

I'm assuming endianess problems, seems that we have to reverse multibyte types just on LE targets...

masterzorag commented 7 years ago

@Kamillux try this

Kamillux commented 7 years ago

Still no-go: _root@OpenWrt:~# /mnt/usb/ps3netsrv_mipseb_debug /mnt/usb/playstation3 38008 ps3netsrv build 20170106 (mod by aldostools) offt too small! (4) Path: /mnt/usb/playstation3

_Waiting for client... Connection from 192.168.1.144 client_thread(), client @0x77530644 command received: 2A12 Unknown command received: 2A12 finalizeclient()

masterzorag commented 7 years ago

@Kamillux not tested yet? Any good news? I have updated the binary, check that commit!

Kamillux commented 7 years ago

Sorry for the delay. Yes it lives :D Thank You

masterzorag commented 7 years ago

@Xa6ep can you close this one? No more reason...