A small computer with its own firmware: how are arranged Lightning-adapters for iOS

They work on a separate OS, which is not even stored in the devices themselves.
Developer Lisa Brown told on Twitter how the lighting and video adapters for iOS are arranged. It turned out that these are mini-computers running on their own firmware, which is loaded from the outside. Brown disassembled one of the devices and studied its software.

HDMI video adapter for iOS Photos from Twitter @nyan_satan

Apple releases two lightning adapters for video output: with digital HDMI and analog VGA . As noted by Brown, both devices support the output of video in Full HD resolution, but “terrible” work. For example, the HDMI adapter on the American Apple website is rated by buyers at 2 out of 5 stars.

The adapters are called Haywire, and they work on a single chip – S5L8747 with serial number H9TKNNN2GD. It is an ARM processor with 256 MB of RAM, but almost nothing is known about it anymore.

The chip is easy to notice if you open the plastic case of the adapter – this is a black square on the board. Photo from Twitter @nyan_satan

As Brown discovered, the adapters work on a separate OS, but nothing is stored on the devices themselves: the firmware is downloaded from iOS or from the network each time. The size of the system is 25 megabytes in uncompressed form.

The folder structure of the chip Lightning-video adapter Photos from Twitter @nyan_satan

The firmware is signed in advance and does not require additional configuration. At the same time, unlike all devices, starting with iOS 5, adapter software (iBSS) supports recovery mode with an interactive shell and is used to load the kernel cache via USB.

Download adapter in recovery mode Photos from Twitter @nyan_satan

According to Brown, SecureROM (or Bootrom) devices can be tricked with hardware “tricks”. This is usually a small bootloader that starts up first when you turn on Apple devices and only works in read mode.

However, according to the girl, in the case of video adapters, at least one person managed to bypass the protection. It could not get a bootloader memory dump, but according to its source, it is “very similar to the A6” (the chip Apple used in the iPhone 5 and 5c).

The developer also noted that the adapters can be easily connected to computers, as they are, in fact, USB devices. To do this, you need to connect Lightning to the parent micro-USB-connector with a few wires and an expansion card.

Adapter connected to PC via USB Photo from Twitter @nyan_satan

For the first time, Apple started talking about the unusual features of Apple video adapters in 2013. Then the staff of Panic noticed that the Lightning-HDMI adapter does not work in Full HD-resolution, but also produces artifacts and is buggy.

Experts decided to find out what it is connected with and began to study how the adapter works. Their first guess was that the device was somehow connected to AirPlay wireless data transfer technology: when dubbing the screen on Apple TV, Panic employees noticed similar artifacts.

I do not mean AirPlay as a network protocol, more like a video compression system. The adapter must somehow establish a connection with the iOS device that is connected to it. It definitely does not transmit a clear signal from the device via HDMI, but rather displays a stream with upscale to 1080p.

from Panic blog

The company also disassembled one of the adapters and found inside the ARM-processor. The staff of Panic came to the conclusion that they were right in guesswork and the adapter actually processes the stream from the iOS device and gives the compressed data to the output. In their opinion, Apple engineers did this because Lightning is not capable of transmitting pure video.

Disassembled Apple HDMI Adapter for iOS Photo

One of the former employees of Apple later suggested that the adapter works on a “mini-iOS”, which is loaded within a few seconds after connecting to the device. Panic explained that this may explain the delay before the adapter starts working.

The bad news? Due to internal streaming, the quality leaves much to be desired and this is not 1080p. We crave a clean, untouched HDMI output.

Good news? If someone complains that this optional adapter costs $ 50, tell them that this is a tiny computer!

from Panic blog

After posting to the Panic blog, a user under the pseudonym Anonymous Coward (“Anonymous Coward”), who introduced himself as an Apple employee, published adetailed commentary. He confirmed some of the guesses of the company’s employees and revealed the likely details of the creation of the adapter.

According to the user, the device’s firmware core is based on XNU, but this is its only similarity with iOS. The software does not have a graphical interface and utilities, and it is intended only for one purpose – to receive data from the user’s device, decode the stream and output it via A / V connectors.

There is a set of kernel modules that are responsible for transferring lower-level data and HDMI output, but that’s about it. I would like to say more, but I do not just publish on behalf of the “Anonymous Coward.”

from the “Anonymous Coward” comment on the Panic blog

The commentator confirmed that the reason for the complexity of the adapter was that the Lightning connector was not able to transmit the HDMI signal in its pure form via cable. According to Anonymous Coward, Apple did not do this to deceive customers. Engineers deliberately transferred all the “difficulties” to the adapter in order to save the owners of iOS devices from problems due to “everything that is on the other end of the Lightning cable”.

This adapter exists only because Lightning is simply not capable of transmitting a “pure” HDMI signal via cable. Lightning is just a serial port.
from the “Anonymous Coward” comment on the Panic blog

The commenter confirmed that the adapter is connected to AirPlay, because it includes a set of hardware technologies for encoding in h264 format. The engineers had access to them, so they used them in the adapter.

At the same time, according to the user, thanks to this solution, Apple can make a Lightning-adapter for any connector, and it does not need to make hardware changes – just change the software. Thus, the company will be able to support the output of the image on any device on the planet, simply by creating an adapter for it.

An anonymous commentator noted that several people in the team are aware of the poor quality of the image and are already working on it, but so far he is considered “acceptable”. He also explained that since the firmware is loaded from the outside and is in RAM, Apple can make changes to the work of the adapters with each release of iOS.

Back to top button