15 ms·
iPhone 7 with dead NAND netbooting unmodified Ubuntu 20.04 via USB ethernet
- Jonnax 6y agoVery cool! So it looks like they built upon this project that tries to install Android on iPhones. https://projectsandcastle.org/status https://projectsandcastle.org/status They mention: " Apparently they struggled to get Android to run because A10 mandates 16k page sizes" Is that swap space? I assumed these devices didn't use swap.
- auscompgeek 6y agohttps://en.wikipedia.org/wiki/Page_(computer_memory) https://en.wikipedia.org/wiki/Page_(computer_memory)
- Jonnax 6y agoThanks! So I'm guessing the issue might be that Android mandates 4kb page sizes whilst the A10 CPU has a minimum of 16kb. Whilst Ubuntu and other standard distros don't care?
- spijdar 6y agoA lot of software breaks when you're not running 4kb pages. I run a POWER9 desktop, and the default page size is 64kb. A lot of ... interesting problems manifest. Some filesystems like Btrfs and XFS (iirc) have elements that are page size dependent, and can only be opened on systems with the same page size as the one that made them. Some stuff like Wine (and windows in general AFAIK) assumes 4k "alignment" and doesn't like it when it differs) Of course, on P9 you can just change the page size to 4k and be done with it. Apple appears to have only implemented 16KB pages and nothing else, presumably to minimize silicon cost/maximize performance (?)
- gpderetta 6y ago> Apple appears to have only implemented 16KB pages and nothing else, presumably to minimize silicon cost/maximize performance I think it is because, due to quirks of the interaction of virtual address resolutions with cache addressing, it allows Apple to use a larger L1 cache.
- volta87 6y ago> A lot of software breaks when you're not running 4kb pages. The page size on windows is 64kb as well so portable software already needs to deal with supporting 4kB and 64kB pages.
- hrydgard 6y agoNo the page size on Windows is 4kb, however some things like file mapping do require 64kb alignment, due to ancient compatibility concerns with DEC Alpha.
- my123 6y agoDepends on the architecture. Windows on Itanium runs with 8KB pages for example, but that's the exception that confirms the rule.
- gtirloni 6y agoThat's interesting. Would mind sharing what machine is that (p9)?
- tyingq 6y ago"Android mandates 4kb page sizes" I think the language they used is misleading. It's more likely Android has introduced some bugs from assuming page sizes are always 4kb. "Whilst Ubuntu and other standard distros don't care?" Many of the various different architectures Linux runs on have page sizes that aren't 4kb. It's typically defined in a constant called "PAGE_SHIFT" in the arch/<ARCH>/include/asm/page.h file for the architecture. For example, PAGE_SHIFT is 13 for OpenRisc: https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d431a/arch/openrisc/include/asm/page.h#L21 https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9... A quick way to convert that to the page size: $ echo "2^13" | bc 8192
- pantalaimon 6y ago> Is that swap space? I assumed these devices didn't use swap. That would have surprised me, and indeed they write [0] > After a cheerful pre-boot 'Hello, world!' hand-coded in start-up code assembly, we ran into the first one: it turned out that the processor cores don't merely support 16kB pages, but they actually require them. The Linux kernel, however, took this in stride, and as soon as we switched the page size configuration option, it was happy to run. [0] https://projectsandcastle.org/history https://projectsandcastle.org/history
- quietbritishjim 6y agoThat quotation doesn't mention swap (AKA the page file), only pages in general. Virtual memory is always divided into pages. Each of those individual pages can be backed by physical memory, the page file, or indeed other files (e.g. for memory-mapped I/O).
- deleted 6y ago[deleted]
- newscracker 6y agoSounds cool. This could be a way to put older devices to use for some of the things (certainly not all) that a Raspberry Pi is used for. The lack of any physical ports for expansion is a big drawback, but the processors are a lot more capable than typical SBCs (single board computers).
- Nextgrid 6y agoOlder phones definitely beat Raspberry Pis on both price and features. For barely the same price as a Pi + a decent SD card you get the equivalent of a Pi + a touchscreen, internal NAND, mobile networking, GPS, sound (speaker & mic), a battery backup with built-in charging circuitry and accelerometer/gyroscope sensors.
- ta988 6y agoYou don't get the GPIO, external display, many usbs, Ethernet, now pcie if you solder a bit etc... Not really equivalent
- SulfurHexaFluri 6y agoYou could get all that with the usb port. I have certainly tried plugging a USB OTG cable in to a usb to ethernet cable in to a pixel phone and it actually worked and had a special icon for ether net
- segfaultbuserr 6y agoYes, but nowhere near the performance of GbE, PCI-E, or even USB 3.0 for an iPhone.
- SulfurHexaFluri 6y agoI doubt many raspberry pi projects need any of that. You could run a basic web server on an iphone just fine or plug it in to your model car to control using a lightning to usb adapter.
- Nextgrid 6y agoRunning graphical desktop environments also appears to be possible: https://blog.project-insanity.org/2020/04/22/linux-with-wayland-is-now-running-on-iphone-7/ https://blog.project-insanity.org/2020/04/22/linux-with-wayl...
- userbinator 6y agoOnce you have a framebuffer, GUIs will follow naturally. Getting graphical acceleration, on the other hand, is much more difficult work.
- chmod775 6y agoI suppose Apple "fixed" whatever made this possible in later phones?
- mcc1ane 6y agoIt should be "checkm8" - works on A5 to A11 (iPhone 4S to iPhone X).
- amelius 6y agoApple could gain some serious acceptance in developer/hacker circles if they would allow their hardware to become open after a fuse is blown.
- bognition 6y agoYeah but that would dramatically interfere with their resale program
- pmiller2 6y agoHow so? People who would even think about doing this certainly make up an extreme minority of iPhone users.
- londons_explore 6y agoApples old hardware isn't all that closed - most models have enough exploits it's very possible to get your own low level code running. The key issue is that hardware drivers aren't there, and that requires a massive amount of reverse engineering work. Apple could release documentation for the hardware, making things easier, but from apples point of view that opens them up to patent litigation (you can be sure trolls will scour the documentation for evidence of violated patents), and most internal documentation isn't of sufficient quality to release without at least someone reading it all over and removing swearwords... Collecting the documentation together will be hard - it is probably scattered amongst hundreds of git repos, wikis, documents, spreadsheets, photos of whiteboards, on some engineers laptop, and mixed in with code and secrets. Even then, without a lot of people putting a lot of effort in, you wouldn't see desktop linux running... Overall, I can see why Apple doesn't help these guys - the disadvantages outweigh the advantages.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- 0x0 6y agoSeems to require a custom kernel instead of an "unmodified Ubuntu" kernel, still pretty neat!
- ohduran 6y agoDoes this work with a 7Plus as well? Asking for a friend.
- LockAndLol 6y agoYou could try it, if you ain't using the phone for anything.
- raldi 6y agoThe submission never explains what "dead NAND" refers to.
- emeraldd 6y agoMy first thought would be flash storage. So I would read that as no or failing local storage on the phone.
- masklinn 6y agoWhat could it refer to but the flash storage of the phone? Hence the NetBoot: the phone has no working non-volatile storage.
- raldi 6y agoThe logic gate was my only familiarity with the term.
- remram 6y agoFlash memory comes in multiple flavor, named after the logic gates that the organization of their transistors resemble. So there is NAND Flash, NOR Flash, and Vertical NAND Flash memory. I agree that referring to "NAND Flash Memory" as "NAND" is rather confusing. Similar to referring to "crypto-currency" as "crypto".
- segfaultbuserr 6y agoAnd similar to referring to a "CMOS image sensor" as "CMOS" or referring to a "battery-backed CMOS SRAM" (for BIOS configuration) as "CMOS"... But due to historical reasons (e.g. CMOS made battery-backed SRAM possible, NMOS or PMOS drains the battery in no time), these terms are stuck forever.
- infinita740 6y agoFrom the end of the post: > This iPhone would never be able to boot iOS again, as its nvme nand is completely dead.
- pedrocr 6y agoIt would be a potentially smart move by Apple to allow installing other OSs in iOS hardware. The market share grab part of this segment is mostly gone so they probably wouldn't lose much and it would help with their arguments about the App Store and other iOS restrictions. They could say that in iOS those are the rules but if you want to do something else with the device you own you can install something else. It might even win them some customers. They would win my business if I could install an open-source OS under my control on a phone like I do on my laptop. LineageOS is not even close unfortunately because of poor hardware support.
- gmemstr 6y agoThat doesn't really match up with the ethos of Apple or why people buy their products though, so it doesn't make any sense for Apple to allow or endorse this.
- MereInterest 6y agoCorrect, it doesn't make a profit for Apple to sell devices, rather than just renting them. That's why it shouldn't be up to Apple to decide whether a device sold belongs to the buyer, or still belongs to Apple. If I buy it, it is mine, and I have the moral right to put whatever OS I what to on it, regardless of Apple's ethos.
- coldtea 6y ago"Correct, it doesn't make a profit for Apple to sell devices, rather than just renting them." I've seen this argument again, but this is a redefinition of sell vs rent. Apple sells the device with specific capabilities. You might want it to have others, but that's not the same as renting. If you don't like it, buy something else. You do get to do "whatever you want" with the device AS provided. You can stomp on it, melt in in a fire, or whatever, and Apple wont ask you for the device back. That's a sale. "I wanted another version of the device, one that is unlocked, and Apple doesn't sell me one" doesn't mean Apple doesn't sell you what it says on the tin. They're selling iPhones, locks and all, not generic devices to have different OSes loaded.
- Jermaine_Jabi 6y agoWould this have full access to the iPhone hardware? Or is it more like alternative OSes on consoles where some cores are not available? Also very cool!
- darepublic 6y agothanks for the old.reddit link
- ezconnect 6y agoThey would probably open up their old hardware if they could get carbon credit for it for being recycled to a usable device, but the economics is just too small as an incentives for that to happen.
- newhacker1746 6y agolol, I came here to see this at 420 points... nice I got the graphics running as well! https://www.reddit.com/r/linux/comments/kvmsfd/success_iphone_7_booting_ubuntu_2004_to_full/ https://www.reddit.com/r/linux/comments/kvmsfd/success_iphon...