| View previous topic :: View next topic |
| Author |
Message |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Apr 11, 2010 7:07 am Post subject: How to debug with PSPLINK? TyRaNiD - HELP! |
|
|
Here goes my work...
I've created a ISO with a usermode homebrew as EBOOT.BIN, so I wanted to know how I'd go and debug that with PSPLINK (by loading it as a plugin).
It's mostly about the usual printf... I need to log some debug messages in a quick and easy way...
Right now I'm using a handcrafted debuglog function which outputs to memory stick in a logfile... but sadly this is too slow for my needs... cause some functions timeout due to the long flush rates...
Ive tried with sceKernelPrintf and Kprintf (which doesnt work in usermode btw...) >_>
So I wanna know from you experts,... just how do I have to code my program so I can directly output into the PSPLink USB Shell?
I need this desperately cause I don't know how I'm ment to speed up the logging process otherwise and still make PROPER use of it... _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
arnie
Joined: 11 Apr 2009 Posts: 16
|
Posted: Sun Apr 11, 2010 9:27 am Post subject: |
|
|
I thought you could just use pspdebug library and then do a pspDebugScreenPrintf. PSPLink should pick it up and display it on the shell.
-Arnie |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Apr 11, 2010 6:42 pm Post subject: |
|
|
Sadly I cannot use the debugscreen... as the tool is running next to a retail game...
The new handcrafted EBOOT loads and starts the retail game... thus the retail game picks the screen up making the debugscreen unuseable... _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Sun Apr 11, 2010 10:08 pm Post subject: |
|
|
Years ago i have made a printf like function over udp for the psp if you are interested i can
take a look in my old backups. The client displaying the result of the debug of the psp was written in java and was running on my pc
I have choosen udp because even at high rate of debug messages the only think that can happen is the drop of 1 or 2 messages |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Apr 11, 2010 10:52 pm Post subject: |
|
|
That would be nice to have but there HAS to be a way to do it in PSPLINK, afterall I've been able to capture several messages from retail games like Wild Arms: Crossfire. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Mon Apr 12, 2010 5:53 am Post subject: |
|
|
| Code: | #define PSPLINK_OUT 2
sceIoWrite(PSPLINK_OUT, description, strlen(description)); |
_________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Mon Apr 12, 2010 7:59 am Post subject: |
|
|
Sir you rule... amen. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Tue Apr 13, 2010 12:28 am Post subject: |
|
|
Didn't work... :(
No output at all in pspsh... sadly... _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Tue Apr 13, 2010 3:13 am Post subject: |
|
|
Normaly the handle with value of 2 is stderr
Value 0 = stdin Value 1 = stdout and Value of 2 = stderr |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Tue Apr 13, 2010 6:18 am Post subject: |
|
|
I will give a value of 1 a test lateron, but shouldn't stderr display in pspsh too? :( _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Wed Apr 14, 2010 6:34 am Post subject: |
|
|
Okay, posting my POSITIVE results here...
1. Works with sceIoWrite(1, buffer, strlen(buffer));
2. Only works with pcterm tool, not with pspsh.
Thanks for all the help guys! ^^
Sadly it misses some early on debugging messages... I guess PSPLink isn't loaded fast enough to capture those, but otherwise it's working very well now. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Thu Apr 15, 2010 8:03 am Post subject: |
|
|
Works perfectly for me with file descriptor 2. Maybe it's a Windows issue with the drivers needed for PSP Type B. In Linux it works absolutely fine. Could also be because I remember you said you didn't use usbhostfs.prx. _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
unsigned int
Joined: 13 Aug 2009 Posts: 22
|
Posted: Thu Apr 15, 2010 4:13 pm Post subject: |
|
|
| Stdout and Stderr output in pspsh work for me on Win7 64 and XP. Also, you have to use psplink.prx, not usbhostfs.prx as plugin for debugging with psplink. |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Fri Apr 16, 2010 5:13 am Post subject: |
|
|
Yeah, psplink.prx is pretty obvious. I mean I use both of them. If you only use psplink.prx, then obviously that's not why it's not working for Coldbird. _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
unsigned int
Joined: 13 Aug 2009 Posts: 22
|
Posted: Fri Apr 16, 2010 5:56 am Post subject: |
|
|
I think you are only seeing stdout messages because you are not using pspsh, but pcterm.
Usbhostfs_pc listens on port 10000 to 10003 for connections and outputs stdout on 10002 and stderr on 10003. You can only connect to one of the ports with a terminal program.
m0skit0: When I wrote this I was under the impression that you could load either usbhostfs.prx or psplink.prx, but I was wrong. Both can be enabled at the same time, doesn't make a difference for me. |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Apr 18, 2010 8:27 pm Post subject: |
|
|
To move some things into the right direction:
1. Im using Linux, you can't be serious about using PSPLink on Windows... urgh...
2. I know how PSPLink forwards the specific messages as I usually spend a lot of time trying to figure things out myself before I ask on these forums.
3. The reason I did ask in the end was because even though all seemed fine it didn't work... pspsh simply didnt display the thing even though the connection was up and working.
I don't know what is the cause of it not working with pspsh for me, but as it's working in pcterm I'm not bothered by the problem anymore. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Apr 19, 2010 2:54 am Post subject: |
|
|
| I have no idea why it wouldn't work, although the stdio stuff in the kernel has done some odd things along the line, for example they broken fdprintf at one point and I think the kernel libc printf uses that, so that might explain something. You could try using Kprintf and the usbkprintf driver from psplinkusb's tools directory which probably will still work, maybe ;) |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Mon Apr 19, 2010 4:16 am Post subject: |
|
|
Kprintf is no option as the homebrew app Im using is a usermode homebrew...
To use that I'd have to create a kernel wrapper module re-exporting it as a syscall for user calling...
I got it working with sceIoWrite + Stdout + pcterm afterall... so Im happy. :D _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
m0skit0
Joined: 02 Jun 2009 Posts: 226
|
Posted: Wed Apr 21, 2010 9:02 am Post subject: |
|
|
I guess you're running pspsh with root permissions, right? _________________
| The Incredible Bill Gates wrote: | | The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. |
|
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Fri Apr 23, 2010 12:39 am Post subject: |
|
|
| m0skit0 wrote: | | I guess you're running pspsh with root permissions, right? |
No, but I figured out why pcterm was the only thing working.
I still had the pcterm=1 flag in the psplink.ini file.
Removing it made the thing work with pspsh. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
|