PSPLINK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

Hmmm, seems to be working fine tonight. Maybe I just wasn't giving it enough time to reset before?

Now using usb mode, and all is good.

Thanks again for creating such a useful tool: having direct access to the executing code on a console from a remote pc is just so ... well, useful!
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

I seem to be up and running with PSPLINK. I can connect via the pcterm and worked through the sprite.elf example. Worked great.

My only issue now is in getting Eclipse to debug. The main problem i see right now is that i don't have psp-gdb anywhere on my system. I've rebuilt the latest toolchain last night, but still no psp-gdb. Is there a place i can check for the source.. or some other project that I need?

GenericBum
JesusXP
Posts: 79
Joined: Tue Jan 17, 2006 11:16 am
Location: Ontario, Canada

Post by JesusXP »

I tried making it and got the following error, any clue?

Code: Select all

root@jesusxp:/usr/local/pspdev/psp/sdk/psplink# make release
make -C psplink all
make[1]: Entering directory `/usr/local/pspdev/psp/sdk/psplink/psplink'
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o main.o main.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o shell.o shell.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o config.o config.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o bitmap.o bitmap.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o sio.o sio.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o tty.o tty.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o disasm.o disasm.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o decodeaddr.o decodeaddr.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o memoryUID.o memoryUID.c
psp-gcc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o kmode.o kmode.S
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o exception.o exception.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o parse_args.o parse_args.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o psplinkcnf.o psplinkcnf.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o util.o util.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o script.o script.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o debug.o debug.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o symbols.o symbols.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o libs.o libs.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o apihook.o apihook.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o thctx.o thctx.c
psp-build-exports -b exports.exp > exports.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o exports.o exports.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf  -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx -mno-crt0 -nostartfiles -nodefaultlibs  main.o shell.o config.o bitmap.o sio.o tty.o disasm.o decodeaddr.o memoryUID.o kmode.o exception.o parse_args.o psplinkcnf.o util.o script.o debug.o symbols.o libs.o apihook.o thctx.o exports.o -lpspusb_driver -lpspusbstor -lpspumd -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspsdk  -lpspkernel -lpsphprm_driver -lpsppower_driver -o psplink.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lpsppower_driver
collect2: ld returned 1 exit status
make[1]: *** [psplink.elf] Error 1
rm exports.c
make[1]: Leaving directory `/usr/local/pspdev/psp/sdk/psplink/psplink'
make: *** [all] Error 2
what am i missing?
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

JesusXP wrote:I tried making it and got the following error, any clue?

Code: Select all

root@jesusxp:/usr/local/pspdev/psp/sdk/psplink# make release
make -C psplink all
make[1]: Entering directory `/usr/local/pspdev/psp/sdk/psplink/psplink'
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o main.o main.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o shell.o shell.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o config.o config.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o bitmap.o bitmap.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o sio.o sio.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o tty.o tty.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o disasm.o disasm.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o decodeaddr.o decodeaddr.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o memoryUID.o memoryUID.c
psp-gcc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o kmode.o kmode.S
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o exception.o exception.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o parse_args.o parse_args.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o psplinkcnf.o psplinkcnf.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o util.o util.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o script.o script.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o debug.o debug.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o symbols.o symbols.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o libs.o libs.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o apihook.o apihook.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o thctx.o thctx.c
psp-build-exports -b exports.exp > exports.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf   -c -o exports.o exports.c
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I../usbhostfs -I. -I/usr/local/pspdev/psp/sdk/include -Os -G0 -Wall -fno-builtin-printf  -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx -mno-crt0 -nostartfiles -nodefaultlibs  main.o shell.o config.o bitmap.o sio.o tty.o disasm.o decodeaddr.o memoryUID.o kmode.o exception.o parse_args.o psplinkcnf.o util.o script.o debug.o symbols.o libs.o apihook.o thctx.o exports.o -lpspusb_driver -lpspusbstor -lpspumd -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspsdk  -lpspkernel -lpsphprm_driver -lpsppower_driver -o psplink.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lpsppower_driver
collect2: ld returned 1 exit status
make[1]: *** [psplink.elf] Error 1
rm exports.c
make[1]: Leaving directory `/usr/local/pspdev/psp/sdk/psplink/psplink'
make: *** [all] Error 2
what am i missing?
Mmm, maybe updating the pspsdk can solve that. Just a suggestion.
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

