| View previous topic :: View next topic |
| Author |
Message |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Jul 01, 2008 11:51 pm Post subject: Accurate flash0 free space with DEVCTL? |
|
|
I've searched and am unable to find any way to determine flash0 free space.
The Memory Stick Devctl command obviously won't because the command is different.
| SilverSpring wrote: | | Just like the MS drivers, both the lflash block driver and lfat filesystem driver provide devctl commands to determine free space, in terms of both free sector space of the flash partitions (via the lflash IO driver) as well as free cluster space of the FAT filesystem (via the lfat IO driver). |
Anyone know how to do the above? |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jul 02, 2008 1:40 am Post subject: |
|
|
| That doesn't answer my question. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Wed Jul 02, 2008 1:49 am Post subject: |
|
|
I have worked in a flashfat emulator (the timemachine) and I don't remember to have seen any command to calculate free space.
I would learn a bit about fat filesystem, and calculate the free space myself reading the raw lflash0:0,0 device, basically free_clusters * sizeof(cluster) :) |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jul 02, 2008 1:53 am Post subject: |
|
|
| moonlight wrote: | I have worked in a flashfat emulator (the timemachine) and I don't remember to have seen any command to calculate free space.
I would learn a bit about fat filesystem, and calculate the free space myself reading the raw lflash0:0,0 device, basically free_clusters * sizeof(cluster) :) |
EDIT:
So how do I read from the device? I can do the file system work with some googling. I don't know how to use the functions to read the device. |
|
| Back to top |
|
 |
Pirata Nervo
Joined: 09 Oct 2007 Posts: 409
|
Posted: Wed Jul 02, 2008 2:07 am Post subject: |
|
|
ooops I didnt read the whole post, sorry xD _________________
Upgrade your PSP |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jul 02, 2008 2:12 am Post subject: |
|
|
I've seen this been used to dump the entire NAND
fd = sceIoOpen("lflash:",PSP_O_RDONLY,0);
But since I need only the flash0 partition I presume it will work if I use
fd = sceIoOpen("lflash0:0,0",PSP_O_RDONLY,0); |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Wed Jul 02, 2008 3:49 am Post subject: |
|
|
| Torch wrote: | I've seen this been used to dump the entire NAND
fd = sceIoOpen("lflash:",PSP_O_RDONLY,0);
But since I need only the flash0 partition I presume it will work if I use
fd = sceIoOpen("lflash0:0,0",PSP_O_RDONLY,0); |
yeah that should be fine. remember to read always in multiples of 512, otherwise you may get an error. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jul 02, 2008 3:53 am Post subject: |
|
|
I'm reading about the filesystem right now.
But what about the devctl commands that SilverSpring mentioned. If it can directly get the number of free sectors in a partition it will save a lot of work. |
|
| Back to top |
|
 |
SilverSpring
Joined: 27 Feb 2007 Posts: 115
|
Posted: Sat Jul 05, 2008 11:31 pm Post subject: |
|
|
Sorry I didn't get it to work since I do not know exactly the params it returns. It's not free clusters directly but several values from which to calculate from.
Also I was mistaken, only the devctl from the filesystem driver exists not from the logical block driver. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Jul 05, 2008 11:38 pm Post subject: |
|
|
| SilverSpring wrote: | | Also I was mistaken, only the devctl from the filesystem driver exists not from the logical block driver. |
It doesn't matter, because calculating free space from the sectors is more trouble than its worth and will probably be erroneous. Only cluster space is practical.
Calculating clusters from the FAT appears to be a trivial task anyway. |
|
| Back to top |
|
 |
|