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 

Detect IPL Available Space?

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



Joined: 09 Nov 2008
Posts: 12

PostPosted: Tue Nov 11, 2008 11:28 am    Post subject: Detect IPL Available Space? Reply with quote

Does anyone know how I would go about detecting the available space in which an IPL can be written.

I have realised that with my app if the IPL being injected is larger than the available IPL space then the Memory Stick becomes corrupted.

Version 0.4 + Source is available at http://ifile.it/25amkt7 and version 0.5 with now source is available at http://ifile.it/ektnjc1.

Any help with fixing this would be greatly appreciated. I have tried looking before asking but I am unable to find an answer.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Tue Nov 11, 2008 10:37 pm    Post subject: Reply with quote

Read the MBR (0 sector) and you can see the address of the first partition. You can stuff whatever you want before that.
Back to top
View user's profile Send private message
raing3



Joined: 09 Nov 2008
Posts: 12

PostPosted: Thu Nov 13, 2008 1:08 pm    Post subject: Reply with quote

I've found all this information and I no where it located but I'm having a bit of trouble trying to get this information and then make it detect how much space that actually is. Sorry for my stupidity.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Thu Nov 13, 2008 1:47 pm    Post subject: Reply with quote

http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/prork/prcb_dis_qxql.mspx?mfr=true

Make a structure according to the format of the partition table. You might have to make some values as characters and convert them to numbers because they use 6-bit values etc The first partition table always starts at a fixed address 0x01BE. Read from that address into the structure. Then from the structure you have the starting sector address of the first partition.

The space you have is (starting sector-IPL starting sector)*bytes per sector for that physical disk.
Back to top
View user's profile Send private message
raing3



Joined: 09 Nov 2008
Posts: 12

PostPosted: Mon Nov 17, 2008 12:24 pm    Post subject: Reply with quote

Thanks Torch I've managed to fix the problem the information you provided was extremely helpful in fixing the problem and also helped me in adding a few more functions to my application.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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