Some sceNet / sceHttpInit usage questions

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

Moderators: cheriff, TyRaNiD

LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Some sceNet / sceHttpInit usage questions

Post by LiquidIce »

Some sceNet / sceHttpInit usage questions:

I've been able to successfully install the psp toolchain, and compile nem's hello world, thanks to all of the help I've gotten from these forums. After that, I modified nem's source code to display my own graphics and also addded some controller functions to move things around the screen with the DPad. Yes, I feel like I have a clue now, so I want to move on to more intresting things.

what I have been doing up to this point is finding the functions I want from
http://pspdev.ofcode.com/api.php?type=2&id=186

Then I add the stub info into startup.s, and define the functions in my main c file.

This is where I'm running into trouble. My programs compile with no errors, and i can launch them in pspe. When I try to run them on my PSP it just gets stuck at a black screen. I've tested this on a 1.0 PSP and a 1.5 PSP with the same results.

My mission is to bring up the Wifi connection dialog where it lets me select an SSID of a wireless access point. I'm thinking if I can call to that function and get a network connection, I will be able to use some of the other functions listed to open a socket connection to a server.

Once we have that working, lots of fun stuff can happen such as adding netcode to some of the homebrew games, creating a downloader program that downloads and updates eboot files, and eventually creating a full fledged standalone web browser.

Will there need to be callbacks to wait for an active internet connection before opening the socket?

Any ideas on how sceHttpInit() works?
first init the functions to make the network adapter activate and connect to a wifi access point.

wait for a connection to the network

once connected open a socket connection to ip:port
sceNetInetSocket()
sceNetInetConnect()

send data through the socket
sceNetInetSend()

listen for response
sceNetInetRecv()
I appreciate any feedback regarding how this can be done, and what implications there will be.

When I have some working code, i'll be sure to post it on these forums. On a somewhat related note there are some people that have put up a bounty for working open sourceable wifi code that runs on the DS. Would something of that be of interest for the PSP community, or do we already have everything we need to do this easily with the sceNet functions?
Last edited by LiquidIce on Mon Jun 20, 2005 11:27 am, edited 1 time in total.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

The network modules are not automatically loaded for you when your app starts. You will have to load them from UMD or MS or find some other way to load them.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Also, see this thread about late binding modules, which is what you'll have to do to even get your app loaded: http://forums.ps2dev.org/viewtopic.php?t=1895.

And don't be afraid to start a new development thread :).
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

thanks for the link mrbrown. moving forward, I have have obtained the following PRX files from my own umd, and put them on my memory stick:

pspnet.prx
pspnet_inet.prx
pspnet_resolver.prx
libhttp_rfc.prx
libparse_http.prx
libparse_uri.prx


I have also modified my startup.s file to include the following:

Code: Select all

STUB_START "sceNet",0x90000,0x00050005 
  STUB_FUNC 0x39af39a6,sceNetInit 
  STUB_FUNC 0x281928a9,sceNetTerm 
  STUB_FUNC 0xad6844c6,sceNetThreadAbort 
  STUB_FUNC 0x0bf0a3ae,sceNetGetLocalEtherAddr 
  STUB_FUNC 0xcc393e48,sceNetGetMallocStat 
STUB_END 

STUB_START "sceNetInet",0x90000,0x001c0005 
  STUB_FUNC 0x17943399,sceNetInetInit 
  STUB_FUNC 0xa9ed66b9,sceNetInetTerm 
  STUB_FUNC 0xdb094e1b,sceNetInetAccept 
  STUB_FUNC 0x1a33f9ae,sceNetInetBind 
  STUB_FUNC 0x8d7284ea,sceNetInetClose 
  STUB_FUNC 0x805502dd,sceNetInetCloseWithRST 
  STUB_FUNC 0x410b34aa,sceNetInetConnect 
  STUB_FUNC 0xe247b6d6,sceNetInetGetpeername 
  STUB_FUNC 0x162e6fd5,sceNetInetGetsockname 
  STUB_FUNC 0x4a114c7c,sceNetInetGetsockopt 
  STUB_FUNC 0xd10a1a7a,sceNetInetListen 
  STUB_FUNC 0xfaabb1dd,sceNetInetPoll 
  STUB_FUNC 0xcda85c99,sceNetInetRecv 
  STUB_FUNC 0xc91142e4,sceNetInetRecvfrom 
  STUB_FUNC 0xeece61d2,sceNetInetRecvmsg 
  STUB_FUNC 0x5be8d595,sceNetInetSelect 
  STUB_FUNC 0x7aa671bc,sceNetInetSend 
  STUB_FUNC 0x05038fc7,sceNetInetSendto 
  STUB_FUNC 0x774e36f4,sceNetInetSendmsg 
  STUB_FUNC 0x2fe71fe7,sceNetInetSetsockopt 
  STUB_FUNC 0x4cfe4e56,sceNetInetShutdown 
  STUB_FUNC 0x8b7b220f,sceNetInetSocket 
  STUB_FUNC 0x80a21abd,sceNetInetSocketAbort 
  STUB_FUNC 0xfbabe411,sceNetInetGetErrno 
  STUB_FUNC 0xb75d5b0a,sceNetInetInetAddr 
  STUB_FUNC 0x1bdf5d13,sceNetInetInetAton 
  STUB_FUNC 0xd0792666,sceNetInetInetNtop 
  STUB_FUNC 0xe30b8c19,sceNetInetInetPton 
STUB_END 

... etc for all sceNet related functions

0x90000 to delay loading...
One part I don't understand, is how does the PSP know where to find the PRX file and load it into memory? I've looked through a lot of threads and could not find any examples of this. It seems like nem's code in startup.s is what loads the modules, but a path is never specified.

Some good info is given on this thread:
http://forums.ps2dev.org/viewtopic.php? ... ule+import

Sorry if my questions are too broad, but I can honestly say I've read every thread on this forum, and I still don't get it. I'm sure a lot is still unknown, and some people just don't or can't share what they know with the public, however I believe that getting network communications running in PSP homebrew is a huge step that we should be actively exploring.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

The sceKernelLoadModuleMs() is the memory stick counterpart to the sceKernelLoadModule() function used on UMD modules. Use the module loading code you find in any game, but use the Ms variant instead.
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

I'm still confused. How can I run sceKernelLoadModuleMs function to load the PRX files from memory stick before startup.s executes it's code?

If you could send me a few lines that show how to load a prx into memory, it would be extremely helpful to me. Thanks!

Below is my startup.s file

Code: Select all

# Hello World for PSP
# 2005.04.30  created by nem
# 2005.06.22  modified by liquidice

      .set noreorder

      .text

      .extern xmain


##############################################################################


      .ent _start
      .weak _start
_start:
      la   $2,_gp
      move   $gp,$2

      jal   xmain
      nop
      jr   $ra
      li   $2, 1



##############################################################################


      .section   .lib.ent,"wa",@progbits
__lib_ent_top:
      .word 0
      .word 0x80000000
      .word 0x00010104
      .word __entrytable


      .section   .lib.ent.btm,"wa",@progbits
__lib_ent_bottom:
      .word   0


      .section   .lib.stub,"wa",@progbits
__lib_stub_top:


      .section   .lib.stub.btm,"wa",@progbits
__lib_stub_bottom:
      .word   0


##############################################################################

      .section   ".xodata.sceModuleInfo","wa",@progbits

__moduleinfo:
      .byte   0,0,1,1

      .ascii   "HelloWorld"      #up to 28 char
      .align   5

      .word   _gp
      .word   __lib_ent_top
      .word   __lib_ent_bottom
      .word   __lib_stub_top
      .word   __lib_stub_bottom

##############################################################################

      .section   .rodata.entrytable,"wa",@progbits
__entrytable:
      .word 0xD632ACDB
      .word 0xF01D73A7
      .word _start
      .word __moduleinfo
      .word 0


###############################################################################

      .data


###############################################################################

      .bss


###############################################################################


   .macro   STUB_START   module,d1,d2

      .section   .rodata.stubmodulename
      .word   0
__stub_modulestr_\@:
      .asciz   "\module"
      .align   2

      .section   .lib.stub
      .word __stub_modulestr_\@
      .word \d1
      .word \d2
      .word __stub_idtable_\@
      .word __stub_text_\@

      .section   .rodata.stubidtable
__stub_idtable_\@:

      .section   .text.stub
__stub_text_\@:

   .endm


   .macro   STUB_END
   .endm


   .macro   STUB_FUNC   funcid,funcname

      .set push
      .set noreorder

      .section   .text.stub
      .weak   \funcname
\funcname:
      jr   $ra
      nop

      .section   .rodata.stubidtable
      .word   \funcid

      .set pop

   .endm


   STUB_START   "sceDisplay",0x40010000,0x00030005
   STUB_FUNC   0x0E20F177,pspDisplaySetMode
   STUB_FUNC   0x289D82FE,pspDisplaySetFrameBuf
   STUB_FUNC   0x984C27E7,pspDisplayWaitVblankStart
   STUB_END
   

   STUB_START   "sceCtrl",0x40010000,0x00030005
   STUB_FUNC   0x6A2774F3,sceCtrlInit
   STUB_FUNC   0x1F4011E6,sceCtrlSetAnalogMode
   STUB_FUNC   0x1F803938,sceCtrlRead
   STUB_END
   
   STUB_START   "pspeDebug",0x40010000,0x00010005
   STUB_FUNC   0xDEADBEAF pspeDebugWrite
   STUB_END
   
STUB_START "ModuleMgrForKernel",0x40010000,0x00130005
  STUB_FUNC 0xabe84f8a,sceKernelLoadModuleBufferWithApitype
  STUB_FUNC 0xba889c07,sceKernelLoadModuleBuffer
  STUB_FUNC 0xb7f46618,sceKernelLoadModuleByID
  STUB_FUNC 0x437214ae,sceKernelLoadModuleWithApitype
  STUB_FUNC 0x977de386,sceKernelLoadModule
  STUB_FUNC 0x710f61b5,sceKernelLoadModuleMs
  STUB_FUNC 0x91b87fae,sceKernelLoadModuleVSHByID
  STUB_FUNC 0xa4370e7c,sceKernelLoadModuleVSH
  STUB_FUNC 0x23425e93,sceKernelLoadModuleVSHPlain
  STUB_FUNC 0xf9275d98,sceKernelLoadModuleBufferUsbWlan
  STUB_FUNC 0xf0cac59e,sceKernelLoadModuleBufferVSH
  STUB_FUNC 0x50f0c1ec,sceKernelStartModule
  STUB_FUNC 0xd1ff982a,sceKernelStopModule
  STUB_FUNC 0x2e0911aa,sceKernelUnloadModule
  STUB_FUNC 0xd675ebb8,sceKernelSelfStopUnloadModule
  STUB_FUNC 0xcc1d3699,sceKernelStopUnloadSelfModule
  STUB_FUNC 0x748cbed9,sceKernelQueryModuleInfo
  STUB_FUNC 0x5f0cc575,sceKernelRebootBeforeForUser
  STUB_FUNC 0xb49ffb9e,sceKernelRebootBeforeForKernel
STUB_END

   
STUB_START "LoadExecForKernel",0x40010000,0x000b0005
  STUB_FUNC 0xbd2f1094,sceKernelLoadExec
  STUB_FUNC 0x2ac9954b,sceKernelExitGameWithStatus
  STUB_FUNC 0x05572a5f,sceKernelExitGame
  STUB_FUNC 0xa3d5e142,sceKernelExitVSHVSH
  STUB_FUNC 0xbb28e9b7,sceKernelPrepareRegionFrame
  STUB_FUNC 0x71a1d738,sceKernelLoadExecBufferPlain
  STUB_FUNC 0x4d5c75be,sceKernelLoadExecFromHost
  STUB_FUNC 0x4ac57943,sceKernelRegisterExitCallback
  STUB_FUNC 0xd9739b89,sceKernelUnregisterExitCallback
  STUB_FUNC 0x659188e1,sceKernelCheckExitCallback
  STUB_FUNC 0x62a27008,sceKernelInvokeExitCallback
STUB_END