I got caught on this one too..

TyRaNiD said about six posts ago that he modified PSPSDK, so you need to re-run the toolchain script to update.

Otherwise:
I was able to change the last line of the psplink/psplink/Makefile from:

LIBS += -lpsphprm_driver -lpsppower_driver

to:

LIBS += -lpsphprm_driver -lpsppower

That enabled the project to compile.
GenericBum
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

GB, psp-gdb comes from running the toolchain.sh script with the -gdb -d flags (you need -d to get the script to download the source). It does not build it by default as I could not be certain it would build okay on cygwin.
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

I'm sure this is a silly question but..

TyRaNiD: I'm using newtoolchain-20060222.tar that contains a toolchain.pl script which doesn't show me the details of what its doing, so it's tough to see if it's building with the right flags.

Does that script work the same way as the toolchain.sh? Can I run:

pl toolchain.pl -gdb -d

Thanks,
GenericBum
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

urm no idea I am afraid, I would probably get the bash script instead just to be sure.
JesusXP
Posts: 79
Joined: Tue Jan 17, 2006 11:16 am
Location: Ontario, Canada

Post by JesusXP »

I was pretty sure I was using the newest version of the toolchain, how can you update it? is there a command for it?

svn update? or something?! :S or do I need to re-svn the toolchain and rebuild from scratch

i'd ask in the irc channel, but its actually faster getting responses here... which I feel is sad

edit:

What i just did is cd into /home/JesusXP/psptoolchain (which is where my original download resides), I ran #svn update , which than updated newlibs or something, than I re-ran #./toolchain.sh , i hope this fixes everything...
----------------------
it worked!!
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

I removed the newtoolchain version of PSPSDK and loaded the psptoolchain version (the one with the bash script).

I first ran the ./toolchain.sh and rebuilt everything.

Then I ran ./toolchain.sh -gdb -d

However, after downloading/extracting all of the gdb 6.3 files and running make, it reports:

creating cache ./config.cache
checking host system type... i686-pc-cygwin
checking target system type... Invalid configuration `psp': machine `psp' not recognized

But it doesn't error.. it keeps going until it gets way down to the bottom where it reports:

checking for working strncmp... yes
updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating config.h
config.status: executing default commands
Configuring in bfd
configure: creating cache ./config.cache
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... Invalid configuration `psp': machine `psp' not recognized
configure: error: /bin/sh ../../bfd/../config.sub psp failed
make: *** [configure-bfd] Error 1
ERROR BUILDING GDB

First, I double checked my exports.. but I have PSPSDK defined.

Second, I double checked that the PSPSDK was installed properly after I spent all that time rebuilding everything... and it appears fine.

Third, I tried building the gu/sprite sample.. and that worked fine too.

Any ideas? I thought someone mentioned that psp-gdb might not work with cygwin.. if that's the case then I might be screwed.

GenericBum
Chrighton
Posts: 58
Joined: Wed Jun 15, 2005 8:24 pm

Post by Chrighton »

Firstly, thanks Tyranid for the great tool.

GenericBum, I believe the latest the toolchain script should grab is gdb 6.4. I built the toolchain the other day, and gdb 6.4 built fine (Cygwin/WinXP) if I'm not imaginging things. I did have a problem with Insight however, that simply died in the build process.
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

Ok, as a wrap up.. I redownloaded the toolchain script (01/20/2006) and double checked the version of gdb which was still 6.3.

I manually changed it to 6.4 and ran: ./toolchain.sh -gdb -d and it worked fine.

I'm guessing that the source listed somewhere in the forums for downloading the toolchain script is old.. or not updated.

Thanks for all the help- I think I'm off and running.

GenericBum
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well probably ooPo hasn't updated the version on his site, however he now downloads the latest patches which are now gdb 6.4 so it will fail I guess. Always best to crab the latest version of the toolchain script from subversion anyway.
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

