Homebrew [WIP] twlnf, DSi NAND File ... thing ... testers with hardmod wanted

ThisIsDaAccount

Well-Known Member
Member
Joined
Apr 8, 2016
Messages
1,158
Trophies
0
XP
944
Country
United States
The one in his error screen transcript(bc57ba08f030363532435d4d4e01f300) is incorrect, that's why I say "So later I speculated you gave me the wrong dump, but in fact it's the CID, because your transcript is not verbatim."
the later one he provided, "BC 57 BA 08 F0 30 36 35 32 43 4D 4D 4E 01 FE 00", is correct.

This is the first time I've heard this, how's that calculated? if it's just reserving a fixed amount of space, TWLnf currently has it set at 5M
https://github.com/Jimmy-Z/twlnf/blob/master/arm9/source/main.c#L19
Looking at the system settings on my DSi, it seems the maximum amount of DSiWare is 1,030 "blocks", with blocks being a measurement exclusive to Nintendo. I don't know how much a block is in bytes, I've found several plausible estimates but no official source.

--------------------- MERGED ---------------------------

The one in his error screen transcript(bc57ba08f030363532435d4d4e01f300) is incorrect, that's why I say "So later I speculated you gave me the wrong dump, but in fact it's the CID, because your transcript is not verbatim."
the later one he provided, "BC 57 BA 08 F0 30 36 35 32 43 4D 4D 4E 01 FE 00", is correct.

This is the first time I've heard this, how's that calculated? if it's just reserving a fixed amount of space, TWLnf currently has it set at 5M
https://github.com/Jimmy-Z/twlnf/blob/master/arm9/source/main.c#L19
I computed a quick ratio of bytes in one block using my DSi and an exported copy of flipnote. It would seem one block is equivalent to around 132,000 bytes, or 132 kb. This means that the DSi wont boot if there's more than 134 megabytes of DSiWare (that's already pretty close to the size of a DSi nand I guess, but it might still be worth it to include a limit to make sure the user doesn't go past that).
 
Last edited by ThisIsDaAccount,
D

Deleted User

Guest
Looking at the system settings on my DSi, it seems the maximum amount of DSiWare is 1,030 "blocks", with blocks being a measurement exclusive to Nintendo. I don't know how much a block is in bytes, I've found several plausible estimates but no official source.

--------------------- MERGED ---------------------------


I computed a quick ratio of bytes in one block using my DSi and an exported copy of flipnote. It would seem one block is equivalent to around 132,000 bytes, or 132 kb. This means that the DSi wont boot if there's more than 134 megabytes of DSiWare (that's already pretty close to the size of a DSi nand I guess, but it might still be worth it to include a limit to make sure the user doesn't go past that).

Almost certainly 131072 bytes (128 KiB, and possibly the *real* flash memory block size of GameCube memory cards, which is where it originated)
 
  • Like
Reactions: ThisIsDaAccount

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe
Looking at the system settings on my DSi, it seems the maximum amount of DSiWare is 1,030 "blocks", with blocks being a measurement exclusive to Nintendo. I don't know how much a block is in bytes, I've found several plausible estimates but no official source.
Of cause there's no official source, Nintendo won't tell that, except maybe in the dev docs. IIRC it's just 1 Nintendo block equals 1 Megabits.

Thanks for the info, Using that amount, it seems the maximum amount of DSiWare possible is around 131 mb instead of 134.
I have a DSi almost filled up, will check later.
 

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe
One of my DSi show 146 available blocks and the NAND partition actually has 68.56 MB free space, so that's about 68.56 - 146/8 = 50.31MB reserved, doesn't make much sense.

By adding up all block counts of each dsiware, they used 882 blocks, +146 that's 1028 blocks, I suppose it's 1024 blocks with some overhead caused by adding up ceiled intergers.

Another one show 669 blocks free and 95+90+88+83 blocks used, added up to 1025 blocks, thats about consistent. This one doesn't have any exploit on it so I don't know about actual free space.

If that assumption was right, the quota is applied to space used by dsiware, twlnf will need a bit of code to scan currently installed dsiware.

@ThisIsDaAccount But I suppose you could just add that the user should check data management for available blocks before dsiware injection, you'll need this with TWLTool + fwTool anyway.
 