STUB_START "sceNet",0x90000,0x00050005
  STUB_FUNC 0x39af39a6,sceNetInit
  STUB_FUNC 0x281928a9,sceNetTerm
  STUB_FUNC 0xad6844c6,sceNetThreadAbort
  STUB_FUNC 0x0bf0a3ae,sceNetGetLocalEtherAddr
  STUB_FUNC 0xcc393e48,sceNetGetMallocStat
STUB_END

STUB_START "sceNetCnf",0x90000,0x00020005
  STUB_FUNC 0xecb8d1f7,sceNetCnfInit
  STUB_FUNC 0xf5f4b0bf,sceNetCnfTerm
STUB_END

STUB_START "sceNetInet",0x90000,0x001c0005
  STUB_FUNC 0x17943399,sceNetInetInit
  STUB_FUNC 0xa9ed66b9,sceNetInetTerm
  STUB_FUNC 0xdb094e1b,sceNetInetAccept
  STUB_FUNC 0x1a33f9ae,sceNetInetBind
  STUB_FUNC 0x8d7284ea,sceNetInetClose
  STUB_FUNC 0x805502dd,sceNetInetCloseWithRST
  STUB_FUNC 0x410b34aa,sceNetInetConnect
  STUB_FUNC 0xe247b6d6,sceNetInetGetpeername
  STUB_FUNC 0x162e6fd5,sceNetInetGetsockname
  STUB_FUNC 0x4a114c7c,sceNetInetGetsockopt
  STUB_FUNC 0xd10a1a7a,sceNetInetListen
  STUB_FUNC 0xfaabb1dd,sceNetInetPoll
  STUB_FUNC 0xcda85c99,sceNetInetRecv
  STUB_FUNC 0xc91142e4,sceNetInetRecvfrom
  STUB_FUNC 0xeece61d2,sceNetInetRecvmsg
  STUB_FUNC 0x5be8d595,sceNetInetSelect
  STUB_FUNC 0x7aa671bc,sceNetInetSend
  STUB_FUNC 0x05038fc7,sceNetInetSendto
  STUB_FUNC 0x774e36f4,sceNetInetSendmsg
  STUB_FUNC 0x2fe71fe7,sceNetInetSetsockopt
  STUB_FUNC 0x4cfe4e56,sceNetInetShutdown
  STUB_FUNC 0x8b7b220f,sceNetInetSocket
  STUB_FUNC 0x80a21abd,sceNetInetSocketAbort
  STUB_FUNC 0xfbabe411,sceNetInetGetErrno
  STUB_FUNC 0xb75d5b0a,sceNetInetInetAddr
  STUB_FUNC 0x1bdf5d13,sceNetInetInetAton
  STUB_FUNC 0xd0792666,sceNetInetInetNtop
  STUB_FUNC 0xe30b8c19,sceNetInetInetPton
STUB_END

STUB_START "sceNetResolver",0x90000,0x00070005
  STUB_FUNC 0xf3370e61,sceNetResolverInit
  STUB_FUNC 0x6138194a,sceNetResolverTerm
  STUB_FUNC 0x244172af,sceNetResolverCreate
  STUB_FUNC 0x94523e09,sceNetResolverDelete
  STUB_FUNC 0x224c5f44,sceNetResolverStartNtoA
  STUB_FUNC 0x629e2fb7,sceNetResolverStartAtoN
  STUB_FUNC 0x808f6063,sceNetResolverStop
STUB_END

STUB_START "sceWlanDrv",0x90000,0x00030005
  STUB_FUNC 0x93440b11,sceWlanGPBindRegError
  STUB_FUNC 0xd7763699,sceWlanGetSwitchState
  STUB_FUNC 0x0c622081,sceWlanGetEtherAddr
STUB_END

STUB_START "sceWlanDrv_lib",0x90000,0x00050005
  STUB_FUNC 0x482cae9a,sceWlanDevAttach
  STUB_FUNC 0xc9a8cab7,sceWlanDevDetach
  STUB_FUNC 0x5ed4049a,sceWlanGPPrevEstablishActive
  STUB_FUNC 0xb4d7cb74,sceWlanGPSend
  STUB_FUNC 0xa447103a,sceWlanGPRecv
STUB_END

STUB_START "sceHttp",0x90000,0x002b0005
  STUB_FUNC 0xab1abe07,sceHttpInit
  STUB_FUNC 0xd1c8945e,sceHttpEnd
  STUB_FUNC 0x9b1f1f36,sceHttpCreateTemplate
  STUB_FUNC 0xfcf8c055,sceHttpDeleteTemplate
  STUB_FUNC 0x8eefd953,sceHttpCreateConnection
  STUB_FUNC 0xcdf8ecb9,sceHttpCreateConnectionWithURL
  STUB_FUNC 0x5152773b,sceHttpDeleteConnection
  STUB_FUNC 0x47347b50,sceHttpCreateRequest
  STUB_FUNC 0xb509b09e,sceHttpCreateRequestWithURL
  STUB_FUNC 0xa5512e01,sceHttpDeleteRequest
  STUB_FUNC 0x47940436,sceHttpSetResolveTimeOut
  STUB_FUNC 0x8acd1f73,sceHttpSetConnectTimeOut
  STUB_FUNC 0x9988172d,sceHttpSetSendTimeOut
  STUB_FUNC 0x1f0fc3e3,sceHttpSetRecvTimeOut
  STUB_FUNC 0x78a0d3ec,sceHttpEnableKeepAlive
  STUB_FUNC 0xc7ef2559,sceHttpDisableKeepAlive
  STUB_FUNC 0x0809c831,sceHttpEnableRedirect
  STUB_FUNC 0x1a0ebb69,sceHttpDisableRedirect
  STUB_FUNC 0x9fc5f10d,sceHttpEnableAuth
  STUB_FUNC 0xae948fee,sceHttpDisableAuth
  STUB_FUNC 0x0dafa58f,sceHttpEnableCookie
  STUB_FUNC 0x0b12abfb,sceHttpDisableCookie
  STUB_FUNC 0xa6800c34,sceHttpInitCache
  STUB_FUNC 0x78b54c09,sceHttpEndCache
  STUB_FUNC 0x59e6d16f,sceHttpEnableCache
  STUB_FUNC 0xccbd167a,sceHttpDisableCache
  STUB_FUNC 0xbb70706f,sceHttpSendRequest
  STUB_FUNC 0xc10b6bd9,sceHttpAbortRequest
  STUB_FUNC 0x0282a3bd,sceHttpGetContentLength
  STUB_FUNC 0x4cc7d78f,sceHttpGetStatusCode
  STUB_FUNC 0xdb266ccf,sceHttpGetAllHeader
  STUB_FUNC 0xedeeb999,sceHttpReadData
  STUB_FUNC 0xf49934f6,sceHttpSetMallocFunction
  STUB_FUNC 0x2a6c3296,sceHttpSetAuthInfoCB
  STUB_FUNC 0x15540184,sceHttpDeleteHeader
  STUB_FUNC 0x3eaba285,sceHttpAddExtraHeader
  STUB_FUNC 0xf0f46c62,sceHttpSetProxy
  STUB_FUNC 0xd70d4847,sceHttpGetProxy
  STUB_FUNC 0xd081ec8f,sceHttpGetNetworkErrno
  STUB_FUNC 0xe4d21302,sceHttpsInit
  STUB_FUNC 0xf9d8eb63,sceHttpsEnd
  STUB_FUNC 0xbac31bf1,sceHttpsEnableOption
  STUB_FUNC 0xb3faf831,sceHttpsDisableOption
STUB_END



###############################################################################

   .text

   .end _start 

When I load this program through the emulator it tells me:

Code: Select all

load G:\Documents and Settings\Vin\Desktop\PSP\psp-pc-emu\ms0\PSP\GAME\TEST1\EBOOT.PBP
PBP format
sceDisplay 40010000 00030005
sceCtrl 40010000 00030005
pspeDebug 40010000 00010005
ModuleMgrForKernel 40010000 00130005
can't find ModuleMgrForKernel
LoadExecForKernel 40010000 000b0005
can't find LoadExecForKernel
sceNet 00090000 00050005
can't find sceNet
sceNetCnf 00090000 00020005
can't find sceNetCnf
sceNetInet 00090000 001c0005
can't find sceNetInet
sceNetResolver 00090000 00070005
can't find sceNetResolver
sceWlanDrv 00090000 00030005
can't find sceWlanDrv
sceWlanDrv_lib 00090000 00050005
can't find sceWlanDrv_lib
sceHttp 00090000 002b0005
can't find sceHttp
psppath:ms0\PSP\GAME\TEST1\EBOOT.PBP
ms0\PSP\GAME\TEST1\EBOOT.PBP -> ms0:/PSP/GAME/TEST1/EBOOT.PBP
9fffc00 ms0:/PSP/GAME/TEST1/EBOOT.PBP 
Do I need to write assembly code to make this work? Or am I asking questions that only people with an sdk would have the answers to? If the SDK is needed to do this, i guess i've hit a brick wall as far as these forums go, and feel free to lock this thread.
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

Well the emu obviously doesn't have these modules implemented yet.
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

yeah, but i thought the module was in the prx file. Are you saying the EMU does not have the ability to do module imports?

If that is the case, it's fine, I will just do debugging on my PSP. Now it is a lot easier to test apps without swapping. I guess some way to get similar debug info on the PSP would be helpful. Right now I just get a black screen when I run my app.
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

I've been hanging around here for a while now, and this is a topic I'm also very interested in. Since we can now run code on 1.5, I figure it's time to get involved. (Be gentle!)

As far as I can see, you've changed the macro in startup.s to allow late binding to the PRX. mrbrown's post indicates that this should then allow you load the PRX (from the MS) in your code using sceKernelLoadModuleMs(). What I don't know what params this takes or how to use the module once loaded. Any ideas on this?

As a side note, how does the firmware update work given that these PRXs need to be loaded from UMD/MS?

Sorry, I just found this in another post by laichung, I'm still non the wiser personally, but hey:

Code: Select all

sceKernelLoadModule(name, 0, NULL) 

sceKernelStartModule(uid, 0, NULL, &res, NULL) 

sceKernelQueryModuleInfo(uid, &info) 
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

From what I've read,
sceKernelLoadModuleMs() works the same as sceKernelLoadModule():

so I think it would be:

Code: Select all

sceKernelLoadModuleMS("ms0:/psp/game/test/pspnet.prx", 0, null);
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

OK, so have you tried that (on a PSP)? If so does it execute/what does it return?
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

Knox, I just get a black screen. I also don't know how to get any kind of debug output to find out if it crashed, or if the function returns anything.

I really want to learn how to do this, but I realize this is better left to the professionals. It seems like all of the functions are already written, it's just a matter of accessing them.

Also, and correct me if i'm wrong, from what I can understand on the forums, even if this does work, I can not redistribute the PRX with my app. So basically I could just release my source code and allow others to use it. Eventually, when psp devs figure out how to write their own PRX files, they will be able to create their own network stack which could be freely distributed.
TRF-Yu-Ki
Posts: 15
Joined: Wed Jun 08, 2005 1:27 pm

Post by TRF-Yu-Ki »

LiquidIce wrote:
Knox, I just get a black screen. I also don't know how to get any kind of debug output to find out if it crashed, or if the function returns anything.
Hey there! This might seem primative to some, but hey.... it works! I trust testing things on PSP more than the PSP emulator.

Code: Select all

int retc;
int hFile;
retc = sceKernelLoadModuleMS("ms0:/psp/game/test/pspnet.prx", 0, null); 
hFile = sceIoOpen("ms0:/PSP/GAME/DEBUG.txt", O_CREAT|O_WRONLY|O_TRUNC, 0777);
sceIoWrite(hFile, retc,  sizeof(retc));
sceIoClose(hFile);
Now, you may have to open DEBUG.txt in a HexEditor to interpret the value of whatever got written to the file.... ya know... because the Notepad.exe's ASCII representation of integer 4 (00000100b) written to the file isn't the same as 0x34h = 4. This is how I test return codes of abitrary function's 'n stuff. I guess, this is assuming sceKernelLoadModuleMS returns an int. I don't see the declaration anywhere in this thread. ^^; But, I'm sure a function like that must have a way of communicating back to the coder some form of success or failure. Maybe that NULL, should be a pointer to a *buf that it writes to for the result. ^^:

NOTE: I've been wondering why some people have 3 args to sceIoOpen. I only do 2(I don't put 0777), but whatever.

BTW, so... anyone has the routines of scanning for networks? Like how the PSP does to find your router(and any others nearby!). I need that for an app I wanna attempt to make. ^_^;
Learning to hack is not bad in itself; it's what you do with your abilities that count. - a.k.a. Shadow-Me-Twice of ddrfreak.com
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

I think it's not working because pspnet.prx is encrypted, and so far nobody has been able to make code which decrypts the PRX files.

To make this work we need to load sceKernelLoadModuleMs in kernel mode. There is a thread about loading modules into kernel mode here:
http://forums.ps2dev.org/viewtopic.php? ... highlight=

I tried a few of the things it says about changing xmain to kmain and rewriting the .section ".xodata.sceModuleInfo part of startup.s, and I still get black screens and no MS or WiFi activity when I run the code on my PSP.

Current Non-Working Code:

Code: Select all

//startup.s

[...]

        .section    ".xodata.sceModuleInfo","wa",@progbits
__moduleinfo:
        #.word  0x01011006
        .word   0x01011000
        .ascii  "PSPSDK"        #up to 28 char
        .align  5


[...]


         STUB_START "ModuleMgrForKernel",0x40010000,0x00130005 
         STUB_FUNC 0x977de386,sceKernelLoadModule 
         STUB_FUNC 0x710f61b5,sceKernelLoadModuleMs 
         STUB_END 

	STUB_START   "IoFileMgrForUser",0x40010000,0x000D0005 
	STUB_FUNC   0xb29ddf9c,sceIoDopen
	STUB_FUNC   0xe3eb004c,sceIoDread
	STUB_FUNC   0xeb092469,sceIoDclose
	STUB_FUNC   0x6a638d83,sceIoRead
	STUB_FUNC   0x42ec03ac,sceIoWrite
	STUB_FUNC   0x27eb27b8,sceIoLseek
	STUB_FUNC   0x810c4bc3,sceIoClose
	STUB_FUNC   0x109f50bc,sceIoOpen
	STUB_FUNC   0xF27A9C51,sceIoRemove
	STUB_FUNC   0x6A70004,sceIoMkdir
	STUB_FUNC   0x1117C65F,sceIoRmdir
	STUB_FUNC   0x54F5FB11,sceIoDevctl
	STUB_FUNC   0x779103A0,sceIoRename
	STUB_END


//main.c

/******************************************************************************/
/* sceKernelLoadModule */
int  sceKernelLoadModule(const char *path, int unknown,
							const unknown);
int  sceKernelLoadModuleMS(const char *path, int unknown,
							const unknown);

/******************************************************************************/
/* IoFileMgrForUser */

#define O_RDONLY    0x0001
#define O_WRONLY    0x0002
#define O_RDWR      0x0003
#define O_NBLOCK    0x0010
#define O_APPEND    0x0100
#define O_CREAT     0x0200
#define O_TRUNC     0x0400
#define O_NOWAIT    0x8000

int sceIoOpen(const char* file, int mode, int unknown);
void sceIoClose(int fd);
int sceIoRead(int fd, void *data, int size);
int sceIoWrite(int fd, void *data, int size);
int sceIoLseek(int fd, long long offset, int whence);
int sceIoRemove(const char *file);
int sceIoMkdir(const char *dir, int mode);
int sceIoRmdir(const char *dir);
int sceIoRename(const char *oldname, const char *newname);


enum {
    TYPE_DIR=0x10,
    TYPE_FILE=0x20
};

struct dirent {
    u32 unk0;
    u32 type;
    u32 size;
    u32 unk[19];
    char name[0x108];
};

int sceIoDopen(const char *fn);
int sceIoDread(int fd, struct dirent *de);
void sceIoDclose(int fd);


int retc;
int hFile;
retc = sceKernelLoadModuleMS("ms0:/psp/game/pspnet.prx", 0, 0);
hFile = sceIoOpen("ms0:/PSP/GAME/DEBUG.txt", O_CREAT|O_WRONLY|O_TRUNC, 0777);
sceIoWrite(hFile, retc,  sizeof(retc));
sceIoClose(hFile);

If my program loads into kernel mode can I still load user mode modules along with it?
Last edited by LiquidIce on Thu Jun 23, 2005 12:51 pm, edited 1 time in total.
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

On a somewhat related note, there is currently a $1,100+ bounty for creating open sourced WiFi code for the DS. How badly do people want to see network communications on a PSP?
http://sc.tri-bit.com/DS_Wi-fi_Bounty
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

This code is from some of the stuff by Shine:

Code: Select all

void printHex(int value) {
	const unsigned char* digits = "0123456789abcdef";
	int i;
	int x = 0;
	for (i = 7; i >= 0; i--) {
		pgPutChar((x+i)*8, y*8, 0xffff, 0, digits[value&0xf], 1, 0, 1);
		value >>= 4;
	}
	y++;
}
Then:

Code: Select all

int result;
result = sceKernelLoadModuleMs(....);
if(result) printHex(result);
As yet, I haven't been able to test any of the module loading code, as I haven't got the PRXs, and my MS isn't big enough for a full ISO. I'll pull just the files I need tonight.

I take your point about not been able to distribute the PRX with any of your own software. (Maybe you could to use a copy from a UMD?) Either way, it's still of curiosity...
To make this work we need to load sceKernelLoadModuleMs in kernel mode.
I can't understand why this would be?
I think it's not working because pspnet.prx is encrypted
I'm not sure about this either, should they still not be loadable by sceKernelLoadModuleMs()?

It's pretty clear we need some help from someone else here, anyone else got anywhere with this? In the meantime, this post might be work another look Liquid:

http://forums.ps2dev.org/viewtopic.php? ... e2f4b3a3dc
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

