Discuss the development of new homebrew software, tools and libraries.
Moderators: cheriff, TyRaNiD
-
Allelujah
- Posts: 10
- Joined: Wed Jul 16, 2008 4:26 pm
Post
by Allelujah »
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?
-
Hellcat
- Posts: 83
- Joined: Wed Jan 24, 2007 2:52 pm
Post
by Hellcat »
1.50 or 3.xx kernel?
1.50 can not handle > 4G, in 3.xx kernel it should work....
-
Insert_witty_name
- Posts: 376
- Joined: Wed May 10, 2006 11:31 pm
Post
by Insert_witty_name »
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?
-
Allelujah
- Posts: 10
- Joined: Wed Jul 16, 2008 4:26 pm
Post
by Allelujah »
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
-
Allelujah
- Posts: 10
- Joined: Wed Jul 16, 2008 4:26 pm
Post
by Allelujah »
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.
-
Allelujah
- Posts: 10
- Joined: Wed Jul 16, 2008 4:26 pm
Post
by Allelujah »
Thanks Hellcat & Insert_witty_name :)
Edit: Problem Resolved