forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Memory Sticks with capacity greater than 4Gb

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Allelujah



Joined: 16 Jul 2008
Posts: 10

PostPosted: Thu Aug 07, 2008 10:22 pm    Post subject: Memory Sticks with capacity greater than 4Gb Reply with quote

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
View user's profile Send private message
Hellcat



Joined: 24 Jan 2007
Posts: 84

PostPosted: Thu Aug 07, 2008 10:30 pm    Post subject: Reply with quote

1.50 or 3.xx kernel?

1.50 can not handle > 4G, in 3.xx kernel it should work....
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Thu Aug 07, 2008 10:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Allelujah



Joined: 16 Jul 2008
Posts: 10

PostPosted: Thu Aug 07, 2008 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Allelujah



Joined: 16 Jul 2008
Posts: 10

PostPosted: Thu Aug 07, 2008 10:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
Allelujah



Joined: 16 Jul 2008
Posts: 10

PostPosted: Fri Aug 08, 2008 12:22 am    Post subject: Reply with quote

Thanks Hellcat & Insert_witty_name :)

Edit: Problem Resolved
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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