| View previous topic :: View next topic |
| Author |
Message |
tpu
Joined: 28 Jan 2008 Posts: 7
|
Posted: Mon Jan 28, 2008 3:13 pm Post subject: help about scereg and sceIoGetstat |
|
|
1. I make a kernel prx as plugin.
2. In my prx, I patched the scereg module: find the string "flash1:", change it to "ms0:". scereg will use this string to open registry file.
3. In another user mode prx, I want open registry file on ms0 using sceRegOpenRegistry, but it return fail. I trace this call:
-> sceRegOpenRegistry(...)
->sceIoGetstat("ms0:/registry", &stat);
The sceIoGetstat return 0x80010016, Invalid argument?
4. If I do not patch scereg in step 2, no problem found.
If prx run as kernel mode in step 3, no problem found.
Why sceIoGetstat return 80010016? |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Jan 28, 2008 7:15 pm Post subject: |
|
|
The sceIoGetstat from 2.XX-3.71 fatms driver is a bit buggy, it shouldn't happen in 3.80.
Are you really calling sceIoGetstat from user mode, or from kernel mode? |
|
| Back to top |
|
 |
tpu
Joined: 28 Jan 2008 Posts: 7
|
Posted: Mon Jan 28, 2008 8:13 pm Post subject: |
|
|
If I call sceIoGetstat directly from my own prx(user mode), it works fine.
But if sceIoGetstat called by sceRegOpenRegistry, it failed. The params was same: ("ms0:/registry", &stat) |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Jan 28, 2008 8:37 pm Post subject: |
|
|
Kernel mode can't call the getstat of memory stick driver in 2.XX-3.71.
I think it is a bug, and that Sony didn't do it on purpose, as doesn't happen in the 3.80 new driver.
If you are in the vsh, you are lucky, because M33 vsh core patches the issue, if you are in other mode, then not.
Tell me the firmware you are using, and I will tell you the patch to apply. |
|
| Back to top |
|
 |
tpu
Joined: 28 Jan 2008 Posts: 7
|
Posted: Mon Jan 28, 2008 11:26 pm Post subject: |
|
|
| My firmware is 3.71M33-4. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Jan 28, 2008 11:59 pm Post subject: |
|
|
Call this code in a kernel prx:
| Code: | u32 *mod = (u32 *)sceKernelFindModuleByName("sceMSFAT_Driver");
u32 text_addr = *(mod +27);
_sw(0, text_addr+0x22D8);
sceKernelDcacheWritebackAll();
sceKernelIcacheClearAll(); |
But notice that that code would be 3.71 dependant.
Also i must warn you that your registry redirection may not work totally if registry.prx uses ioctl codes to flush the flash, that are not available in the memory stick driver (therefore, sceIoIoctl would return an error). In that case, the best would be to dummy the calls that registry does to sceIoIoctl to make them return 0. |
|
| Back to top |
|
 |
tpu
Joined: 28 Jan 2008 Posts: 7
|
Posted: Tue Jan 29, 2008 12:37 am Post subject: |
|
|
| very thanks! I' will try first. |
|
| Back to top |
|
 |
tpu
Joined: 28 Jan 2008 Posts: 7
|
Posted: Tue Jan 29, 2008 1:47 am Post subject: |
|
|
It's works!
sceRegFlushCategory call the ioctl to flush file at end of function, but I can ignore it. My prx works at game mode, I think there is no game writting registry. |
|
| Back to top |
|
 |
|