TyRaNiD: Doh! I didn't even realize that the .svn directory was in the psptoolchain I downloaded. I updated and pulled down the latest.

Just so I can completely feel like a noob today:

I can work through the sprite example in the psplink.pdf using the pcterm to remotely start up host0:/sprite.elf and it works great. The example fires up on the PSP and shuts down PSPLINK when I exit pcterm on the pc.

But now I'm trying to debug in Eclipse, and I'm fairly inexperienced with it as an IDE. (Perhaps I should be looking at the Devc++ environment). My main goal is to visually debug through the lines of code like Oobles mentioned in his posts.

I have the spite sample project setup and through the IDE I can make "kxploit" build with the debug symbols turned on.

For my setup, I have the Eclipse root set as "~/src" and then I created a project called "samples" and imported the 'samples" directory under the sdk.

I looks like:

~/src
-->samples
---->gu
------>sprite

I have usbhostfs_pc running in the ~/src/samples directory, which means all of my hostX: drives are connected to this directory.

I'm also running PSPLINK on the psp connected through the USB.

My ini settings are:

usbmass=0
usbhost=1
pluser=1
resetonexit=1
sioshell=0
kprintf=0
wifi=0
wifishell=0
usbshell=1
usbgdb=1
conshell=0
consinterfere=0
console commands (left alone)
prompt="%d>"
pcterm=0

For Eclipse, I tried to follow Oobles instructions and setup debugging to use psp-gdb, GDB Server, TCP, localhost, port 10001.

When I attempt to debug the sprite.elf, it prints the following output on the usbhostfs_pc (with verbose on):

Accepting gdb connection from 127.0.0.1
HOST->GDB (+$Hc-1#09)
HOST->GDB ($Hc-1#09)
HOST->GDB ($Hc-1#09)
HOST->GDB ($Hc-1#09)
Closing gdb connection

The error that displays in Eclipse is:

Error creating session: Target is not responding (timed out)

GenericBum
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Did you run "debug sprite.elf" on the psplink shell before trying to connect ?
GenericBum
Posts: 17
Joined: Sat Jan 07, 2006 9:50 am

Post by GenericBum »

Cool. That is exactly what was wrong. :)

Thanks for all the help.

GenericBum
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Just thought I would post this regarding a new feature of psplink (although it is an old feature of the PSP's firmware :P) because it is slightly esoteric.

I've just added the ability to enable the Kernel's profiler in user mode. The profiler is a hardware device which maintains counters of certain systems events such as the number of instruction cycles run, the number of cache misses or the number of vfpu instructions executed. The profiler can be enabled in either global mode (where the profiler runs all the time no matter what code is running) and thread mode (where the kernel will context switch the profiler when a thread is switched). This can be used for determining the performance of your application especially in thread mode where you can determine things like if you are getting a large number of cache misses in just your thread.

To enable it in psplink you need to either type profmode g or profmode t to enable global or thread mode respectively. Then you _must_ reset psplink so the kernel gets the new value (it needs to be present by the time threadman loads). Now you can access the profiler registers using the sceKernelReferGlobalProfiler and sceKernelReferThreadProfiler functions. If either return NULL then the specific profiler mode is not enabled. The setting will persist between resets, if you want to disable it again (thread mode will no doubt reduce performance slightly due to the context switching overhead) type profmode o.

For the global profiler you must enable it first before using it by setting the enable variable (in the structure) to 1. In thread mode you dont need to do that it will always be running.

So there you go, try and think of some creative uses for it :)
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

Thx so much for a great tool TyRaNiD and other contributors. It all works great with just a usb cable and insight 6.4 and friends running in cygwin. I'm extremely happy with it.

One question, I tried the command modinfo "@Sprite Sample@" and the response is:
ERROR: Invalid name @Sprite Sample@
ERROR: Invalid module @Sprite Sample@
Usage: uid|@name

It works with modinfo uid (modinfo 0x280e631)

Did I misunderstand the manual or is something wrong with my PSPLINK build?

Another issue just showed up when I tried to debug the PMP application, after "debug PMP.elf" in pcterm I get:
"GDBServer: Could not get module information"
How can I resolve that?

Cheers, JockyW
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

you were very close :)

this is how anytime uid|@name is used
example: modinfo uid|@name

(using uid)
user@host$ modinfo 0x280e631

(using @name)
user@host$ modinfo @Sprite Sample


simple mistakes happen to everyone of us :)
10011011 00101010 11010111 10001001 10111010
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well I think that is actually a mistake in my documentation ;) Will fix it next time I can be arsed, just need to wake up first from breakpoint :)
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

