1. Starting with a Base Firmware Image. - dmikey/retros GitHub Wiki

This entry documents the early development of RetrOS, a custom firmware project for the RK3326-based Clone R36S handheld console.


๐Ÿ› ๏ธ Initial Discovery

The device in question is a clone of the R36S handheld, notable for the following quirks:

  • It boots from internal NAND rather than SD card by default.
  • It uses a dual-SD slot design (TF1 and TF2), but TF1 is prioritized for booting if properly prepared.
  • The internal EmuELEC-based system is heavily customized, featuring:
    • Inverted joystick axes
    • Custom device tree (rf3536k3ka.dtb)
    • Broken or inconsistent audio/volume controls in non-factory firmwares

๐Ÿงช Partition Layout (Internal NAND)

On inspection via shell access to the running system (lsblk, mount, blkid), the internal eMMC (NAND) revealed the following partition structure:

Partition Label Filesystem Purpose
mmcblk0p1โ€“p2 (none) - Possibly reserved/bootloader
mmcblk0p3 EMUELEC VFAT /boot โ€“ Contains KERNEL, SYSTEM, DTB, extlinux.conf, boot.ini
mmcblk0p4 - ext4 SWAP partition to account for missing 512mb RAM
mmcblk0p5 STORAGE ext4 /storage โ€“ EmuELEC data and configs

Note: Bootloader likely resides in hidden mmcblk0boot0 / boot1 regions and was left untouched.


๐Ÿงฑ Base Firmware Construction

To establish our starting point for RetrOS, we cloned the internal NAND firmware to an external SD card, bootable from TF1.

๐Ÿ” Copying SYSTEM and KERNEL

We mounted the internal /var/media/EMUELEC partition and extracted the following key files:

  • KERNEL โ€” The device's custom kernel binary
  • SYSTEM โ€” The SquashFS root filesystem used by EmuELEC
  • boot.ini, extlinux.conf โ€” U-Boot boot configs
  • rk3326-evb-lp3-v12-linux.dtb โ€” Device Tree Blob (DTB)
  • logo.bmp, logo_kernel.bmp โ€” Boot splash assets

We copied these into the aeolusUX-unlocked-k36-clean/ directory structure on a fresh TF1 microSD card, formatted with:

  1. EMUELEC (FAT32) โ€“ for boot files
  2. STORAGE (ext4) โ€“ for runtime data

๐Ÿงช Matching Configuration

We edited extlinux.conf to ensure proper partition labeling (boot=LABEL=EMUELEC disk=LABEL=STORAGE) and verified that the card mimicked the internal structure. This allowed us to boot successfully from TF1 without interfering with internal NAND.

This became our baseline for future modification, and is the version referred to in the project tree as:

/aeolusUX-unlocked-k36-clean/

๐Ÿ“‚ Directory Structure (Clean Base)

aeolusUX-unlocked-k36-clean/
โ”œโ”€โ”€ extlinux/
โ”‚   โ””โ”€โ”€ extlinux.conf          # Bootloader config
โ”œโ”€โ”€ KERNEL                     # Kernel from internal NAND
โ”œโ”€โ”€ SYSTEM                     # SquashFS root filesystem
โ”œโ”€โ”€ SYSTEM.md5                 # Hash for verification
โ”œโ”€โ”€ KERNEL.md5                 # Hash for verification
โ”œโ”€โ”€ boot.ini                   # Alternate U-Boot config
โ”œโ”€โ”€ logo.bmp / logo_kernel.bmp# Splash screen assets
โ”œโ”€โ”€ rk3326-evb-lp3-v12-linux.dtb # Clean DTB (used as main)

๐Ÿ“ Factory Firmware Dump

A separate copy of the entire factory image was retained under:

/clone-factory-base/

This includes:

  • rf3536k3ka.dtb โ€“ factory DTB (known for inverted sticks, and less compatibility with community kernels)
  • Original KERNEL and SYSTEM files (for fallback or comparison)
  • Original extlinux.conf and boot.ini

This dump remains important for driver reverse engineering, DTB diffing, and as a rescue image if SD experiments go sideways.


๐Ÿ”ฎ Next Steps

  • ๐Ÿ”ง Begin customizing the kernel config to re-enable volume controls, fix joystick mapping, and support Wi-Fi.
  • ๐Ÿงฌ Build a reproducible build script or Git repo for generating future updates to RetrOS.
  • ๐ŸŒ Add RetrOS system support for running minimal services.
  • ๐Ÿงฐ Improve device tree for reliability across clone variants.

๐Ÿ“Œ Notes & Learnings

  • Internal NAND is safe to leave untouched as long as boot priority is respected.
  • SD card boot requires matching partition labels and DTB compatibility.
  • Kernel and SYSTEM compatibility are critical โ€” a mismatch can break controls, audio, or boot entirely.
  • Cloning working elements from NAND gave us a stable, trusted foundation to build on.