Configuration Memory

Configuration Memory

ARM11 Kernel Configuration Memory #

NAMEPROCESS VIRTUAL ADDRESSWIDTH
KERNEL_?0x1FF800001
KERNEL_VERSIONREVISION0x1FF800011
KERNEL_VERSIONMINOR0x1FF800021
KERNEL_VERSIONMAJOR0x1FF800031
UPDATEFLAG0x1FF800044
NSTID0x1FF800088
SYSCOREVER0x1FF800104
ENVINFO0x1FF800141
UNITINFO0x1FF800151
PREV_FIRM0x1FF800161
KERNEL_CTRSDKVERSION0x1FF800184
FIRMLAUNCHFLAGS0x1FF800204
APPMEMTYPE0x1FF800304
APPMEMALLOC0x1FF800404
SYSMEMALLOC0x1FF800444
BASEMEMALLOC0x1FF800484
FIRM_?0x1FF800601
FIRM_VERSIONREVISION0x1FF800611
FIRM_VERSIONMINOR0x1FF800621
FIRM_VERSIONMAJOR0x1FF800631
FIRM_SYSCOREVER0x1FF800644
FIRM_CTRSDKVERSION0x1FF800684

This memory page is mapped as “shared device” (it is thus uncached) and read-only for ARM11 processes. This memory and the kernel code for it only exists under NATIVE_FIRM/SAFE_MODE_FIRM.

The FIRM_* fields are by default identical to the KERNEL_* fields. However, the FIRM_* fields can be overridden via FIRM-launch parameters, see here.

Besides mem-region related fields, the data written here by the old 3DS/new 3DS kernels is identical.

Shared Memory Page For ARM11 Processes #

NAMEPROCESS VIRTUAL ADDRESSWIDTH
bit0 selects DATETIME_0 or DATETIME_1.0x1FF810004
RUNNING_HW (1=product, 2=devboard, 3=debugger, 4=capture, 5=?)0x1FF810041
MCU_HW_INFO0x1FF810051
DATETIME_0 {(u64)MillisecondsSinceFirstJan1900,(u64)SystemTickLastTimeThisWasUpdated,(u32)unk(set to 0xFFB0FF0 by PTM),(u32)Set to 0 by PTM,(u32)Set to 0 by PTM,(u32)set to 0 by PTM}0x1FF8102032
DATETIME_10x1FF8104032
WIFI_MACADDR0x1FF810606
WIFI_LINKLEVEL Ranges from 0-3; 0 stands for no or a poor network connection; 3 stands for a good connection. This corresponds with the number of wifi bars displayed by Home Menu.0x1FF810661
NETWORK_STATE The network state displayed by Home Menu. 2: Internet, 3/4/6: Local, 7: Disabled, Everything else: Enabled0x1FF810671
3D_SLIDERSTATE0x1FF810804
3D_LEDSTATE0x1FF810841
BATTERY_LEDSTATE0x1FF810851
PTM sets bit0 to 1 when it has done writing MCU-originating hw info to RUNNING_HW, MCU_HW_INFO. There are no other bits.0x1FF810861
MENUTID0x1FF810A08
ACTIVEMENUTID0x1FF810A88
Signed? Headsets connected?0x1FF810C01

This memory page is normally read-only for ARM11 processes, write-access is determined by the process exheader kernel “shared page writing” flag. It is mapped as “shared device” (it is thus uncached) in both cases.

This memory only exists under NATIVE_FIRM/SAFE_MODE_FIRM.

ARM11 Kernel Config Fields #

0x1FF80000 / 0x1FF80060 #

Unknown, this is normally value 0.

KERNEL_VERSIONREVISION / FIRM_VERSIONREVISION #

This is the version-revision for the currently running FIRM.

KERNEL_VERSIONMINOR #

This is the version-minor from ((title-version & 0x3FF) >> 4), for the currently running FIRM. The values from KERNEL_VERSIONMINOR and KERNEL_VERSIONMAJOR can be stored in applications’ CXI exheader.

FIRM_VERSIONMINOR #

This is the same as KERNEL_VERSIONMINOR. After AM:InstallNATIVEFIRM checks FIRM_SYSCOREVER, AM:InstallNATIVEFIRM then compares FIRM_VERSIONMINOR with the NATIVE_FIRM ((title-version & 0x3FF) >> 4), when the latter is larger than FIRM_VERSIONMINOR AM:InstallNATIVEFIRM will trigger a FIRM install.

KERNEL_VERSIONMAJOR / FIRM_VERSIONMAJOR #

This is the version-major for the currently running FIRM.

The kernel initializes KERNEL_VERSIONMAJOR and SYSCOREVER with the same constant value.

UPDATEFLAG #

Normally this flag is zero. When the ARM11 kernel is booting on non-factory FIRM it will set this flag to 1, when bit0 from the data which field 0x1FF80016 is loaded from is clear, if the following PAD buttons are pressed: L, R, A, Up. When this flag is set, NS will launch the System Updater title instead of Home Menu.

NSTID #

