Hacking Homebrew [Beta Release][Tester wanted] Kernel9 patch to speed up boot speed on high capacity SD card

  • Thread starter Thread starter Core_2_Extreme
  • Start date Start date
  • Views Views 12,846
  • Replies Replies 55
  • Likes Likes 25

Core_2_Extreme

Well-Known Member
Member
Joined
Feb 11, 2019
Messages
182
Reaction score
433
Trophies
1
Age
24
XP
1,398
Country
Japan
I finally made this patch to say goodbye to long boot time when using 2TB (or any high capacity) SD card.


So everyone knows the higher capacity SD card, the longer boot time is, but why????

Q. Why `higher capacity SD card, the longer boot time`?????
A. This is because 3DS is calculating free space by going through FAT on every boot.

Q. But it can be mounted within a few seconds on PC/phone!!!!!
A. 3DS's SDIO controller is slow like a few MB/s so just reading a few hundred MB cause a lot of delay on 3DS.

So everyone should know why this happens now, so what to do?????

☢☢☢☢Let's just disable free space calculation on boot so it boots much faster☢☢☢☢
Actually, this patch just uses SD card capacity as free space so if you have 1TB card, free space will be shown as 1TB no matter how much you actually use.

Yes!!!!!
It worked
!!!!!



Please note : This patch is not proven to be 100% safe, so please refrain from dangerous activities such as updating system FW and installing games etc... (or do so at your own risk)

Try it on your console :


If you find any problems except free space is incorrect, let me know!
 
Last edited by Core_2_Extreme,
Let's just disable free space calculation on boot so it boots much faster☢☢☢☢
that's a major understatement. going from +60secs to instantly is seriously impressive!
wonder if disabling the sdcard's free space count has any ramifications like maybe when installing new titles? if it's a necessity for the system to do it in order to write anything new on the sd card etc
 
that's a major understatement. going from +60secs to instantly is seriously impressive!
wonder if disabling the sdcard's free space count has any ramifications like maybe when installing new titles? if it's a necessity for the system to do it in order to write anything new on the sd card etc
I tested
  • I can still write data if I set free space 0B while actually having some free space (but this may fail if application checks for free space and rejects due to insufficient space before actually writing)
  • I can still write data if I set free space as same as entire card capacity (current patch) while actually having less free space (I haven't tested what would happen if we try to write data while no space left on SD card, I personally guess it just returns error)
The test has been done copying regular files (.3dsx, .txt etc) using ftpd.
I haven't tested what would happen if I try to install title.... so [Tester wanted]
 
Last edited by Core_2_Extreme,
  • Like
Reactions: Blythe93 and CoolMe
I tested
  • I can still write data if I set free space 0B while actually having some free space (but this may fail if application checks for free space and rejects due to insufficient space before actually writing)
  • I can still write data if I set free space as same as entire card capacity (current patch) while actually having less free space (I haven't tested what would happen if we try to write data while no space left on SD card, I personally guess it just returns error)
i gotta say that none is optimal imho. it's probably better putting a disclaimer that people shouldn't install anything on the sd card with this patch on (and if they do, it's their own risk), until they switch it back to normal. well atleast until we're 100% sure it's safe to do so
saving with installed games (as the system writes to the sd card) shouldn't be an issue tho
 
Last edited by CoolMe,
Awesome. This is a great QOL patch.
Are you willing to merge it upstream?
It's not proven to be 100% safe so not anytime soon.
Post automatically merged:

i gotta say that none is optimal imho. it's probably better putting a disclaimer that people shouldn't install anything on the sd card with this patch on (and if they do, it's their own risk), until they switch it back to normal. well atleast until we're 100% sure it's safe to do so
saving with installed games (as the system writes to the sd card) shouldn't be an issue tho
Thanks, I've added warning.
 
Is this reversible? I'm so tempted to test this because since I updated my SD to 128 boot times are a pain
Yes this patch is not permanent, it's applied on RAM every time you select "accept the risk"
So you can revert to normal luma3ds or just select "reject the risk" on warning screen to boot without this patch
 
Q. But it can be mounted within a few seconds on PC/phone!!!!!
A. 3DS's SDIO controller is slow like a few MB/s so just reading a few hundred MB cause a lot of delay on 3DS.
so then why doesnt this happen with cards as low as 2GB? considering it would be needing to read 18 hundred MB to enumerate free space. but it doesnt delay very long on boot on smaller cards anyway
 
  • Like
Reactions: Core_2_Extreme
Is there no other way to calculate free space on FAT32? Reading the whole table or whatever doesn't seem to be an approach taken by any other OS / device. If only tbe FW could cache this rather than the drastic workaround. I'm on a 256GB card now. Got a 2TB on Vita though.
 
  • Like
Reactions: Core_2_Extreme
so then why doesnt this happen with cards as low as 2GB? considering it would be needing to read 18 hundred MB to enumerate free space. but it doesnt delay very long on boot on smaller cards anyway
Actually it happens on every card but it's not notifiable because FAT is small enough for 2GB
Post automatically merged:

Is there no other way to calculate free space on FAT32? Reading the whole table or whatever doesn't seem to be an approach taken by any other OS / device. If only tbe FW could cache this rather than the drastic workaround. I'm on a 256GB card now. Got a 2TB on Vita though.
There's FS information sector for it but it's not guaranteed to be correct so it should be treated as "maybe this much space is available, maybe...." and 3DS doesn't seem to update it anyway.
 
Last edited by Core_2_Extreme,
  • Like
Reactions: Blythe93
I tried it with an officially licensed Nintendo Switch SD Card. 256GB. The yellow one with the power star on it.

Without the patch, it took 24.60 seconds, rounded up.

With the patch, it took 10.66 seconds.

A 50%+ increase in speed...That's damn good!

I'll use it when it's perfected, or at least out of beta. Nice job.
 
  • Like
Reactions: Core_2_Extreme
Can't this be used to jump to a function call in the Luma3DS source code to replace the function to calculate the free space with a more modern and better one (i.e. GodMode9 calculates it instantly, so base it off that function?)

It'll require 'fatfs' to replace the function, though idk if basing it off that would be beneficial https://github.com/d0k3/GodMode9/bl...b37b9b7a9d/arm9/source/filesys/fsdrive.c#L226
 
Can't this be used to jump to a function call in the Luma3DS source code to replace the function to calculate the free space with a more modern and better one (i.e. GodMode9 calculates it instantly, so base it off that function?)

It'll require 'fatfs' to replace the function, though idk if basing it off that would be beneficial https://github.com/d0k3/GodMode9/bl...b37b9b7a9d/arm9/source/filesys/fsdrive.c#L226
Unfortunately, GodMode9 doesn't calculate free space instantly.
GodMode9 doesn't calculate free space unless you "R+A (drive option)" -> "Show drive option" then you'll see "Analyzing drive, please wait..." (I guess it's calculating free space by reading through FAT) and you have to wait for a while depending on your SD card capacity.
 
  • Like
Reactions: Blythe93

Site & Scene News

Popular threads in this forum