LoadModule tips and tricks:
['mrbrown' has already hinted at some of these things. Here's some additional advice from my similar experiments. NOTE: error codes found experimentally]

As mentioned, loading the library from MS can be *attempted* with the the sceKernelLoadModule[Ms] APIs.
Loading a library in the startup code ('kmain' in kdumper) will fail (error 0x80020143). Instead create a separate thread and try to load the library from there.

TIP: if you can't load the library from a user mode thread try loading it from a kernel mode thread
TIP: you must Load and Start each library module (and in proper order)
TIP: The last two args to sceKernelLoadModule[Ms] can be zero. The return value is either an error code or the value to pass to sceKernelStartModule
TIP: Libraries have a number of dependencies that must be loaded and started in proper order. Hook in Vampire's "kprintf" hook to your app and it will give debug messages from "doLinkLibraryEntries" - very useful !]

The order for the core socket library:
LoadAndStart("flash0:/kd/ifhandle.prx"); // loads in kernel space
LoadAndStart("flash0:/kd/pspnet.prx"); // loads in user space
LoadAndStart("flash0:/kd/pspnet_inet.prx"); // also in user space

You can load encrypted files from the MS, but that leads to potential copyright problems.
Trying to load unencrypted PRX files fails [can't load a "PLAIN" module]

To trick the system to load from "flash0:" you need the kernel memory access module flags (ala kdumper) and load from a kernel thread.
This is the only legal way of using the libraries AFAIK (assuming you want to distribute your app) - since you aren't copying anyone else's bits.

FWIW: I am still having problems with the lazy imports (the 0x9000 flag thing). Even after the proper library is loaded, the swi stubs still return error code 0x8002013a.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

I hope 0x9000 was a typo, as the lazy imports uses 0x90000.
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

Yes typo (0x90000)
Has anyone got the lazy imports to work with MS/flash0 loaded libraries ?? (I load the modules, they are in RAM, but the library entry stubs don't get fixed up).
TRF-Yu-Ki
Posts: 15
Joined: Wed Jun 08, 2005 1:27 pm

Post by TRF-Yu-Ki »

Yup yup... so, did LiquidIce at least get a DEBUG.txt show up on his memstick? That would at least prove that his code didn't crash 'n burn on the sceKernelLoadModuleMs(...) and the call to the function returned and the code kept executing to the file-creation. ......though, I guess the PSP crashes back to the menu with an error-code for any execution-halting errors. Hmm, I'm gonna go try devide-by-zero later tonight. ^_^

EDIT: Devide-by-zero shutteth-downeth my PSP. So does references on invalid pointers 'n such. So, if you do a load-module for pspnet.prx and call an sceNet routine. If your PSP doesn't shut down, then I guess you succeeded calling it. Afterall, the name of a function is really just a special pointer to the next instruction with all the params/return-addr pushed on the stack 'n such. =^)
Learning to hack is not bad in itself; it's what you do with your abilities that count. - a.k.a. Shadow-Me-Twice of ddrfreak.com
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

> So, if you do a load-module for pspnet.prx and call an sceNet routine. If your PSP doesn't shut down, then I guess you succeeded calling

Fortunately/Unfortunately not.

The stub routines will not crash if you call them with a not-yet-loaded library. Instead they return error code 0x8002013a
My problem is that they continue to return that error code even after the libraries are loaded. I worked around it (patching the entry tables myself), and can now call the entries for real.

One kludgey work-around later, I'm making some progress...
Starting to figure out the connection states (connecting to an access point with WEP). Here's some prelim initialization code for Access point connection (essentially what Wipeout uses to get to the Internet). Error checking code stripped for brevity.

NOTE: this is for access point connection (useful for web access or connecting to a PC). The Adhoc initialization is totally different (for game sharing etc).

Code: Select all

  LoadAndStartAndPatch("flash0:/kd/ifhandle.prx");
  LoadAndStartAndPatch("flash0:/kd/memab.prx"); // needed for adhoc
  LoadAndStartAndPatch("flash0:/kd/pspnet.prx");
  LoadAndStartAndPatch("flash0:/kd/pspnet_inet.prx");
  LoadAndStartAndPatch("flash0:/kd/pspnet_apctl.prx");
  LoadAndStartAndPatch("flash0:/kd/pspnet_resolver.prx");
  LoadAndStartAndPatch("flash0:/kd/pspnet_ap_dialog_dummy.prx"); // needed ?

  // startup connection
  err = sceNetInit(0x20000, 0x20, 0x1000, 0x20, 0x1000);
  err = sceNetInetInit();
  err = sceNetResolverInit();
  err = sceNetApctlInit(0x1000, 0x42);
  u32 handlerHandle = sceNetApctlAddHandler((u32)apctl_handler, 0);

  err = sceNetApctlConnect(0);

  u32 state = 0;
  while &#40;sceNetApctlGetState&#40;&state&#41; == 0 && state < ?&#41;
  &#123;
     // wait for the connection
  &#125;

  // up and running !
  ... do something with NetInet socket APIs or sceHttp

  // shut everything down
  err = sceNetApctlDisconnect&#40;&#41;;
  err = sceNetApctlDelHandler&#40;handlerHandle&#41;;
  err = sceNetApctlTerm&#40;&#41;;
  err = sceNetResolverTerm&#40;&#41;;
  err = sceNetInetTerm&#40;&#41;;
  err = sceNetTerm&#40;&#41;;
----

void apctl_handler&#40;&#41;
&#123;
&#125;
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

Great work PspPet, and thanks for the pointers. I've managed to get as far as getting kdumper to compile and work without PSPSDK. From there I've modified the code and started to try sceKernelLoadModule(). However I call it, and I've tried directly from kmain() (which should return 0x80020143), by creating a new thread in kmain and calling it from there, and even in main() out of desperation. Which ever I try, the PSP locks up on sceKernelLoadModule() and a few seconds later turns itself off. I've plugged kprintf in and this doesn't turn up anything either. (Presuming I've done it right of course!)

Does anyone have any idea what might be happening here? I wouldn't mind if it didn't work and I get an error code, but why hang?

Code: Select all

	print&#40;"sceNet Test App"&#41;;
	int ret;
	ret = sceKernelLoadModule&#40;"flash0&#58;/kd/pspnet.prx", 0, 0&#41;;
	printHex&#40;ret&#41;; 
NOTE: My app loads as the test is displayed.

Code: Select all

# Hello World for PSP
# 2005.04.30  created by nem 

		.set noreorder

		.text

		.extern main


##############################################################################


		.ent _start
		.weak _start
_start&#58;
		addiu 	$sp, 0x10
		sw		$31, 0&#40;$sp&#41;	
		sw		$16, 4&#40;$sp&#41;
		sw		$17, 8&#40;$sp&#41;
		
		move	$16, $04				# Save args
		move	$17, $05

		jal	kmain
		nop

		la  	$04, _main_thread_name	# Main thread setup
		la		$05, main
		li		$06, 0x20				# Priority
		li		$07, 0x40000			# Stack size
		lui		$08, 0x8000				# Attributes
		jal		sceKernelCreateThread
		move	$09, $0

		move	$04, $02				# Start thread
		move	$05, $16
		jal		sceKernelStartThread
		move	$06, $17

		lw		$31, 0&#40;$sp&#41;
		lw		$16, 4&#40;$sp&#41;
		lw		$17, 8&#40;$sp&#41;
		move	$02, $0
		jr 		$31
		addiu	$sp, 0x10

_main_thread_name&#58;
		.asciiz	"user_main"




##############################################################################


		.section	.lib.ent,"wa",@progbits
__lib_ent_top&#58;
		.word 0
		.word 0x80000000
		.word 0x00010104
		.word __entrytable


		.section	.lib.ent.btm,"wa",@progbits
__lib_ent_bottom&#58;
		.word	0


		.section	.lib.stub,"wa",@progbits
__lib_stub_top&#58;


		.section	.lib.stub.btm,"wa",@progbits
__lib_stub_bottom&#58;
		.word	0


##############################################################################

		.section	".xodata.sceModuleInfo","wa",@progbits

__moduleinfo&#58;
		.word	0x01011000   # kernel mode
		.byte	0,0,1,1


		.ascii	"HelloWorld"		#up to 28 char
		.align	5

		.word	_gp
		.word	__lib_ent_top
		.word	__lib_ent_bottom
		.word	__lib_stub_top
		.word	__lib_stub_bottom

##############################################################################

		.section	.rodata.entrytable,"wa",@progbits
__entrytable&#58;
		.word 0xD632ACDB
		.word 0xF01D73A7
		.word _start
		.word __moduleinfo
		.word 0



###############################################################################

		.data


###############################################################################

		.bss


###############################################################################


	.macro	STUB_START	module,d1,d2

		.section	.rodata.stubmodulename
		.word	0
__stub_modulestr_\@&#58;
		.asciz	"\module"
		.align	2

		.section	.lib.stub
		.word __stub_modulestr_\@
		.word \d1
		.word \d2
		.word __stub_idtable_\@
		.word __stub_text_\@

		.section	.rodata.stubidtable
__stub_idtable_\@&#58;

		.section	.text.stub
__stub_text_\@&#58;

	.endm


	.macro	STUB_END
	.endm


	.macro	STUB_FUNC	funcid,funcname

		.set push
		.set noreorder

		.section	.text.stub
		.weak	\funcname
\funcname&#58;
		jr	$31
		nop

		.section	.rodata.stubidtable
		.word	\funcid

		.set pop

	.endm

STUB_START "ModuleMgrForKernel",0x40010000,0x00130005 
STUB_FUNC 0xabe84f8a,sceKernelLoadModuleBufferWithApitype 
STUB_FUNC 0xba889c07,sceKernelLoadModuleBuffer 
STUB_FUNC 0xb7f46618,sceKernelLoadModuleByID 
STUB_FUNC 0x437214ae,sceKernelLoadModuleWithApitype 
STUB_FUNC 0x977de386,sceKernelLoadModule 
STUB_FUNC 0x710f61b5,sceKernelLoadModuleMs 
STUB_FUNC 0x91b87fae,sceKernelLoadModuleVSHByID 
STUB_FUNC 0xa4370e7c,sceKernelLoadModuleVSH 
STUB_FUNC 0x23425e93,sceKernelLoadModuleVSHPlain 
STUB_FUNC 0xf9275d98,sceKernelLoadModuleBufferUsbWlan 
STUB_FUNC 0xf0cac59e,sceKernelLoadModuleBufferVSH 
STUB_FUNC 0x50f0c1ec,sceKernelStartModule 
STUB_FUNC 0xd1ff982a,sceKernelStopModule 
STUB_FUNC 0x2e0911aa,sceKernelUnloadModule 
STUB_FUNC 0xd675ebb8,sceKernelSelfStopUnloadModule 
STUB_FUNC 0xcc1d3699,sceKernelStopUnloadSelfModule 
STUB_FUNC 0x748cbed9,sceKernelQueryModuleInfo 
STUB_FUNC 0x5f0cc575,sceKernelRebootBeforeForUser 
STUB_FUNC 0xb49ffb9e,sceKernelRebootBeforeForKernel 
STUB_END 
NOTE: I've cut some of the imports out as this post is too long already.
qubitz
Posts: 32
Joined: Sun Apr 03, 2005 10:30 am

Post by qubitz »

You cant use those stubs in kernel mode. Read TyRaNiD's "Big NOTE".

http://forums.ps2dev.org/viewtopic.php?t=2204
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

OK, so I need to call sceKernelLoadModule(Ms) direct? I know it's probably a stupid question but how do I figure out the address to call it from?
PspPet
Posts: 210
Joined: Wed Mar 30, 2005 2:13 am
Contact:

Post by PspPet »

> STUB_START "ModuleMgrForKernel",0x40010000,0x00130005

As mentioned, that's the problem. The "ModuleMgrForUser" has all the important entries you need.

Code: Select all

	STUB_START	"ModuleMgrForUser",0x40010000,0x00040005
        STUB_FUNC 0x977de386,sceKernelLoadModule
        STUB_FUNC 0x710f61b5,sceKernelLoadModuleMs
        STUB_FUNC 0x50f0c1ec,sceKernelStartModule
        STUB_FUNC 0xd1ff982a,sceKernelStopModule
STUB_END
> so I need to call sceKernelLoadModule(Ms) direct?
In this case you don't -- since the entries are also available in a "ForUser" accessible library. Otherwise you need to disassemble a "kdumper" image and find the entries from there (easy to find based on the exported NIDs - but different for the 1.0 and 1.50 firmware). Recommended only if you can't find what you want in a "User" library.

----
ADDITIONAL: if still having problems, try running 'main' as a kernel thread (flags 0 not 0x80000000)
Change:
< lui $08, 0x8000 # Attributes
To:
> mov $08.$0
djhuevo
Posts: 47
Joined: Thu Mar 10, 2005 3:50 pm

Post by djhuevo »

Knox wrote:OK, so I need to call sceKernelLoadModule(Ms) direct? I know it's probably a stupid question but how do I figure out the address to call it from?
if your really need to call functions from ModuleMgrForKenerl, here is the list of offsets in kernel memory:

Code: Select all

module name&#58; sceModuleManager
module ver&#58;  1.1
stub&#58; ModuleMgrForKernel

8805a244&#58;
.code sceKernelLoadModuleBufferWithApitype
8805a350&#58;
.code sceKernelLoadModuleBuffer
8805a660&#58;
.code sceKernelLoadModuleByID
8805a794&#58;
.code sceKernelLoadModuleWithApitype
8805a940&#58;
.code sceKernelLoadModule
8805a960&#58;
.code sceKernelLoadModuleMs
8805a980&#58;
.code sceKernelLoadModuleVSHByID
8805aafc&#58;
.code sceKernelLoadModuleVSH
8805ad0c&#58;
.code sceKernelLoadModuleVSHPlain
8805af18&#58;
.code sceKernelLoadModuleBufferUsbWlan
8805b058&#58;
.code sceKernelLoadModuleBufferVSH
8805b198&#58;
.code sceKernelStartModule
8805b448&#58;
.code sceKernelStopModule
8805b624&#58;
.code sceKernelUnloadModule
8805b7d4&#58;
.code sceKernelSelfStopUnloadModule
8805b8d4&#58;
.code sceKernelStopUnloadSelfModule
8805ba3c&#58;
.code sceKernelSearchModuleByName
8805ba6c&#58;
.code sceKernelSearchModuleByAddress
8805ba9c&#58;
.code sceKernelQueryModuleInfo
8805bc2c&#58;
.code sceKernelRebootBeforeForUser
8805be74&#58;
.code sceKernelRebootBeforeForKernel

Code: Select all

module name&#58; sceModuleManager
module ver&#58;  1.2
stub&#58; ModuleMgrForKernel

8805c21c&#58;
.code sceKernelLoadModuleBufferWithApitype
8805dcbc&#58;
.code sceKernelLoadModuleBuffer
8805c318&#58;
.code sceKernelLoadModuleByID
8805c440&#58;
.code sceKernelLoadModuleWithApitype
8805dcdc&#58;
.code sceKernelLoadModule
8805dcfc&#58;
.code sceKernelLoadModuleMs
8805c5f4&#58;
.code sceKernelLoadModuleVSHByID
8805c760&#58;
.code sceKernelLoadModuleVSH
8805c960&#58;
.code sceKernelLoadModuleVSHPlain
8805cb60&#58;
.code sceKernelLoadModuleBufferUsbWlan
8805cc9c&#58;
.code sceKernelLoadModuleBufferVSH
8805cdd8&#58;
.code sceKernelStartModule
8805cf60&#58;
.code sceKernelStopModule
8805dd1c&#58;
.code sceKernelUnloadModule
8805d13c&#58;
.code sceKernelSelfStopUnloadModule
8805d23c&#58;
.code sceKernelStopUnloadSelfModule
8805dda0&#58;
.code sceKernelSearchModuleByName
8805d394&#58;
.code ModuleMgrForKernel_0x644395e2
8805de10&#58;
.code sceKernelSearchModuleByAddress
8805d430&#58;
.code sceKernelQueryModuleInfo
8805d684&#58;
.code ModuleMgrForKernel_0xf0a26395
8805de40&#58;
.code ModuleMgrForKernel_0xd8b73127
8805d72c&#58;
.code sceKernelRebootBeforeForUser
8805d8fc&#58;
.code ModuleMgrForKernel_0xa6e8c1f5
8805da28&#58;
.code sceKernelRebootBeforeForKernel

you can get it from your own kmem dump with http://pspdev.ofcode.com/index.php/pspk-tool-03
sobreviviendo en la tierra de los trolldev
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

PspPet, where did you get this LoadAndStartAndPatch() function? Is that part of the yet to be released psp homebrew sdk?
Knox
Posts: 13
Joined: Sun May 15, 2005 11:51 pm
Location: Yorkshire, England

Post by Knox »

As mentioned, that's the problem. The "ModuleMgrForUser" has all the important entries you need.
Doh! That was a bit of a wood for the trees moment on my part, cheers!
PspPet, where did you get this LoadAndStartAndPatch() function? Is that part of the yet to be released psp homebrew sdk?
I presume he wrote it himself. sceKernelLoadModule, sceKernelStartModule, and then the entry table patching work around he discussed. This is the bit (entry table patching) I've not been able to try yet, I'll have a go tonight.
TRF-Yu-Ki
Posts: 15
Joined: Wed Jun 08, 2005 1:27 pm

Post by TRF-Yu-Ki »

Hmm,

So PspPet patched the entry points himself; before that patch... calling sceNetInit() would put the Instruction-pointer where? I guess since he got it working, what I'm saying now is pointless. But, I'm just curious how a call to a non-existant routine wouldn't crash. Does that mean Sony has some kind of layer protecting against invalid Instruction-pointer? On today's PCs, a C program with its entry-tables screwed up would crash & burn(perhaps not even start at all). Just curious.

Oh well, ...off I go....

Completely_Unrelated_note: Did anyone else notice that if you crash the PSP, the next time you turn it on the Memory-stick light flashes alot? Makes me think it's some kind of failsafe boot-from-stick attempt before looking at the firmware - maybe like how windows will check the drive for errors on startup if it wasn't shutdown properly the last time.
Learning to hack is not bad in itself; it's what you do with your abilities that count. - a.k.a. Shadow-Me-Twice of ddrfreak.com
madc
Posts: 17
Joined: Mon Jun 27, 2005 3:18 pm
Location: Nanking,China
Contact:

Post by madc »

I loaded and started the modules yesterday but didn't fix the entries.

Today, I get the patches from PspPet, which was implemented by himself. But he said it works with 1.0 only. I tested it with 1.5 but failed. I'm working on it now.

I think we will get PRX work soon.
Post Reply