| View previous topic :: View next topic |
| Author |
Message |
Allelujah
Joined: 16 Jul 2008 Posts: 10
|
Posted: Thu Aug 07, 2008 10:22 pm Post subject: Memory Sticks with capacity greater than 4Gb |
|
|
Hi to everyone,
Right now i'm in search to resolve this problem in MS > 4Gb but to no avail. To be specific, all i want is to calculate it's actual size or capacity.
The following code works well with MS <= 4Gb:
u32 msdata[5];
u32 *pmsdata = msdata;
sceIoDevctl("fatms0:/", 0x02425818, &pmsdata, sizeof(pmsdata), 0, 0);
msinfo->maxclusters = msdata[0];
msinfo->freeclusters = msdata[1];
msinfo->maxsectors = msdata[2];
msinfo->sectorsize = msdata[3];
msinfo->sectorcount = msdata[4];
msinfo->actualsize = ((msdata[0]*msdata[3]*msdata[4])/1024.0f)/1024.0f;
msinfo->freesize = ((msdata[1]*msdata[3]*msdata[4])/1024.0f)/1024.0f;
But when the command is used in MS > 4Gb, It only show 4Gb's actual size. Is, this a limitation or did miss something in my calculation?
Is there any alternative option for sceIoDevctl just to achieve my desired task? |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Thu Aug 07, 2008 10:30 pm Post subject: |
|
|
1.50 or 3.xx kernel?
1.50 can not handle > 4G, in 3.xx kernel it should work.... |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Thu Aug 07, 2008 10:38 pm Post subject: |
|
|
An unsigned int (on PSP anyway) is limited to holding values between 0 - 4294967295 (4Gb).
Try changes your data type to something more suitable, u64? |
|
| Back to top |
|
 |
Allelujah
Joined: 16 Jul 2008 Posts: 10
|
Posted: Thu Aug 07, 2008 10:52 pm Post subject: |
|
|
| Hellcat wrote: | 1.50 or 3.xx kernel?
1.50 can not handle > 4G, in 3.xx kernel it should work.... |
3.xx kernel, since i'm using PSP slim w/ fw 4.01 |
|
| Back to top |
|
 |
Allelujah
Joined: 16 Jul 2008 Posts: 10
|
Posted: Thu Aug 07, 2008 10:59 pm Post subject: |
|
|
| Insert_witty_name wrote: | An unsigned int (on PSP anyway) is limited to holding values between 0 - 4294967295 (4Gb).
Try changes your data type to something more suitable, u64? |
I think you're right, i'll try u64 instead of u32. but I couldn't test it right now. |
|
| Back to top |
|
 |
Allelujah
Joined: 16 Jul 2008 Posts: 10
|
Posted: Fri Aug 08, 2008 12:22 am Post subject: |
|
|
Thanks Hellcat & Insert_witty_name :)
Edit: Problem Resolved |
|
| Back to top |
|
 |
|