Last edited by JimmyZ,
  • Like
Reactions: ThisIsDaAccount

ThisIsDaAccount

Well-Known Member
Member
Joined
Apr 8, 2016
Messages
1,158
Trophies
0
XP
944
Country
United States
One of my DSi show 146 available blocks and the NAND partition actually has 68.56 MB free space, so that's about 68.56 - 146/8 = 50.31MB reserved, doesn't make much sense.

By adding up all block counts of each dsiware, they used 882 blocks, +146 that's 1028 blocks, I suppose it's 1024 blocks with some overhead caused by adding up ceiled intergers.

Another one show 669 blocks free and 95+90+88+83 blocks used, added up to 1025 blocks, thats about consistent. This one doesn't have any exploit on it so I don't know about actual free space.

If that assumption was right, the quota is applied to space used by dsiware, twlnf will need a bit of code to scan currently installed dsiware.

@ThisIsDaAccount But I suppose you could just add that the user should check data management for available blocks before dsiware injection, you'll need this with TWLTool + fwTool anyway.
Yeah I'll do that, I just figured it'd be better to include a check in TWLnf as well to reduce the possibilitt of messing up as much as possible. Either way I'll add that notice.
 

lordkaos

Well-Known Member
Member
Joined
Mar 13, 2009
Messages
597
Trophies
1
XP
1,582
Country
United States
Not disagreeing with you but you're quoting it like it's some kind of validated source.
1 block is equal to 128KB which multiplied by 8 is equal to 1024 KB (1 MB) , want to know how am I so sure about that?, I'm just looking at an official Nintendo document from the SDK right now, in fact there's a worksheet for calculating blocks included.
 
Last edited by lordkaos,

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe
1 block is equal to 128KB which multiplied by 8 is equal to 1024 KB (1 MB) , want to know how am I so sure about that?, I'm just looking at an official Nintendo document from the SDK right now, in fact there's a worksheet for calculating blocks included.
Again I'm not disagreeing with you, 1MB = 8 megabits
 

nocash123

Well-Known Member
Member
Joined
Aug 4, 2015
Messages
133
Trophies
0
XP
900
Country
Afghanistan
Did you track down when the bricking occurs? Immediately when exceeding the 1028 (?) block limit, or only when leaving something less than 1 Mbyte free space?

Some ideas/notes what might be going on:
Exceeding the limit could confuse the data managment screen in system settings, but might still work in launcher.
Some free space might be required when rewriting log files and config files (if the DSi is first writing the new file, and then deleting the old file).
More free space would be needed when installing system updates with bigger firmwares, probably including additional space for temporary files during installation.
Installing homebrew tools on internal eMMC memory would also reduce the available space.
The maths for used blocks should theoretically include a lot of stuff: The .app file, the .sav file(s), the .tmd file, the .tik file, and the various game folders (with file/folder sizes being rounded up to FAT cluster sizes).
The .tik files are kept on the system even when deleting titles in data managment screen, so they keep taking up space even if they are 'deleted'.

The "compute free/used blocks" formula could be quite difficult, and even if it's perfectly computed, it could still fail if the user has unexpectedly installed some extra files (either by mistake, like leaving old/backup files in the filesystem, or when intentionally adding some hacks/wifibootcode that works without SD card). Workaround would be to try to compute the used blocks for DSi titles, and additionally make sure that there are at least so and so many free megabytes.
 
Last edited by nocash123,

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe
Did you track down when the bricking occurs? Immediately when exceeding the 1028 (?) block limit, or only when leaving something less than 1 Mbyte free space?

Some ideas/notes what might be going on:
Exceeding the limit could confuse the data managment screen in system settings, but might still work in launcher.
Some free space might be required when rewriting log files and config files (if the DSi is first writing the new file, and then deleting the old file).
More free space would be needed when installing system updates with bigger firmwares, probably including additional space for temporary files during installation.
Installing homebrew tools on internal eMMC memory would also reduce the available space.
The maths for used blocks should theoretically include a lot of stuff: The .app file, the .sav file(s), the .tmd file, the .tik file, and the various game folders (with file/folder sizes being rounded up to FAT cluster sizes).
The .tik files are kept on the system even when deleting titles in data managment screen, so they keep taking up space even if they are 'deleted'.

The "compute free/used blocks" formula could be quite difficult, and even if it's perfectly computed, it could still fail if the user has unexpectedly installed some extra files (either by mistake, like leaving old/backup files in the filesystem, or when intentionally adding some hacks/wifibootcode that works without SD card). Workaround would be to try to compute the used blocks for DSi titles, and additionally make sure that there are at least so and so many free megabytes.
I haven't tried to brick it yet, just counting the block numbers in data management.

I haven't looked into how are they calculated but I guess it's probably just converting file sizes to block size and ceil up to integer, that's why they added up to 1028 and/or 1025.

As you can see more than 50MB was reserved, I suppose that's more than enough for tik, log and stuff.

File system free space is already checked in TWLnf.
 
Last edited by JimmyZ,

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
I finally got this to work btw - but is it normal for the produced NAND to be much larger than the 'usual' size i.e. dumps from FWTool?
 

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country

JimmyZ

Sarcastic Troll
OP
Member
Joined
Apr 2, 2009
Messages
681
Trophies
0
XP
762
Country
Zimbabwe
Riiiiiight... so should I remove the header and flash using FWTool (verified working in No$GBA) or trim it?
(To trim or not to trim?)
It's also hardcoded to only restore 240MB, I don't know if it will work, normally the rest is not touched, but if I were you I won't take the risk if I don't have hardmod.
 

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
It's also hardcoded to only restore 240MB, I don't know if it will work, normally the rest is not touched, but if I were you I won't take the risk if I don't have hardmod.
I've backed up and restored NANDs on this DSi before, and it seemed fine.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Psionic Roshambo @ Psionic Roshambo:
    Batman joined the Trans Justice League
    +2
  • Sicklyboy @ Sicklyboy:
    based af
    +2
  • Sonic Angel Knight @ Sonic Angel Knight:
    Forget the base, get on the roof.
  • K3Nv2 @ K3Nv2:
    Is that a bat in your buckle or are you just happy to have me
  • Psionic Roshambo @ Psionic Roshambo:
    Wonder "Woman" lol you wonder if they are a woman?
  • Psionic Roshambo @ Psionic Roshambo:
    The Riddler has questions...
  • K3Nv2 @ K3Nv2:
    Played a little of snow day glad I didn't spend $30
  • K3Nv2 @ K3Nv2:
    It's asthetic is okay maybe a good $10 grab
  • Psionic Roshambo @ Psionic Roshambo:
    Lol is it a game about doing cocaine?
  • K3Nv2 @ K3Nv2:
    Probably in pvp
  • Psionic Roshambo @ Psionic Roshambo:
    I tried Balders Gate II on the PS2 a few minutes ago, not bad lol
  • Psionic Roshambo @ Psionic Roshambo:
    My back catalog of games is like that scene at the end of Indiana Jones where the arc of the covenant is being stored in a giant ass warehouse
  • K3Nv2 @ K3Nv2:
    At least I can will my game catalog to family members
    +1
  • K3Nv2 @ K3Nv2:
    It's your problem now bitches
  • Psionic Roshambo @ Psionic Roshambo:
    Put it in your will that in order to receive any money they have to beat certain games, hard games and super shitty games...
  • Psionic Roshambo @ Psionic Roshambo:
    Say 20 bucks per Ninja Gaiden on the NES lol 60 bucks for all 3
  • Psionic Roshambo @ Psionic Roshambo:
    People you like "Beat level 1 of Ms Pacman" lol
  • K3Nv2 @ K3Nv2:
    Hello kitty ds is required
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Beat Celebrity Death Match on the PS1 omg tried it earlier today .... Absolutely trash
  • Psionic Roshambo @ Psionic Roshambo:
    Like -37 out of 10
  • Psionic Roshambo @ Psionic Roshambo:
    One of the worst games I have ever played
  • K3Nv2 @ K3Nv2:
    Make them rank up every cod game out
  • K3Nv2 @ K3Nv2:
    "Now I know why he took his own life"
    K3Nv2 @ K3Nv2: "Now I know why he took his own life"