 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
kfactor
Joined: 17 Nov 2007 Posts: 4
|
Posted: Wed Jul 16, 2008 2:08 am Post subject: PSP_LARGE_MEMORY=1 produces invalid PBP |
|
|
I'm trying to get large memory support for an application, but I've encountered a few problems when trying to build even simple SDK examples with PSP_LARGE_MEMORY=1 set in the makefile.
The first problem is that mksfoex dies with a segfault when called by make.
I'm using a (painfully slow) PowerBook G4 under OSX 10.5, (PowerPC/Big Endian).
With my limited understanding of the code. I've tracked it down to this point in the code (here's an svn diff with my fix):
| Code: |
--- mksfoex.c (revision 2409)
+++ mksfoex.c (working copy)
@@ -303,8 +303,8 @@
totalsize = (valsize + 3) & ~3;
SW(&e->valsize, valsize);
SW(&e->totalsize, totalsize);
- memset(d, 0, e->totalsize);
- memcpy(d, g_vals[i].data, e->valsize);
+ memset(d, 0, totalsize);
+ memcpy(d, g_vals[i].data, valsize);
d += totalsize;
}
e++;
|
The code appears to use the (endian swapped in my case) variable as a count to memcpy and memset.
Having applied this fix though, the produced PBP's are invalid as far as my PSP is concerned.
Could there be more endianness issues with this utility?
As a sidenote, which is the recommended way of enabling big memory support on a PSP Slim application?
I would like to use the standard malloc instead of a custom solution if possible. Also from what I understand PSP_LARGE_MEMORY=1 only affects the PBP build of an application. How could I enable large memory support to the normal, debuggable prx build of an app?
PS: If there are still people having trouble compiling the SDK's GCC on 10.5 with a PowerPC CPU (compiler errors in gcc/config/rs6000/host-darwin.c), I have sourced a patch, which fixes this problem.
Thanks in advance
kFactor |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Jul 16, 2008 3:19 am Post subject: |
|
|
Hmm there are a few endian bugs in there, probably cause noone complained until now and most people use sensible processors :P I will see if I can fix them all :P
Oh and if you are debugging using psplink or something then build a version of the bootstrap with large memory support (when the tool works of course :P) |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Jul 16, 2008 3:30 am Post subject: |
|
|
| Try and new version, I can't promise anything, if that doesn't work then paste a hexdump of a test sfo and I will see if I can work out which bit I have screwed up :P |
|
| Back to top |
|
 |
kfactor
Joined: 17 Nov 2007 Posts: 4
|
Posted: Wed Jul 16, 2008 3:43 pm Post subject: |
|
|
That fixed it. Thanks !
Let me know if there are any parts of the SDK that need testing under OSX or a big endian arch. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Thu Jul 17, 2008 2:41 am Post subject: |
|
|
| Well the main issues are the tools and psplinkusb code, though most of that _should_ be stable now :P |
|
| 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
|