How 0xsojalsec/ios-sweet works
ios-sweet ports the iOS 16-era XNU kernel to the Redmi Note 10 Pro and boots an unmodified iPhone X iOS userland. The main path is the stock bootloader launching the shim, which loads an XNU payload and generated Apple Device Tree; XNU then mounts the writable HFS+ root and starts launchd and the graphical userland. The README also documents device-specific CPU, display, input, identity, and activation support. Kernel behavior is represented by the relevant patch files; unsampled XNU internals and wiring are not inferred beyond documented relationships.
Main entry points: shim.c Shim entry · patches Patched XNU · mkadt.py ADT builder · loader.c Payload loader
Components 21
Boot shim
- Shim entry
shim/shim.c - Framebuffer console
shim/console.c - MMU setup
shim/mmu.c - FDT reader
shim/fdt.c - Payload loader
shim/loader.c - UFS probe
shim/ufs.c
Boot data
- ADT parser
tools/adt.py - ADT builder
tools/mkadt.py - Kernel packer
tools/mkpayload.py
XNU port
- Patched XNU
xnu/patches - UFS root driver
xnu/patches/0028-sweet-ufs-root-device.patch - HFS+ root support
xnu/patches/0026-sweet-builtin-hfs.patch - Software display
xnu/patches/0046-sweet-iosurface-iomfb.patch - Touch and keys
xnu/patches/0060-sweet-keys-touch-drivers.patch - Device identity
xnu/patches/0059-sweet-iphone-identity.patch - Native activation
tools/mkadt.py
iOS runtime
- HFS+ userdata
- iOS userland
- SpringBoard GUI
Other components
- Xiaomi bootloader
- Phone hardware
Connections 24
- Xiaomi bootloader → Shim entry: boots
README.md - Shim entry → Framebuffer console: writes status
shim/shim.c - Shim entry → MMU setup: sets up
shim/shim.c - Shim entry → Payload loader: loads payload
shim/shim.c - Payload loader → FDT reader: reads chosen
shim/loader.c - Shim entry → UFS probe: runs probe
- ADT builder → ADT parser: uses parser
tools/mkadt.py - Kernel packer → ADT parser: parses ADT
tools/mkpayload.py - ADT builder → Kernel packer: supplies ADT
README.md - Kernel packer → Payload loader: packages boot data
README.md - Payload loader → Patched XNU: jumps to
shim/loader.c - Patched XNU → UFS root driver: includes port
- UFS root driver → HFS+ root support: mounts root
README.md - HFS+ root support → HFS+ userdata: reads and writes
README.md - HFS+ userdata → iOS userland: provides root image
README.md - iOS userland → SpringBoard GUI: starts GUI
README.md - Patched XNU → Software display: provides services
README.md - Software display → Phone hardware: presents frames
README.md - Patched XNU → Touch and keys: delivers input
README.md - Touch and keys → Phone hardware: reads input
README.md - ADT builder → Device identity: sets device tree
tools/mkadt.py - ADT builder → Native activation: sets security status
tools/mkadt.py - Native activation → iOS userland: selects activation path
tools/mkadt.py - Patched XNU → Device identity: reports identity