This field contains the titleID of the first title to launch from CTR-NAND after the FIRM system processes are loaded. The PM module launches this title. If this field titleID is all-zero, the system will not attempt to launch the title. The regular ARM11 kernel sets this to the regular NS titleID, while the SAFE_MODE ARM11 kernel sets this to the SAFE_MODE NS titleID. The factory FIRM ARM11-kernel sets this to the NS TID from here.

SYSCOREVER #

This field is initialized by the ARM11 kernel, this is the programID-low of the running FIRM. When launching CXIs, the value stored here must match the core version field stored in the CXI exheader. If they do not match, the PM module will refuse to launch the ARM11 process.

With factory NATIVE_FIRM, this is set to 0x0, even though the FIRM programID-low is 0x2. However, the factory system-titles have core-version set to 0x2. Hence, this config-mem SYSCOREVER field might not be used by factory system processes?

FIRM_SYSCOREVER #

Normally this is the same as SYSCOREVER. This used by AM:InstallNATIVEFIRM for comparing with the NATIVE_FIRM titleID-low. When the low u8 from the NATIVE_FIRM titleID-low is larger than FIRMSYSCOREVER, AM:InstallNATIVEFIRM will trigger FIRM installing. When that u8 is not larger than FIRM_SYSCOREVER, and these two values don’t match, AM:InstallNATIVEFIRM will return an error.

ENVINFO #

BitDescription
0Clear for developer unit, set for retail.(See 0x1FF80015)
1IsJtagConnected
2-7?

Bit1 in this field is set by the ARM11 kernel when ARM debug CP14 DSCR bit14 is set (halting debug-mode enabled). NS loads the menu TID from MENUTID when bits 1-7 of this field are clear. ErrDisp will display development error info when bit0 is clear.

UNITINFO #

ValueBoot Env
0Prod
1Dev
2Debugger
3Firm

The ARM11 loads the value of CFG_UNITINFO from 0x1FFFFFF0+1 during startup, which is written by the ARM9 during ARM9<>ARM11 kernel sync.

When this field is zero, bit0 for ENVINFO is set for retail. When this field is non-zero, bit0 for ENVINFO is clear for dev/debug units, and an ARM11 kernel state flag which enables debugging is set. JTAG is only enabled for debugger and “firm” modes (bit1).

PREV_FIRM #

ValueDescription
0Cold Boot
1Reset from CTR mode
3Reset from TWL mode
5Reset from NTR mode
7Reset from AGB mode

The ARM11 loads this value from 0x1FFFFFF0+2 during startup, which is written by the ARM9 during ARM9<>ARM11 kernel sync.

This originates from the low 8-bits of register 0x10010000. When bit0 is set, the ARM11 kernel will not set the UPDATEFLAG to value 1.

KERNEL_CTRSDKVERSION / FIRM_CTRSDKVERSION #

This is the CTR-SDK version which was used to build the currently running FIRM.

APPMEMTYPE #

The value of this field determines the size for APPMEMALLOC. The retail type(value0) is used when the type is not values 2-5. See Memory_layout for the table of values for this and the mem-region sizes.

APPMEMALLOC #

This contains the total size of the memory that can be allocated with the APPLICATION memory-region, see here.

SYSMEMALLOC #

Same as APPMEMALLOC except for the SYSTEM mem-region, see here.

BASEMEMALLOC #

Same as APPMEMALLOC except for the BASE mem-region, see here.

Shared Memory Page Fields #

RUNNING_HW #

Converted from MCU_HW_INFO (names extracted from TestMenu) by PTM, depending on whether or not the system is a N3DS/N2DS or not:

ValueDescription
0Invalid (unknown)
1PRODUCT
2TS_BOARD
3KMC_DEBUGGER
4KMC_CAPTURE
5IS_DEBUGGER
6SNAKE_PRODUCT
7SNAKE_IS_DEBUGGER
8SNAKE_IS_CAPTURE
9SNAKE_KMC_DEBUGGER

MCU_HW_INFO #

Converted to RUNNING_HW by PTM.

ValueDescription
0PRODUCT
1TS_BOARD
2KMC_DEBUGGER
4KMC_CAPTURE
5IS_DEBUGGER
6IS_CAPTURE (N3DS only)

WIFI_MACADDR #

This is the WiFi MAC address for the 3DS. This is initialized by the NWM module and is loaded from the WiFi card’s EEPROM.

3D_SLIDERSTATE #

This float contains the state of the 3D slider. The range of this float is value 0.0f for “off”, and 1.0f for max.

This is written/updated by HID module.

3D_LEDSTATE #

When non-zero, the 3D LED is disabled. See GSPGPU:SetLedForceOff.

BATTERY_LEDSTATE #

Bit[0] is set when the adapter is connected. Bit[1] is set when the battery is charging. Bit[2:4] is the value of battery level. If the connection bit is set but the charging bit is clear, it means the battery is already fully charged but still with adapter connected.

Unknown, contains the menu TID (used by NS)

ACTIVEMENUTID #

This contains the titleID of the currently running menu launched by NS.

NATIVE_FIRM Versions #

See FIRM.