The first thing that is worth mentioning here is the secure boot chain. This means that all components involved in the system code execution are signed by Apple and thus comprise a chain of trust, including the following:
- Boot ROM: The first code that is being executed once the device is turned on. Located in the read-only memory, it verifies the next stage, either iBoot bootloader (on newer processors) or the Low-Level Bootloader (LLB). A failure at this stage results in the device entering Device Firmware Upgrade (DFU) mode.
- LLB: Available on older devices shipped with A9 and older A-series CPUs, it is eventually responsible for verifying and loading the iBoot.
- iBoot: Once finished, it verifies the OS kernel before allowing it to be loaded. A failure in either the iBoot or LLB stage results in the device entering recovery mode.
- iOS kernel: After the initialization, a mechanism called Kernel Integrity Protection (KIP) is enabled. The idea behind it is to keep the kernel...