No worries about the documentation :)

I'm more keen about solving the issue when I debug PMP , after "debug PMP.elf" in Pcterm I get:
"GDBServer: Could not get module information"

(The app is compiled with -g)

Any ideas?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Your elf file is not a kernel mode executable is it ? If it is then I think a user mode app cannot get the module info for that program due to some semblance of protection. Unfortunately some things seem to require kernel mode just cause of the way they have developed the libraries (think SDL is one). I could fix it I guess but it would require some support from psplink's kernel module so it can call QueryModuleInfo in the kernel context _and_ read kernel memory. Will test it to see if it can be done easily ;)
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD wrote:Your elf file is not a kernel mode executable is it ?
Forgive my stupidity, but how can I check this?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Well where you have PSP_MODULE_INFO in your application if the 2nd parameter is 0x1000 it is kernel mode, 0 is user mode. Alternatively get prxtool and run it on the elf file with the -m switch to see the module info, even more alternatively run it in psplink and use the modinfo command to print the attributes.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

A little very simple suggestion.

A command to list imports from a module (maybe called modimp or similar)

There is currently a command to list exports, but not imports.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

TyRaNiD wrote:Your elf file is not a kernel mode executable is it ?
Yes it is. Would be cool if you can add debug support for that species in psplink.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Okay added a modimp command.

I will look at trying to get kernel modules debuggable in gdb but in some ways I class all kernel elfs as unsupported under psplink cause they only cause problems somewhere or another. It seems okay with kernel prxes but elfs seem to cause the kernel issues and consequently cant just break things. As there are specific classes of applications which due to the decisions of the original authors are in kernel mode I will try and make a simple exception.
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

I'm on Gentoo amd64 on a 2.6.15 kernel.

Finally got it going, this is damn cool :)~~~~

It took me a long time to get it going (using usbhost_fs) as I kept getting "Read cancelled (remote disconnected)" whenever I did anything, I didn't even get the initial shell, if I enabled conshell as well then I would get the output of my commands (typed on pc) on the psp screen after a while.

I had to increase the USB_TIMEOUT to 10000 to get it to stop happening, even at this value I occassionally get the error and a command fails.
I Haven't had troubles with other USB before (I've unplugged all my other USB devices).
I may try install a 2.6.16 kernel tomorow and try that incase.
If its still no better it could be my motherboard :( (Gigabyte k8ns pro if anyone cares)

Anyone else built and used this on a 64bit OS?
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

I have heard of people getting it to run quite happily on 64bit machines, I guess it is possible that there is something weird about 64bit linux but it seems unlikely.

Strangely the fact that USB_TIMEOUT is 0 is because at least in the version of libusb on my system that indicates an infinite timeout, unfortunately it seems libusb really isn't too well designed to handle devices disconnecting then reappearing again, sounds like it is sort of working with adding a timeout because it keeps reissuing a request every 10 milliseconds or so most of the time it doesn't get a device reconnection.

All this will probably be solved if I wrote a proper linux driver, but then I would have to write a proper windows driver and a proper freebsd driver (something I may have to do anyway) and it just gets messy. However if anyone is willing to take up the task then be my guest :)
zilt
Posts: 45
Joined: Tue Feb 21, 2006 11:59 pm
Location: Ontario, Canada
Contact:

Post by zilt »

danzel wrote: Anyone else built and used this on a 64bit OS?
Yup - I'm running psplink/usbhostfs/etc all with Gentoo on a dual AMD Opteron 270 ( 4 cpus ) without any issues. Just a straight compile and it worked first time. I'm also using a generic 2.6.16.7 kernel.
Post Reply