| View previous topic :: View next topic |
| Author |
Message |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Thu Mar 26, 2009 7:12 am Post subject: Debug PRX |
|
|
How can I debug a kernel PRX?
printf on screen or writing to a file or ...? |
|
| Back to top |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Thu Mar 26, 2009 9:33 am Post subject: |
|
|
Be creative :). _________________ Programming with:
Geany + Latest PSPSDK from svn |
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Thu Mar 26, 2009 5:30 pm Post subject: |
|
|
| a hint please? :P |
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Thu Mar 26, 2009 8:09 pm Post subject: |
|
|
I've tried both printf and Kprintf but none of them seems to work.
I've also tried this (from psplink.h):
| Code: |
#define DEBUG_START { int fd; fd = sceIoOpen("ms0:/debug.txt", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0666); sceIoClose(fd); }
`
#define DEBUG_PRINTF(fmt, ...) \
{ \
int fd; \
fd = sceIoOpen("ms0:/debug.txt", PSP_O_WRONLY | PSP_O_APPEND, 0666); \
fdprintf(fd, fmt, ## __VA_ARGS__); \
sceIoClose(fd); \
}
|
still nothing :( |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Thu Mar 26, 2009 9:29 pm Post subject: |
|
|
if you are using psplink, you can use stdout and stderr to output on pspsh
EDIT: ah ! kernel prx, oh well never mind.
Last edited by hlide on Thu Mar 26, 2009 11:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Thu Mar 26, 2009 9:52 pm Post subject: |
|
|
You need this for kernel mode to write to memory stick, suppose you are trying to log from an exported function that is a syscall.
include systemctrl.h and add -lpspsystemctrl_kernel from M33SDK
| Code: | int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
SceUID fp = sceIoOpen("ms0:/seplugins/log.txt", PSP_O_WRONLY|PSP_O_CREAT, 0777);
sceIoLseek(fp, 0, SEEK_END);
sceIoWrite(fp, "log data", strlen("log data"));
sceIoClose(fp);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1); |
|
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Fri Mar 27, 2009 2:23 am Post subject: |
|
|
I included the "systemctrl.h" from M33SDK (4.01M33 any newer?) and the following compile errors:
| Code: | psp/sdk/include/systemctrl.h (200) : error: expected ')' before '*' t
oken
psp/sdk/include/systemctrl.h (241) : error: expected '=', ',', ';', '
asm' or '__attribute__' before 'sctrlHENSetStartModuleHandler'
|
is it really this HARD to just SEE some text somewhere? :(
just for curiosity: what is the user level 8?
and what is this M33SDK at all? any doc around? :p |
|
| Back to top |
|
 |
MBx
Joined: 22 Mar 2009 Posts: 35
|
Posted: Fri Mar 27, 2009 4:53 am Post subject: |
|
|
OK, just replaced "fdprintf" with "sceIoWrite" and everything seems to work.
what's the difference between this two anyway?
is there any write function like "sceIoWrite" with printf format support?
is there any possible way to see Kernel output on screen? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Fri Mar 27, 2009 1:50 pm Post subject: |
|
|
| MBx wrote: |
is there any possible way to see Kernel output on screen? |
Print it directly into video memory. Search for blit.c blit.h font.c which can do this. |
|
| Back to top |
|
 |
|