Homebrew Why is there a 2gb limit on HiyaCFW?

  • Thread starter Deleted member 513667
  • Start date
  • Views 2,885
  • Replies 11
D

Deleted member 513667

Guest
OP
My dsi uses a 32gb card, and i have my nand backup (from fwtools), i want to install Hiya but there's a limit and i don't know why.
Why cant it be worked around?
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
1,285
Trophies
1
Age
22
Location
米国
Website
pk11.us
XP
3,895
Country
United States
My guess would be that the space free is stored in a signed 32 bit int since that would max out at 2 GB so it probably sees negative free space for 2-4 GB then overflows into too little then back to working for a bit then negative and so on every 4 GB which would explain why it occasionally works with more free space...

Has anyone tried having 6 GB of free space? If I'm right that that would be the same as having 2 GB free I think.
 

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,432
Trophies
2
XP
14,875
Country
Germany
My guess would be that the space free is stored in a signed 32 bit int since that would max out at 2 GB so it probably sees negative free space for 2-4 GB then overflows into too little then back to working for a bit then negative and so on every 4 GB which would explain why it occasionally works with more free space...

Has anyone tried having 6 GB of free space? If I'm right that that would be the same as having 2 GB free I think.

Good idea. I got no errors with these values (df on Linux):
Code:
1K-blocks  used       avail
7966720    1864096    6102624
7966720    1966496    6000224
7966720    2068896    5897824
7966720    2376096    5590624



This gave "An error has occurred.":
Code:
1K-blocks  used       avail
7966720    5518464    2448256

Needs more testing if nobody else just knows the answer.
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
1,285
Trophies
1
Age
22
Location
米国
Website
pk11.us
XP
3,895
Country
United States
Good idea. I got no errors with these values (df on Linux):
Code:
1K-blocks  used       avail
7966720    1864096    6102624
7966720    1966496    6000224
7966720    2068896    5897824
7966720    2376096    5590624



This gave "An error has occurred.":
Code:
1K-blocks  used       avail
7966720    5518464    2448256

Needs more testing if nobody else just knows the answer.
That lines up with my idea, 2448256KB results in a negative number as an s32 while the working ones all result in positive. Also someone on the TWL Mode Hacking Discord just had it work with 25GB free from not working with 26GB.

So the solution in HiyaCFW seems pretty simple, create a dummy file and grow/shrink it on boot if the space free as an s32 is negative, the file will never need to be more than 2GB since every other 2GB range works.
Edit: Or maybe patching that number to be read as a u32 (or u64 if possible, not sure if you can increase the size though) would work if anyone knows how to RE that, u32 even should be fine though since the number would never be read as negative
 
Last edited by Pk11,
D

Deleted member 513667

Guest
OP
i have an idea. what if i make a program (like a dsi file manager), that lets your transfer files and simultaneously deleting and adding dummy files so it retains storage

just a thought but its definitely possible, simple to make, and i might do it later after i finsh work with other programs
also thanks for the answer
 
Last edited by ,

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,593
Trophies
3
Age
24
XP
20,982
Country
United States
i have an idea. what if i make a program (like a dsi file manager), that lets your transfer files and simultaneously deleting and adding dummy files so it retains storage

just a thought but its definitely possible, simple to make, and i might do it later after i finsh work with other programs
also thanks for the answer
That's a good idea!
 

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
1,285
Trophies
1
Age
22
Location
米国
Website
pk11.us
XP
3,895
Country
United States
i have an idea. what if i make a program (like a dsi file manager), that lets your transfer files and simultaneously deleting and adding dummy files so it retains storage

just a thought but its definitely possible, simple to make, and i might do it later after i finsh work with other programs
also thanks for the answer
IMO it'd work better to have something you just run once before ejecting and it checks the free space and adjusts the dummy file size if necessary, then you could still use the normal file manager for copying
 
  • Like
Reactions: ry755
D

Deleted member 513667

Guest
OP
IMO it'd work better to have something you just run once before ejecting and it checks the free space and adjusts the dummy file size if necessary, then you could still use the normal file manager for copying
i would but you'd have to manually delete the dummy files to free space while my file manager can do it for you when you transfer
 
  • Like
Reactions: Pk11

Pk11

A catgirl with a DSi
Member
Joined
Jun 26, 2019
Messages
1,285
Trophies
1
Age
22
Location
米国
Website
pk11.us
XP
3,895
Country
United States
i would but you'd have to manually delete the dummy files to free space while my file manager can do it for you when you transfer
Since you never need more than 2GB of dummy file you could probably have it check the size of the dummy file (you should only need one since FAT32 can go up to 4GB/file) then calculate the new size from the free space minus the old dummy file size or so. (If you want to make a file manager that's cool just my personal preference is generally the native one so giving an idea :ha:)
 
D

Deleted member 513667

Guest
OP
Since you never need more than 2GB of dummy file you could probably have it check the size of the dummy file (you should only need one since FAT32 can go up to 4GB/file) then calculate the new size from the free space minus the old dummy file size or so. (If you want to make a file manager that's cool just my personal preference is generally the native one so giving an idea :ha:)
I'll probably add a dummy maker as a tool in the program (fill up all the space without transferring)
 
Last edited by ,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: aeiou