26 ms·
Linux Running on Apple M1
- rvz 6y agoGreat progress already thanks to Corellium for the M1 linux projects [0][1], the PongoOS project and to all others involved. Getting GPU acceleration is now the real challenge. [0] https://github.com/corellium/preloader-m1 https://github.com/corellium/preloader-m1 [1] https://github.com/corellium/linux-m1 https://github.com/corellium/linux-m1
- kzrdude 6y agoCan someone explain what a .dts file is?
- saagarjha 6y agoIt's a device tree: https://en.wikipedia.org/wiki/Device_tree https://en.wikipedia.org/wiki/Device_tree
- JustFinishedBSG 6y agoWell. GPU, networking, power management, disk... There's more than 1 huge challenge
- uncledave 6y agoThat is some insanely fast progress. Well done and hats off to all involved.
- saagarjha 6y agoThis was quite fast considering that Apple opened up booting custom objects sometime last week…it seems to still be software rendering for now, but it's good to see this progressing so quickly. It seems that there is effort being put into upstreaming this too (despite a couple of unfortunately hitches :/) so we might be seeing this ready for general-purpose use quite soon!
- cillian64 6y agoApple officially opened up booting custom images on the M1? Do you have any more information about this? I had a quick search and couldn’t find any news stories.
- kevinbowman 6y agoThis is probably what was being referenced: https://news.ycombinator.com/item?id=25772462 https://news.ycombinator.com/item?id=25772462 "macOS Big Sur 11.2 beta 2 is out with full custom kernel support" ... "The OS now finally includes the firmware and bootloaders and tools necessary to replace Big Sur with not-Big-Sur. That was previously not possible."
- saagarjha 6y agoIt’s not something that would probably get reported widely, but the bputil command (which manages boot policy, as the name suggests) and kmutil now work as of the second beta of 11.2 and allow for you to provide your own code to run.
- mprev 6y agoI hadn't thought about Yellow Dog Linux in years until seeing this. Discontinued in 2012, which is understandable after Apple's switch to Intel.
- gorgoiler 6y agoAh the memories of yaboot blessing /dev/hda1 with holy penguin pee...!
- geogra4 6y agoTheir great contribution to the rpm world is yum
- ficklepickle 6y agoFor some reason it was the distro that ran best on the ps3, I seem to recall.
- Jonnax 6y agoThe reason is that Apple used PPC CPUs in their Mac's before Intel And this was a distro geared towards PowerPC hardware.
- pantalaimon 6y agoThese days it would be T2 https://t2sde.org/ https://t2sde.org/
- laktak 6y agoThis is cool but technically I'd say it would need to use the disk in the Mac to be running "on" the Mac.
- JosephRedfern 6y agoWhy's that? If I netboot Linux on my desktop PC, is it not running "on" my desktop PC? Is the CPU/SoC not the thing on which then operating system is running?
- coldtea 6y agoTechnically yes. But people want to have an M1 laptop on which they can run Linux. Not a laptop + external disk + other baggage.
- JosephRedfern 6y agoI agree with that. But given the context -- an experimental build targetting a new SoC, I wouldn't personally dispute the claim that it's running on an M1 machine. If the tweet was claiming that it was ready to go for general use and that everyone should install it and use it as their daily driver, then I could see that the external boot disk caveat would be more significant... but it seems kind of irrelevant in the context of what they've achieved so far.
- dastx 6y agoI think running it on disk is probably the least of their worries. As I understand it, the GPU is the biggest hurdle to jump.
- viraptor 6y agoThere's a bit of competition now going between asahi and corellium. While most of the spicy tweets have been removed, there's a summary https://twitter.com/AsahiLinux/status/1350547056679477250 https://twitter.com/AsahiLinux/status/1350547056679477250 Essentially, while this project may be quicker to get visible results, they may not be able to release all the code kosher for merging upstream. It will be interesting to see the next steps.
- saagarjha 6y agoCompetition is fine, but the "spiciness" was really just drama+pettiness on both sides :/ I'm hoping they're both past that now, as they should know better, but having two competing projects unable to assume good faith from each other is generally not healthy at all.
- Geminidog 6y agoThe more spiciness and completive things are the better the overall results. We all like to think that collaboration, harmony and love drives innovation but much of innovation is built around intense rivalry and competition as well. Don't be idealistic to a fault, much of the qualities we view as petty exist because they passed millions of years of natural selection. Those who compete, thrive. Winner takes all.
- gumby 6y agoI think that's a bit zero sum. The world needs both to advance.
- Geminidog 6y agoObviously. When teams of people compete intensely , the collaboration within the teams themselves must be just as intense. I find it slightly offensive that someone would accuse me of discounting collaboration when 1. I never discounted it, 2. It's obvious that society is full of people who collaborate. In what universe are the words "zero sum" apt for my response? None. I never described a zero sum game. Obviously, the replier added the description with his biased imagination. I'm just saying spiciness and intense rivalry and competition can lead to results beneficial to society. There are tons of examples of intense competition and rivalry leading to great results in science. The decoding of the human genome for one.
- thomasfl 6y agoA Raspberry Pi powered by something similar to the M1 or A14 bionic processor would be something. The Broadcom 1.5 GHz 64-bit quad-core ARM Cortex-A72 that powers the latest raspberry pi, is nothing compared to the new processor beasts from Apple.
- cecja 6y agoYou are comparing apples and raspberries the one thing costs 1k the other thing costs 50 bucks.
- flyinghamster 6y agoWe already have the Mac Mini, but an A14-based SBC would be less of a stretch than an M1. A picoMac, so to speak? That would almost inevitably run MacOS by default rather than Linux, though. The GPU is make or break for Linux. No GPU means it's just another server in a different form factor.
- geerlingguy 6y agoThat's basically the Apple TV. Let that thing have more standard IO, and run Linux, and it'd be a heck of a fanless machine.
- saagarjha 6y agoThe latest Apple TV has a fan :(
- bayindirh 6y agoWhile Raspberry Pi may not be as powerful as an M1, I'd not discount any of these small boards. I have a OrangePi Zero w/ 512MB RAM at home and it handles a lot of stuff (Syncthing, DNSMasq, rsync based backups and more) without a glitch. The only thing it doesn't like to handle SFTP encryption at high speeds. Processor gets visibly strained and overheats after a 4MB/s or so.
- MisterTea 6y agoAn Ampere or other Arm server chip would fit the bill. Aside from Apple, no one is making arm chips to serve the laptop/desktop segment. So there's this HUGE gap between the endless sea of embedded/mobile Arm chips and then jumps to a handfull of mega-many-core server chips. Apple is finally filling in one of the Arm gaps with a mid-tier chip that can handle a desktop load efficiently while an efficient GPU can handle graphics without thermally clobbering each other.
- jcstryker 6y agoLove to see the competition between the projects trying to get linux running on the m1. Though I think they will hit a wall trying to enable GPU support. I think opening up just enough to enable this effort also serves as some good nerd marketing for Apple. This race keeps the m1 in the news regularly, giving hope to those who want a low-power and performant ARM machine that wouldn't otherwise consider an apple machine.
- Twisell 6y agoWhat will be interesting though is to measure the raw performance of this initial CPU only rendering. For now on it's a still image we don't know if it's sluggish as hell or actually pretty decent even without a GPU. If the latest is true that could prove to be another prestige point for the M1.
- varispeed 6y agoDoes it actually require any serious development or it is just mostly tweaking and changing things here and there? I am sorry if that sounds ignorant, but I thought these are just low hanging fruits to harvest. Also why Apple wouldn't do that themselves? To me it is an opposite to "nerd marketing", a big middle finger to Linux users - essentially "you are on your own".
- saagarjha 6y agoA middle finger from Apple would be locking the bootloader–keeping it open, plus providing minimal tooling and telling people to figure it out, is about as close to "we'd love to see what you'll do with it" as Apple could possibly give. (Dealing with the GPU is going to be the majority of the work, I'd think.)
- varispeed 6y agoThat would definitely be crossing the line. But I wonder if this behaviour of Apple is another avenue of stifling competition - that is how many smart people this will get involved that otherwise could have worked on a competing product? Then you can see how much resources any company dealing with Apple has to commit just to make sure their software keep up with Apple updates - that inhibits their growth and thus keeps Apple on top.
- exikyut 6y ago(Waiting for page to load) "Nice, so they finally got a kernel to boot. I wonder what fancy way they'll be showing the dmesg infor--" "Oh." I think I need to recalibrate my idea of a 10x developer... (The standard would seem to have ratcheted up somewhat as the years have gone by!)
- londons_explore 6y agoWhen the kernel boots, and you have a framebuffer working, all of userspace and gnome will probably just work with no modifications. You might have to play shenanigans like copying a complete filesystem into a ramdisk from the bootloader if your kernel doesn't have support for any IO/networking/storage devices. But you'll still be able to get this screenshot! Having said that, they have USB working, which is quite an effort, although I'd guess it's an IPCore that a driver already existed for, so it was a simple matter of figuring out memory mappings etc. With USB working, you can make a very usable system, because pretty much any peripheral will work over USB.
- floatboth 6y agoYes, USB is the same Synopsys DesignWare piece of..hardware that you can find on all the Allwinners/Rockchips/Amlogics/whatever. They wrote a driver for the "binding" crap around this to make the controller work, yeah. And some Type-C stuff (Apple handles it in software)
- wmf 6y agoNote that this team already ported Linux to the iPhone, so what they did recently was update their iPhone port to support M1.
- exikyut 6y agoI see. The hardware history stories/narratives are getting absolutely hilarious, IMO... :)
- uberduper 6y agoUntil I have a post-EOL OS option for an M1 mac, I'm not buying.
- londons_explore 6y agoWhat's DART?
- saagarjha 6y ago"Device Address Resolution Table"–essentially an IOMMU.
- vespakoen 6y agomarcan, who is working on AsahiLinux, is streaming at this time of writing and just got the framebuffer working, this is one of the most interesting live-code-streams I have seen. https://www.youtube.com/watch?v=GxnWuXgj3JI https://www.youtube.com/watch?v=GxnWuXgj3JI
- monopoledance 6y ago> Started streaming 8 hours ago WTF.
- aorth 6y ago> Started streaming 9 hours ago Still going. Don't think even stopped to eat, drink, or bio break. I'm also surprised his computer hasn't crashed or something! Really fun to watch him work.
- monopoledance 6y agoYeah, fascinating and a bit morbid. It's 10h now. I really think this is getting unhealthy hyperfixation and I really hope this is unusual for marcan, as this comes at a cost you can never make up for again. Btw. if you enjoy these extended coding streams, you may like the Scanlime livestreams: https://www.youtube.com/c/scanlimeinprogress/videos https://www.youtube.com/c/scanlimeinprogress/videos. She's also a fascinating person to observe in her natural environment. The videos are also low key trippy and artsy. Main channel here: https://www.youtube.com/c/scanlime/videos https://www.youtube.com/c/scanlime/videos
- 2bitencryption 6y agosaving this for later. this is where the rubber meets the road. super interested in seeing the workstream these super-techncially-skilled devs use
- BrawnLongHaul 6y agoCan I have a Beowulf cluster of those? (yes, I am a grey haired BOFH)
- acomjean 6y agoI understand there is a thing with trying to run Linux everywhere, and it’s a fun exercise. Even if Apple does do some open source support, Even if that hardware isn’t quite as nice, I prefer to buy/support hardware and vendors that support Linux at this point.
- iSnow 6y agoUnderstandable and I was ready to buy a Dell XPS as I like the "small and light" form factor. I was just waiting for the COVID buy spike to subside and see how my financial situation would evolve. But I have pushed the decision back to see how Linux will be running on the M1. From first reports, it is simply tailor-made for a laptop computer that doesn't get burning hot or dog slow because of thermal throttling. I hope intel and to a lesser extend AMD are looking at this thing red-faced. But they will need some time to play catch-up.
- hitpointdrew 6y ago>I hope intel and to a lesser extend AMD are looking at this thing red-faced. But they will need some time to play catch-up. I think it raised their eyebrows a bit, but don't agree that they need some time to play catch-up. Bottom line is the vast majority of Intel and AMD chips are running Windows. You can't even buy Windows 10 for an ARM processor. Microsoft flirted with the idea at one point, but has pretty much abandoned it. So why would Intel or AMD market ARM chips at all when Microsoft isn't supporting them at all? If you are talking about servers that is a different story (since lots of servers run Linux). AMD already made a server with an ARM processor, the latest "Opteron" series was ARM https://www.amd.com/en/amd-opteron-a1100 https://www.amd.com/en/amd-opteron-a1100 These came out in 2016 and don't think they sold nearly as well as Epyc has. Taking a second look at offering ARM for the datacenter in the fture might not be a bad idea for AMD though.
- swiftcoder 6y agoTheir catch-up need not be in the form of an ARM chip. If they can get an x86-compatible chip to match the M1's performance at with similar thermals/battery, that's even better.
- CivBase 6y agoI'm excited for Linux support on the M1. I don't even have a Mac Book, but more incentive for Linux apps to support ARM is a good thing.
- fabianhjr 6y agoMost distros have had ARMv8 (AArch64) support for a while now, Apple didn't invent RISC/ARM this year. The most common AArch64 distro usage is on RaspberryPies
- CivBase 6y agoYeah, but there wasn't consistent ARM support like there was for x86. It was only a few months ago that the desktop release of Ubuntu didn't support ARM.
- ianai 6y agoI wonder whether linux could benefit from the specific architecture changes of the M1. Apple's made a big technical claim of the hardware acceleration of reference counting - another OS and toolchain optimizing around it to any extent would test their claims. This both reads a little overly optimistic to me knowing how proprietary things are - but linux and foss software have history of running on all manner of platforms. Arguments based on: "you can only get a client machine with at max 16 gig of ram" or "you can't plunk an M1 into a server chassis with all the hardware you need" and so on may be various amounts of preliminary (we only have 1 chip from them yet and it's clearly a 'first out the door' type near-beta) to actually relevant.
- throwaway22442 6y agoThis guy also got pardoned by Trump. Happy to see frame buffer, excited for great linux experience on m1.
- nedsma 6y agoAny information on battery life?
- pantalaimon 6y agoYes, there is no battery on the Mac mini.
- midrus 6y agoLinux might run, but good luck with the drivers. And good luck with it keeping working with future upgrades of both, hardware and software. Heck, even today it is pretty difficult to get things working reliably unless it is a thinkpad or some other Linux friendly brand. A Mac with subpar support for a webcam, energy saving, suspend/resume, the trackpad, brightness/volume controls, etc is not a laptop, it's an expensive paperweight. In my opinion, other than doing it for the sake of learning and the challenge of it, this will lead nowhere in the long term unless you get any kind of commitment or support from Apple. And I hope I'm wrong but that's very, very unlikely to happen any time soon.
- Wowfunhappy 6y agoI have confidence in the parallel efforts being spearheaded by Marcan. He knows what he's doing and he's working on it full time.
- midrus 6y agoAnd that's why this has no long term future. There are not that many people able to achieve this. One single person can't do it forever.
- Wowfunhappy 6y agoPresumably Apple isn't going to redesign their GPU architecture every generation? How much maintenance do you see this needing?
- asveikau 6y agoUhh... Linux supports a lot of hardware. Probably a lot of in-tree drivers that still get use were started as reverse engineering efforts by a small number of people. Perhaps you're meaning to say Apple will iterate the hardware faster than people can add Linux support? That's plausible. It also was the status quo of Linux on PCs for many years. (Still the case with some hardware I guess.) That hasn't killed Linux yet.
- Jnr 6y ago
- titzer 6y agoQemu is also several kinds of broken on M1. I was able to get qemu to boot an x86 Linux after applying a huge pile of patches I found on a forum. If you are expecting to get up and running instantly with a VM to put all of your comfy old software in, not so fast!
- saagarjha 6y agoHow so? I've been using QEMU to boot Intel guests without issue for almost six months…
- titzer 6y agoOn the M1? I could only get it to work with some patches I found on some forums from < 1 month ago. The issue seems to be hardware wx protection, among other things.
- saagarjha 6y agoOh, right, I just disabled that: https://gist.github.com/saagarjha/d1ddd98537150e4a09520ed3ede54f5e https://gist.github.com/saagarjha/d1ddd98537150e4a09520ed3ed...
- titzer 6y agoInteresting. Do you work for Apple? The qemu patches that split up the RX/RW jit regions are maddeningly complicated. I'm curious if anyone has suggested this solution to them?
- saagarjha 6y agoI don't. To be clear, this isn't an actual fix, it just turns off W^X enforcement altogether. It's certainly not something that should be merged upstream–the real fix should be to adopt W^X in the JIT (which is more complicated, as you may have seen).
- glitchc 6y agoUntil the Linux kernel leverages instructions specific to Apple M1's extended ISA, this is a waste of time. The whole point of the M1 experience is that out of the box, it's fast, silent and runs for days. Yes, Linux will run, as it would run on any ARM processor, but it will be slow, hot and run the battery down in a couple of hours. It will take years for the open-source community to reverse-engineer the ISA and write kernel code that optimally utilizes it. There's no shortcut here. Until then, it's not worth buying a Mac just to run Linux on it.
- izacus 6y agoWhat specific instructions? I've been told by Apple fans on this site before release that Apple doesn't use non-standard instructions in their ISA and doesn't need special compiler treatment? Who's right now?
- alexhutcheson 6y agoWhat instructions from an extended ISA are you referring to? The only ones I've seen written up have been: 1. Instructions to change the memory ordering mode, which allows Rosetta2 to skip some expensive memory fences when translating x86 binaries to ARM. 2. Some instructions for matrix math. I wouldn't expect either of these to affect typical usage or battery life much, unless your workflow involves running things that do a ton of matrix math.
- my123 6y agoAnd the former isn't even an instruction, set a single bit in ACTLR_EL1 and off you go. The second is an extension that talks to a coprocessor that's quite application specific. And that has an unstable ISA that changes every year. Probably not the biggest priority for anyone.
- mastrsushi 6y agoI understand someone always has to do this when something new comes out, but God what a waste.