Detect IPL Available Space?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
raing3
Posts: 12
Joined: Sun Nov 09, 2008 1:59 pm
Contact:

Detect IPL Available Space?

Post by raing3 »

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.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Read the MBR (0 sector) and you can see the address of the first partition. You can stuff whatever you want before that.
raing3
Posts: 12
Joined: Sun Nov 09, 2008 1:59 pm
Contact:

Post by raing3 »

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.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

http://www.microsoft.com/technet/prodte ... x?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.
raing3
Posts: 12
Joined: Sun Nov 09, 2008 1:59 pm
Contact:

Post by raing3 »

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.
Post Reply