[Replicant] Porting Replicant to Microsoft Surface: hurdles

Mohamed Mediouni mmediouni at gmx.fr
Thu Oct 29 10:37:56 UTC 2015


There is many hurdles to port Replicant in the Tegra 3 family of SoCs,
especially the Microsoft Surface. One of them is Secure Boot*, and can be
worked around via using kexec over the Windows kernel with the Surface
RT(well, not The Right Thing, but works)
The other is managing to get a new kernel(Linux 3.4 doesn't have ACPI on ARM
support). Framebuffer support is not a problem, as UEFI provides a base
framebuffer, which can be used currently with the Linux kernel.
The Linux kernel doesn't provide a simple way to port to another ARM
platform, unlike Windows(HAL extensions for porting Windows on the Qualcomm
Snapdragon 400 for example, are just 30-50 lines)
The problem is that the bootloader won't be free software, and that Windows
is needed for boot(a support ticket has been filed for this, and is now at
Tier-3 support in Microsoft headquarters). The bootloader is of course
signed, or it won't be fun.
The porting process is much harder than sunxi tablets(I have one) where you
can put the sunxi-3.4 kernel and the right u-boot, making it work in a
matter of hours/weeks(got the memory settings horribly wrong on my first
try, but well).
For bootstrapping, I will not care about USB/touchscreen support, but it's
worth noting that you don't have access to a serial port, just a I2C(2nd I2C
controller in the SoC) interface, it would be fun to do debugging over that
:-)  Crash dumps are written to UEFI firmware space, so I can access to them
from Windows after a reboot.
Android GPU drivers are boring, I can't write a working one(tried with
adapting the VC4 GPU driver for Android, crashed at the Android Launcher due
to poor memory management, memory leak)

*There is two backdoor keys for disabling Secure Boot but they can only be
used in Boot Services(before the Windows kernel loader, winload.efi is
started, my current exploit to run kernel mode code happens *just* after
that(ntoskrnl.exe)).

Thanks,



More information about the Replicant mailing list