Mobile Linux Linux 7.2.2 on iPhone XS? First boot!
Hello everyone. Just wanted to share a small milestone I’m pretty proud of.
I’ve been porting Linux to my old iPhone XS for quite some time, and this week I finally made some significant progress.
First: it boots. As a real, alternative OS. This is not an emulation.
Second: I got the kernel log on screen and the framebuffer working:

This is a raw, recovery-based Linux boot. iOS does not take any part in the boot sequence!
I haven’t set up a GitHub repo yet, and the project doesn’t even have a name at this point. But I’ll keep working on it and share more once the process is reliable and reproducible.
64
u/Tactical-Donkey 2d ago
Impressive! Let's see Paul Allen's iPhone.
But seriously, very impressive. I'm glad people are working on big tech alternatives.
17
u/PhilosopherSimilar83 2d ago
How was this done? I'd really like to know!
39
u/Ovaday 2d ago
3 month of everyday reverse-engineering of the iBSS and iBoot... That's how it's done 😅
I'm preparing some kind of an alternative to PongoOS, I took slightly different road. Lots of patches to iBSS to not-switch off the panel, DRAM and skip all iBOOT checks
7
u/TinFoilHat_69 2d ago
Do you know if you found any code that causes IOS device to get stuck in a boot loop? I know it’s hardware related but I’m trying to get around the boot loop I tried pongoOS and checkrain/palerain every time I go into XNU it reboots. I thought a ramdisk may help but at the lower layer in the boot sequence is messing me up atm
1
u/SilverSQL 1d ago
I'm curious about that. Can you share any generic approach? Like, how do you get any output of what the device is doing? I suppose you can't get ahold of a binary of either iBSS or iBoot, so how do you examine them?
3
u/Ovaday 1d ago
Well... you can!
Google "Ghidra", an RE Framework.The rest is experimental. Add a break point, which will definitely crash a device, insert assembler instruction into a carefuly selected place in an iBSS and boot it.
Rebooted? Nice! You have your own code execution (not sure at this moment - as it might crash BECAUSE you have added this instruction). Now cross-validate it and add some other instruction that will not crash a device. Not crashed? Great job!This way, step-by-step, you can actually modify iBSS enough to serve your goals. Works everywhere. But important here - this all above would only be possible to do if you don't have an image validation
4
u/konstantin_gorca 2d ago
Definitely share one day how you managed to do this. I am honestly happy for you, this is great work.
I wanted Linux on my phone amd was told that this is not possible
8
4
u/SuperDefiant 2d ago
It's only possible because of the recent bootrom exploit. This only works up to iPhone 11 unfortunately
2
u/TRKlausss 1d ago
Possible and viable are different things
Possible only if there is an exploit that allows for another OS to be installed.
Viable if the whole software stack fulfills your needs. And right now there are not so good APK translators that work well on Linux. That was a point of improvement for the next years if I’m not mistaken, which would allow for Linux to be installed in common phones without the headaches of not having apps on it.
5
u/SuperDefiant 2d ago
Very cool. I just wish the bootrom vulnerability was exploitable over USB like checkm8 was
8
u/LogSpecialist24 1d ago
Ok we need to talk about something.
Why is it every time i see an iphone its completely broken.
And then i see people with iphones completely refuse repair or using a case and protective glass.
If i had a 1000€ phone i would buy the nicest of cases for it and the nicest of protective screens.
3
3
u/disturbedmonkey69 1d ago
I have also noticed this, for years I worked in IT at a college, and literally every student that came in with an iPhone the screen was cracked!
1
u/TRKlausss 1d ago
In another note, an XS is a phone from many years ago. You’d see the same on a Samsung or Huawei.
3
2
3
u/Abdalnablse10 22h ago
Man that's awesome, I wish I had such skills, there's so many e-waste I would love to reverse engineer for the sake of giving it another purpose, for example, a miracast dongle that I want to convert into a usb to hdmi adapter, I just have no idea at all on where to start.
Best I could do with my lack of skill is combining already existing solutions into a single one, which is solving a puzzle rather than programming anything, the best thing I did with that is installing linux on an allwinner a10s retro game emulation stick.
2
u/TheOgGhadTurner 2d ago
I’m guessing this will only work on XS lmfao
Edit I would love to use it on my 17 but I’m assuming due to Apple it won’t be possible however I’m invested
2
u/Ovaday 2d ago
XS, XR and I believe iPhone 11... Yes, sadly it's true regarding limitations of new iPhones
1
u/TheOgGhadTurner 2d ago
Damn. I’ll be sad if someone gets this working on 13 that’s what I traded up from. I’ve wanted a Linux phone forever but I really don’t want a pixel
1
u/Ovaday 2d ago
I've heard OnePlus and Fairphone got some near-native support of the Postmarket OS?
I got Xiaomi Mi A2 Lite with a Postmarket OS on board, but I don't actually use it as a main phone. A little bit obsolete at this point already
1
u/TheOgGhadTurner 2d ago
I can’t afford to outright buy a phone. And my provider doesn’t offer one plus. I’m looking at that Motorola phone talking about support for graphene tho
1
1
u/Imperial_Bloke69 2d ago
Are you going to install lomiri on this? Splendid piece of work
2
u/Ovaday 2d ago
I actually never tried it... Always used phosh. But from screenshots def worth to check, thanks
1
u/Imperial_Bloke69 2d ago
No problem man, phosh is quite nice too and have decent footprint. Whatever works for your new iLinux-ed. Gotta wait for your github repo
Question: did you fully erased the nand/ufs?
2
u/Ovaday 1d ago
It launches currently from DFU, as a Custom Boot instruction via iBSS -> SRAM -> DRAM. No persistent memory yet (for me it actually helpful, so I can quickly boot a completely new build)
1
u/Imperial_Bloke69 1d ago
Clever, like bootstrapping. I imagine how many man hours burned and coffee to achieve that. I hope your project will gain attention to the ios community.
1
1
u/Inevitable_Mistake32 2d ago
Why tf is it clamped to your desk?
1
u/Ovaday 2d ago
Because of this: https://www.reddit.com/r/linux/comments/1wufh20/comment/pd2rxpr/
The phone is very slippery 😁
1
u/Specific_Parfait8829 1d ago
Funny that I also have a spare OnePlus phone, also with cracked screen and also installed Linux there xD
2
3
u/evilmoder 19h ago
That’s crazy, literally on an iPhone XS Max rn and having it run Linux would be a dream come true
4
u/Ovaday 19h ago
Will share with you a link when I have it at least in some terms stable. Current state supports only USB as a one-side Console/UART
DRAM, SRAM
Screen as a Kernel log.
Basic FS on a limited initframs.Boots every 3-4/5 times. It's really first steps at the moment, not a working system yet :D
So
0
u/ReddevilQ 1d ago
Please share the repo as soon as you make it I’m very interested I still have and iPhone X laying around somewhere
65
u/ch33es 2d ago
it's impressive how there's two freaking lightsabers going through the screen