Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

3dsbootldr fatfs 3DS: Difference between revisions

From GameBrew
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 8: Line 8:
|version=2017
|version=2017
|license=Mixed
|license=Mixed
|download=https://dlhb.gamebrew.org/3dshomebrews/3dsbootldrfatfs.7z
|download=[https://dlhb.gamebrew.org/3dshomebrews/3dsbootldr_fatfs.zip Source Only]
|website=https://github.com/yellows8/3dsbootldr_fatfs
|website=https://github.com/yellows8/3dsbootldr_fatfs
|source=https://github.com/yellows8/3dsbootldr_fatfs
|source=https://github.com/yellows8/3dsbootldr_fatfs
Line 25: Line 25:


==Building==
==Building==
"make" can be used with the following options:
<code>make</code> can be used with the following options:


{| class="wikitable" style="width: 1200px;"
* <code>UNPROTBOOT9_LIBPATH={path}</code> - This should be used to specify the path for the unprotboot9_sdmmc library, aka the path for that repo.
|-
* <code>DISABLE_ARM11=1</code> - Completely disable all code involved with loading/booting the arm11 binary.
|style="width: 20%;"|ENABLE_RETURNFROMCRT0=1||When the binaries were not loaded successfully, or when the arm9bin returned, return from the crt0 to the LR from the time of loader entry, instead executing an infinite loop.
* <code>ALTARM11BOOT=1</code> - Use the arm11boot method used by [https://github.com/delebile/arm9loaderhax this], instead of the one described above.
|-
* <code>ARM9BIN_FILEPATH={sd filepath}</code> - Override the default filepath for the arm9bin. For example: "ARM9BIN_FILEPATH=/ld9.bin". The filenames here are FAT 8.3.
|UNPROTBOOT9_LIBPATH={path}||This should be used to specify the path for the unprotboot9_sdmmc library, aka the path for that repo.
* <code>ARM11BIN_FILEPATH={sd filepath}</code> - This is the arm11bin version of the above option.
|-
* <code>DISABLE_BINVERIFY=1</code> - Disable using/verifying the SHA256 hash in the binaries(see above), with this the additional filesize requirement is disabled too.
|DISABLE_ARM11=1||Completely disable all code involved with loading/booting the arm11 binary.
* <code>ENABLE_RETURNFROMCRT0=1</code> - When the binaries were not loaded successfully, or when the arm9bin returned, return from the crt0 to the LR from the time of loader entry, instead executing an infinite loop.
|-
|ALTARM11BOOT=1||Use the arm11boot method used by [https://github.com/delebile/arm9loaderhax this], instead of the one described above.
|-
|ARM9BIN_FILEPATH={sd filepath}||Override the default filepath for the arm9bin. For example: "ARM9BIN_FILEPATH=/ld9.bin". The filenames here are FAT 8.3.
|-
|ARM11BIN_FILEPATH={sd filepath}||This is the arm11bin version of the above option.
|-
|DISABLE_BINVERIFY=1||Disable using/verifying the SHA256 hash in the binaries(see above), with this the additional filesize requirement is disabled too.
|-
|}


==External links==
==External links==
* GitHub - https://github.com/yellows8/3dsbootldr_fatfs
* GitHub - https://github.com/yellows8/3dsbootldr_fatfs
[[Category:3DS homebrew applications]]
[[Category:3DS homebrew system tools]]

Latest revision as of 10:25, 22 Haziran 2024

3dsbootldr_fatfs
3ds.png
General
Authoryellows8
TypeSystem Tools
Version2017
LicenseMixed
Last Updated2017/01/15
Links
[Source Only Download]
Website
Source

This bootloader runs on the arm9 loads ARM9 and ARM11 binaries from the SD FAT filesystem, with the following filenames: /load9.bin and /load11.bin. After successfully loading both binaries, it will call the loaded arm9bin, then it will return from main_() if the arm9bin returns.

This uses code based on code from https://github.com/yellows8/bootldr9_rawdevice.

Each binary starts with an u32 for the load-address, the rest of the binary is loaded to this address. See main.c for the blacklisted memory ranges(MPU is disabled while this loader is running and when jumping to the arm9bin). The filesize must be at least 0x8-bytes, and the filesize must be 4-byte aligned. When DISABLE_BINVERIFY isn't used, the filesize must be at least 0x2c-bytes: the last 0x24-bytes are a footer. The first u32 in that footer is the footertype, this must match little-endian value 0x1f40924e for SHA256. The following data in the footer is a SHA256 hash over the rest of the file(this footer is loaded into memory seperate from the loadaddr).

See also the build_hashedbin.sh script, for building hashed binaries for this. "build_hashedbin.sh {inputbin} {outputbin}"

Prior to jumping to the arm9bin, it will handle booting the arm11(this requires code running on the arm11 which can handle this). The following arm11boot method is only used if the ALTARM11BOOT option isn't specified. The entrypoint is written to u32 0x1ffffff8+4, then magicnum 0x544f4f42("BOOT") is written to u32 0x1ffffff8+0. Lastly, this arm9code waits for the arm11 to change the value at 0x1ffffff8+0.

Building

make can be used with the following options:

  • UNPROTBOOT9_LIBPATH={path} - This should be used to specify the path for the unprotboot9_sdmmc library, aka the path for that repo.
  • DISABLE_ARM11=1 - Completely disable all code involved with loading/booting the arm11 binary.
  • ALTARM11BOOT=1 - Use the arm11boot method used by this, instead of the one described above.
  • ARM9BIN_FILEPATH={sd filepath} - Override the default filepath for the arm9bin. For example: "ARM9BIN_FILEPATH=/ld9.bin". The filenames here are FAT 8.3.
  • ARM11BIN_FILEPATH={sd filepath} - This is the arm11bin version of the above option.
  • DISABLE_BINVERIFY=1 - Disable using/verifying the SHA256 hash in the binaries(see above), with this the additional filesize requirement is disabled too.
  • ENABLE_RETURNFROMCRT0=1 - When the binaries were not loaded successfully, or when the arm9bin returned, return from the crt0 to the LR from the time of loader entry, instead executing an infinite loop.

External links

Advertising: