 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Thu Jul 20, 2006 11:33 pm Post subject: Wifi in a kernel PRX |
|
|
I'm having a go at making a kernel prx, build settings as follows:
PSP_MODULE_INFO("test",0x1000,1,1);
Makefile:
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
I'm trying to get wifi to work in this prx, but when I call pspSdkInetInit() I get the return value 8002013A, which according to a quick google is "Library is not linked yet"
I'm currently running this under a prx loader on 1.5 with psplink, the loader is basically:
| Code: | if (pspSdkLoadInetModules() < 0) //Added to see if it would make wifi work in the child prx, it doesn't :(
{
printf("Driver load error\n"); // this doesn't happen
return 0;
}
pspSdkInstallNoDeviceCheckPatch();
pspSdkInstallNoPlainModuleCheckPatch();
loadmodule("myprx",0,0);
sceKernelStartModule(....);
return 0; |
The prx starts a thread and that thread tries to use the inet functions pspSdkInetInit() and sceNetApctlConnect(1). The value 8002013A is returned each time.
| Quote: | host0:/> Loading Module ...
: Error, could not initialise the network 8002013A
: sceNetApctlConnect returns 8002013A (want 0)
|
I've tryed to add the pspSdkLoadInetModules() function call into the prx, but I get the linker error:
| Code: | /usr/local/pspdev/psp/sdk/lib/libpspsdk.a(loadmodule.o): In function `pspSdkLoadStartModuleWithArgs':
/tmp/pspdev/pspsdk/src/sdk/loadmodule.c:36: undefined reference to `snprintf' |
TyRaNiD seemed to know something about this in his post over here: http://forums.ps2dev.org/viewtopic.php?p=33520#33520
Perhaps he could drop in and lend a hand :) please :)
I've thrown the code up here: http://localhost.geek.nz/crap/prxtest.tar.gz
Compile each dir, put out.elf and test.prx in the same dir and run out.elf through psplink.
Thanks for any help, I've spent all evening messing with various attempts to fix it. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Fri Jul 21, 2006 2:09 am Post subject: |
|
|
Well the kernel libc doesn't have an snprintf (naughty Sony) so there is no way of easily using it. Either link with newlib (and take the hit of syscalls instead of direct calls) or just steal the code from pspsdk to do the initialisation modify it :)
Anyway I assume you have a good reason these days to use kernel mode for something like this ;) |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Fri Jul 21, 2006 2:16 am Post subject: |
|
|
| Last time i used wifi+kernel mode i had random problems that weren't there with user mode... |
|
| Back to top |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Sat Jul 22, 2006 10:30 pm Post subject: |
|
|
Well I got it to go, thanks for the warning moonlight, haven't ran into anything yet though, although I haven't done much!
All I've done is just implemented 'snprintf' in my code.
And by implement, I mean hack together using the smallest amount of code. ;)
The included example now loads up a UDP socket and prints what is sent to it, there is also an included client app for the pc to send "hello", just to show it works :)
http://localhost.geek.nz/crap/prxwifi.zip |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|