Difference between revisions of "Mario Kart Live: Home Circuit"

From Nintendo Switch Brew
Jump to navigation Jump to search
Line 3: Line 3:
 
Communication with the kart is done directly over local-WLAN via [[LDN_services|lp2p:app]]. The service implementation is in the main-codebin itself, without symbols - however there are strings for this. This is the first title on retail which uses lp2p.
 
Communication with the kart is done directly over local-WLAN via [[LDN_services|lp2p:app]]. The service implementation is in the main-codebin itself, without symbols - however there are strings for this. This is the first title on retail which uses lp2p.
  
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func.
+
This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:
 +
* The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.
 +
* TODO: initialization
  
 
RomFs contains only two files:
 
RomFs contains only two files:

Revision as of 16:19, 16 October 2020

This page documents the Mario Kart Live: Home Circuit game.

Communication with the kart is done directly over local-WLAN via lp2p:app. The service implementation is in the main-codebin itself, without symbols - however there are strings for this. This is the first title on retail which uses lp2p.

This is also the first known title on retail which uses stack cookies. This is used by main-codebin, the ssp functionality in sdknso is still not used other than being called from an initialization func. This is implemented in the main-codebin as follows:

  • The global u64 __stack_chk_guard is loaded then saved immediately before {first saved register} on stack, during func entry. During func exit, the global u64 is compared with the cookie on stack, it will call __stack_chk_fail on mismatch. __stack_chk_fail just executes an undefined instruction to trigger a crash.
  • TODO: initialization

RomFs contains only two files:

  • "data.zip"
  • "update.pua": This is probably the firmware update data for the Kart. This is likely encrypted: one of the strings in here is "generic/tee.bin.aes".

Kart

OSS is available for the kart itself.

This uses Linux. The 1.1.0_3 archive contains the following:

 busybox-1.22.1.tar.bz2
 eudev-1.5.3.tar.gz
 kmod-17.tar.xz
 libnl-3.2.24.tar.gz
 linux-kernel_5c3cb2e0be2243f6d4553ccad2047c9d72e25ea2.tar.gz
 lrzsz-0.12.20.tar.gz
 PsdDriver_5a8d821.zip
 rtl8188eu_074cc66fece232b0d5f1e1f7de57e72022ec12b1.tar.gz
 uboot_53a0fa98b176329e340b0a2fca6edb7117209751.tar.gz
 util-linux-2.24.2.tar.xz

PsdDriver is Nintendo's custom kernel module, the GPL license header used in the source starts with the following:

 * Sensors and Motors driver
 * Copyright (C) 2020 Nintendo Co, Ltd

The only changes in the OSS for 1.0.0_1 -> 1.1.0_3 are the following (note that there are more versions between these):

  • The following archives were updated: linux-kernel, PsdDriver, rtl8188eu, uboot.
  • In the PsdDriver source, the line-ending at the start of various source files was updated.
    • In sources/psd_util.c, initialize_table(); is now called by a dedicated psd_util_init_crc8 function instead of psd_util_get_crc8, which is now called by device_init in sources/psd.c.

The above git-commit-hashes (?) from the filenames doesn't seem to match commits in the upstream repos.