You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0x2FF0000: libnds shadows this area with DTCM, making it inaccessible through this address.
0x2FF4000: devkitARM bootstub structure
The entire area of memory from 0x2FF4000 to 0x2FFFFFF is effectively reserved, either for the devkitARM bootstub header or by data pre-loaded by the NTR/TWL loader. However, the area of main RAM from 0x2FF0000 - 0x2FF3FFF is shadowed and effectively unused; this doesn't matter on NTR consoles, as it's just a mirror of the 4/8 MB of RAM, but on TWL this constitutes an additional 16KB of RAM that could still be used for heap/stack data.
There's three identified changes that have to be done to allow for this:
move __dtcm_start to 0x2FF4000 in the link script (mpu_setup.s uses the symbol anyway);
make sure _exit() disables DTCM whenever it accesses bootstub data - this would probably require porting the necessary code to ASM routines to guarantee it doesn't use the stack, which is in DTCM;
(optional) patch the FAT driver's IS_MAIN_RAM macro to use the same.
Note that this is a low priority change; 16KB relative to (almost) 16MB is almost unnoticeable.
The text was updated successfully, but these errors were encountered:
asiekierka
changed the title
Expose an additional 16 KB of RAM in TWL mode
Expose an additional 16 KB of RAM in TWL mode by moving DTCM around a bit
Sep 27, 2024
If we observe the memory map:
The entire area of memory from 0x2FF4000 to 0x2FFFFFF is effectively reserved, either for the devkitARM bootstub header or by data pre-loaded by the NTR/TWL loader. However, the area of main RAM from 0x2FF0000 - 0x2FF3FFF is shadowed and effectively unused; this doesn't matter on NTR consoles, as it's just a mirror of the 4/8 MB of RAM, but on TWL this constitutes an additional 16KB of RAM that could still be used for heap/stack data.
There's three identified changes that have to be done to allow for this:
__dtcm_start
to0x2FF4000
in the link script (mpu_setup.s
uses the symbol anyway);_exit()
disables DTCM whenever it accesses bootstub data - this would probably require porting the necessary code to ASM routines to guarantee it doesn't use the stack, which is in DTCM;IS_MAIN_RAM
macro to use the same.Note that this is a low priority change; 16KB relative to (almost) 16MB is almost unnoticeable.
The text was updated successfully, but these errors were encountered: