In fioGetStatFiller of hdd_fio.c the size is returned like this:
Code: Select all
stat->size=clink->header->length;
To fix this I will change it to:
Code: Select all
stat->size=clink->header->length * 1024;
Code: Select all
stat->size=clink->header->length;
Code: Select all
stat->size=clink->header->length * 1024;
Code: Select all
Name size before size now partition size
__boot 1048576 1073741824 512MB (536870912)
+MAIN 1048576 1073741824 512MB (536870912)
+MP3 1048576 1073741824 512MB (536870912)
+NEW1 1048576 1073741824 512MB (536870912)
+NEW2 8388608 0 4096MB (4294967296)
+NEW3 2097152 2147483648 1024MB (1073741824)
+NEW4 262144 268435456 128MB (134217728)
PGEN 1.1 262144 268435456 128MB (134217728)
PS2OS 262144 268435456 128MB (134217728)
Code: Select all
apa_header *header;
stat->mode=clink->header->type;
stat->attr=clink->header->flags;
stat->hisize=0;
u64 size = clink->header->length;
size *= 1024;
stat->size=size & 0xFFFFFFFF;
size >>= 32;
stat->hisize=size & 0xFFFFFFFF;
header=clink->header;
Code: Select all
apa_header *header;
u64 size;
stat->mode=clink->header->type;
stat->attr=clink->header->flags;
stat->hisize=0;
size = clink->header->length;
size *= 512;
stat->size=size & 0xFFFFFFFF;
size >>= 32;
stat->hisize=size & 0xFFFFFFFF;
header=clink->header;
Code: Select all
Name size partition size
__boot 536870912 512MB (536870912)
+MAIN 536870912 512MB (536870912)
+MP3 536870912 512MB (536870912)
+NEW1 536870912 512MB (536870912)
+NEW2 0 4096MB (4294967296)
+NEW3 1073741824 1024MB (1073741824)
+NEW4 134217728 128MB (134217728)
PGEN 1.1 134217728 128MB (134217728)
PS2OS 134217728 128MB (134217728)
Code: Select all
if( hisize > 0 )
totalSize = 4294967295 + hisize;
else
totalSize = size;
No its more like:EP wrote:OK, so hisize is what you use to get the other part of the size. So for example in another program:If that's right, then I understand how it works now. Radad, I'll let you decide on my two slight changes. Thanks.Code: Select all
if( hisize > 0 ) totalSize = 4294967295 + hisize; else totalSize = size;
Code: Select all
totalSize = hisize << 32 + size;
Yeah OK, bit shift operator making use of both size and highsize. I just wonder how to convert u64 integers to string. I saw somewhere that printf can't handle 64-bit integers. I tried it and that's most likely why I only get zero for my +NEW2 partition. It only converts the first 32 bits and thats all.radad wrote:No its more like:Code: Select all
totalSize = hisize << 32 + size;
Code: Select all
u64 max = 0xFFFFFFFFFFFFFFFF; // as big as it gets
char buffer[21];
sprintf(buffer, "%Lu", max);
printf("Max size is %s\n", buffer);
Multiplying by 512 instead of 1024 looks right and appears to be more mathematically sound.radad wrote:As for the change from 1024 to 512, I will have to look into it again as 1024 works for me.
Code: Select all
dr-------- 1 ps2 ps2 536870912 Feb 8 2005 __boot
dr-------- 1 ps2 ps2 536870912 Feb 8 2005 +MAIN
dr-------- 1 ps2 ps2 536870912 Feb 8 2005 +MP3
dr-------- 1 ps2 ps2 536870912 Feb 8 2005 +NEW1
dr-------- 1 ps2 ps2 4294967296 Feb 8 2005 +NEW2
dr-------- 1 ps2 ps2 1073741824 Feb 8 2005 +NEW3
dr-------- 1 ps2 ps2 134217728 Feb 8 2005 +NEW4
dr-------- 1 ps2 ps2 134217728 Oct 9 2011 PGEN 1.1
dr-------- 1 ps2 ps2 134217728 Feb 8 2005 PS2OS