Page 1 of 1

How to change ps2link tcpip driver version ?

Posted: Mon May 17, 2004 6:14 am
by skeet
Hi, I just build up the tool chain, and get ee sample to compile, and launched it with ps2link (with Playstation 2 Independance exploit)

Now, I want to write an application wich uses ee tcpip api to send/recv data from a PC, the problem is I don't know when i recv data, and I want to be able to send data anytime.
So my first try was to create a thread wich call recv() in a loop and let the main thread call send(), but it seams that you can't do that, recv() wait for data and send wait recv finish or something like this.
So, I try a different method, checking if there is data to read before calling recv(), so I try to use select(), and here is where I get stuck. ps2link use an old version of ps2ips.irx without select command, if I load one of the latest version of this irx, it doesn't work, even send don't work anymore(always sending zero bytes), I have to use the irx given with ps2link.

I'm wondering if there is a way to either unload irx files ps2link is using and load new ones (wich i don't think is possible) or change the irx on the mc to the latest one without compiling naplink with ps2sdk ? (I don't know if the cvs version of ps2link can compile right now with ps2sdk)

If it's impossible, I could use naplink with the swap trick(or try to put it on mc), but I would prefer a ps2link solution. Another question, in case I will have to use naplink, do I need to load anything else than : ps2ip.irx, ps2smap.irx, ps2ips.irx to use ee tcpip api ?
Because last time I try to launch ee-echo with naplink it does'nt work.

If you have any idea please reply, even if it s just a hint, or a way to explore :)

Posted: Mon May 17, 2004 8:52 am
by Oobles
All I can sorry! The world of ps2dev is still full of incompatibilities and things that are broken. You're absolutely right about the ps2ip version used in ps2link does not contain a working select().

You're also right that the latest version of ps2ip which is contained in ps2sdk does contain a working select(). When I wrote send0r, I found the best way to deal with the problem of imcompatibliities is to reboot the IOP and reload ps2ip with a known working version.

If you don't want to bother with rebooting IOP and reloading ps2ip then you can help out with the latest ps2link. The version in CVS has been reconfigured to compile with ps2sdk which will give you latest ps2ip and select().

The other solution to your problem is to go back to having a read thread.. and write on a seperate thread. The difficulty with this is that you do need to synchronise your access to the port. You can do that with semaphores to some extent.

Also, if you are using a single port to do different tasks, you may find it better to open a second port to the host. Also try and stick to request/reply protocols as used in HTTP. This is much simpler to code and creates less timing problems and other pain.

Hope it helps,
Oobles.

Posted: Tue May 18, 2004 4:21 am
by skeet
Oobles wrote: ...

The other solution to your problem is to go back to having a read thread.. and write on a seperate thread. The difficulty with this is that you do need to synchronise your access to the port. You can do that with semaphores to some extent.

...

Hope it helps,
Oobles.

Thanks for the advices, I have managed to compile the iop-echo sample and modify it so one thread call send() and another call recv().
It's a good point to start, I think, now I have to add rpc stuff so my ee thread can get received data, and protect the shared data with sema.

May be my first try with ee threads did'nt work because I have to reload some irx each time I creata an ee thread ... I will check this later, but I like the irx solution :)