[HN Gopher] Debian GNU/Linux running bare metal on the Apple M1 ...
___________________________________________________________________
Debian GNU/Linux running bare metal on the Apple M1 with a mainline
kernel
Author : nixcraft
Score : 301 points
Date : 2021-07-26 10:34 UTC (12 hours ago)
(HTM) web link (twitter.com)
(TXT) w3m dump (twitter.com)
| flemhans wrote:
| Is it fast?
| zibzab wrote:
| It's native Linux, wadaya think?
| imwillofficial wrote:
| I ran Linux on an old PowerBook back when it wasn't so old,
| it was slow as a dog.
|
| "Native Linux" half implemented, makes no statements on
| speed.
| daviddever23box wrote:
| Any expectations that Debian GNU/Linux would be faster on this
| device than Apple's own optimized OS should be tempered with a
| dose of reality; that said, there must be a headless
| arm64/M1-optimized Darwin variant in-house that it would be
| curious to benchmark against.
| zamadatix wrote:
| Not that software performance on M1 devices is much of a
| concern (poorly optimized apps tend to run amazingly well
| thanks to brute force speed) but if Chrome can benchmark better
| than Safari on it why couldn't other software?
| tenebrisalietum wrote:
| You're right, but sometimes speed is not the top priority. I
| have a 1Ghz single core ARM-based Guruplug with 512MB of RAM -
| slow, but I would run certain tasks on it because I can control
| and verify the code path from the bootloader all the way to
| userspace.
| devwastaken wrote:
| Free work for the richest company in the world so that their
| overpriced locked in unrepairable computers can run an open
| source OS and divert revenue from competitors that natively
| support linux.
|
| I don't believe I've seen work that advocates against itself
| harder than this. Competitors that actually care about linux
| support should be the ones worked towards, and the ones that
| should receive your money.
| e12e wrote:
| That kinda was how GNU got started in the first place, though -
| bringing an open user-land to propiatary platforms?
|
| If nothing else, the ability to run Linux on an m1 makes me
| feel more confident that the hw won't stop being useful when
| Apple ceases support, and moves on to m2 or whatever.
| freedomben wrote:
| I tend to agree with you, but I also think it's important to
| remember that people are doing this free work entirely on their
| own. They _want_ to do it for free. As much as I 'd like to see
| the effort go toward a hardware OEM that deserves it, the
| labor/work doesn't exist and merely needs allocation. It exists
| specifically because people want to do it for Apple's hardware.
| The choice is likely between nothing or Apple, not between
| <OEM> or Apple. From a purely Linux perspective, this work
| helps make Linux even more of a force, so there's definitely
| reason to appreciate it :-)
| babypuncher wrote:
| You must be fun at parties
| pabl0rg wrote:
| Which one of those has the best hardware?
| freedomben wrote:
| The Dell hardware has gotten amazing and for most users Linux
| will run great on it. Look for models that ship OEM with
| Ubuntu.
|
| Lenovo ThinkPads are also fantastic, and very repairable.
| They're certainly not eye candy but Linux is a first class
| citizen.
|
| I'm stoked about the frame.work laptop also. Haven't gotten
| one yet, but I will.
| alien_ wrote:
| The reality is that the M1 beats pretty much all Intel-
| based laptops when it comes to getting the sweet spot on
| performance, battery life and silent operation.
|
| Yes it's costly, restrictive, the hardware still has some
| flaws and you can't replace parts but most Apple users,
| myself included, are happily paying the price.
|
| I have an M1 Macbook Pro for a few months now and it's
| blazingly fast, the battery lasts for 15-20 hours and I've
| only heard the fan for a few minutes so far while stressing
| it with heavy compilation. Under normal circumstances it's
| entirely silent. I wouldn't trade it for anything else at
| this point.
| Karsteski wrote:
| An aside, this lady's accomplishments at her age make her someone
| I look up to, ngl
| megous wrote:
| Young hackers show us that becoming a hacker doesn't require
| _that_ much time. A few years, perhaps. :)
| oblio wrote:
| My bet is that they started hacking (with help/guidance, most
| likely) since when they were able to read, which could have
| been as early as 3-4. So at this point they probably have 10+
| years of experience and probably thousands of hours of
| practice.
|
| Still amazing.
|
| But coding is easy to get started with. Now, a 14 year old
| world renowned notary, that I will probably not see within my
| lifetime :-))
| rtz121 wrote:
| > this lady's
|
| Immediately knew where this was going.
| i_am_new_here wrote:
| "(A) Women accomplishes something, ... yada... yada... yada
| (nobody actually/really cares). As opposed to men: They
| accomplish things to attract/impress _attractive_ females. If
| females do it it feels so misplaced / out of place. She
| should be investing in her beauty (but doesn't). She is
| Jewish btw... Such a smart girl, bravo! Beating anti-semitism
| one smart girl at a time.
| tome wrote:
| Even further aside, how are you deducing her age? Her
| photograph? I didn't see anything prominent about her age
| anywhere.
| Karsteski wrote:
| I tend to check out the personal websites of people with cool
| accomplishments
| tome wrote:
| I don't even see an age there ... are you inferring it from
| her student status? Anyway, not that it's a big deal, I was
| just curious!
| oxygenoxy wrote:
| Her resume is up on her personal website.
| mariodiana wrote:
| Her resume states she was a National Merit finalist in
| 2019, a scholarship competition for high school students.
|
| #EMDW
|
| https://www.nationalmerit.org/s/1758/interior.aspx?sid=17
| 58&...
| pantalaimon wrote:
| https://rosenzweig.io/blog/americas-rough-draft.html
| [deleted]
| kleiba wrote:
| Actually, that's not too surprising, given that a lot of
| technically minded folks start digging into their craft in
| their early teens. I think that it's only natural to get most
| of your accomplishments in at a relatively younger age, when
| your independence is at its peak. Like, say, once you become a
| husband and father, there's no time for anything any more.
| grumpyprole wrote:
| Can confirm, as a father of two kids, I get no time or energy
| for projects. I used to get two 30 minute train journeys pre-
| covid. I'm not at all unhappy with this situation, but do
| still occasionally wish I had done more when I was younger.
| jjuel wrote:
| Can confirm that with 3 kids under 3 I have ZERO time to do
| anything I would like to programing wise outside of work.
| vaxman wrote:
| You're holding it wrong.
|
| Seek tech partnerships with others lacking such time
| constraints and optimize shared responsibilities with
| existing partners. YOLO Time waits for no man.
| jvanderbot wrote:
| Tech is skewed so strongly towards the young, that I thought
| your comment implied the author was _old_ , not young.
|
| A teen hacking together something awesome is commonplace. A 65
| year old doing it is less so?
| [deleted]
| [deleted]
| throwaway17183 wrote:
| Pretty sure it's a he...
| daptaq wrote:
| How do people react to information like this? Personally, it
| just makes me feel bad for myself, especially when I don't know
| the person in question. Most people usually react positively,
| but I am not sure if this is some kind of a "If you don't have
| anything good to say, don't say anything"-mentality, or if I am
| the bad one.
| Karsteski wrote:
| What do you mean? What I said is a compliment
| daptaq wrote:
| I was generally speaking about praising someone's
| accomplishments because/despite of their age.
| Karsteski wrote:
| Idk, maybe it depends on the person. I would take it
| positively, as its an accomplishment regardless of their
| age, but even more so given how young the person is.
| edgyquant wrote:
| I think that's the point. It's easy to feel useless when
| people younger than you have better accomplishments.
| Karsteski wrote:
| Well I certainly don't feel useless lol... People's lives
| have different paths, but regardless I admire when
| someone does something cool wrt tech
| megous wrote:
| I get some praise for my FOSS work. Nobody mentions my
| gender or age ever, though. :) It would feel kinda weird
| I guess.
|
| I mostly don't care about the praise, because it's not
| the motivating factor. I usually interpret it non-
| presonally as the other person being excited about
| similar things I am. (probably a projection, but
| whatever)
|
| Also in > 80% of cases the communication goes 1) praise
| 2) I need this. :) So, being praised is associated with
| someone wanting something from me, by now.
|
| The best praise is the one that comes with a donation. :)
| clipradiowallet wrote:
| It makes me happy just seeing non-corporate kernel work.
| Signals [continuing] long term health of linux IMHO.
| CyberRabbi wrote:
| Why would you feel bad? There is nothing stopping you from
| working harder. There are still lots of hardware without open
| source drivers that needs reverse engineering.
| darkandbrooding wrote:
| You and (other person) started your lives on different dates,
| in different places, in unique circumstances; you are
| statistically unlikely to end those lives at the same time
| and place. If the two of you appear to be following the same
| path for a portion of those lives just enjoy the company
| while it lasts. There is no single, universal measure of
| success, so the fact that one person's achievements exceed
| your own in one area is cause to celebrate that other person
| but not a reason to feel bad about yourself. Be better than
| you were yesterday, be kind to those around you. Your story
| (hopefully) has _decades_ left to tell. It probably includes
| major characters that you haven 't even met yet.
| cbhl wrote:
| Feeling bad is not that unusual of a feeling here; achieving
| great things when you're young requires a combination of hard
| work, privilege, and supportive adults (parents/teachers/etc)
| and most people just didn't (or don't) have the same
| opportunities.
|
| It's important to develop constructive (or at least non-
| destructive) habits to handle these feelings. I'd suggest "A
| Guide to the Good Life" by William Braxton Irvine as a
| resource. The right therapist can also help you "unpack"
| these feelings (although the different styles can be hit-or-
| miss for you, so shop around when you're on a "good" day).
|
| I think that it's okay to set a personal goal for yourself
| that's different; the most you can ask of yourself is to try
| to contribute to society as best you can, whether that's "I'm
| working on the farm making food" or "I work at a big tech
| company and donate $5 to the campaign" or "I mentor startup
| founders".
| isaacimagine wrote:
| I agree with your larger point, but I disagree with this
| bit:
|
| > achieving great things when you're young requires a
| combination of hard work, privilege, and supportive adults
| (parents/teachers/etc) and most people just didn't (or
| don't) have the same opportunities.
|
| I think that it's easy to externalize emotions about
| success in young people by projecting the help of an adult
| as the driving factor for that young person's success.
| Although this may be true in some cases, there are a large
| number of young motivated people who are just self-
| starters, with or without the resources of a backing adult.
|
| I say this because, more than privilege or adult support, I
| think success at a young age boils down to hard work (as
| you've mentioned), having passion, and being prepared for
| luck, i.e. taking advantage of opportunities.
|
| I think parents and teachers play a large role in the
| development of a person: this is obvious. What I'm not a
| fan of is when people lessen the success of a young person
| by shifting the accomplishment to be a simple cause of the
| environment in which they were raised, rather than the
| efforts and attitudes of the person who put the work in to
| accomplish what they did. Support [?] doing it for them.
|
| To summarize: I agree with your larger point (to not beat
| yourself up when seeing a great accomplishment at a young
| age) but disagree that success at a young age hinges on
| privilege and parents over luck and perseverance.
| vaxman wrote:
| That is totally wrong. Young slackers without economic
| standing, waring parents that have no clue who has actual
| custody and guidance from only small minded individuals
| hiding from reality as "teachers" can, and frequently do,
| achieve great things. Those further Deep Thoughts about
| 'unpacking feelings' make me want to projectile vomit.
| fsf-non-intern wrote:
| She (rightly) got the internship at the FSF the year I applied
| [1], so now I feel envious every time I read about something
| amazing she did.
|
| [1] https://www.fsf.org/blogs/sysadmin/introducing-alyssa-
| rosenz...
| cstross wrote:
| Get back to me when you've got it running on a dead badger:
|
| https://www.abyssapexzine.com/2021/04/dead-badger/
|
| /humor, in case you were wondering.
|
| (More seriously: this is great stuff, but it's on a desktop Mac
| Mini; I suspect getting it running on an iPad Pro might be just
| slightly harder ...)
| svenpeter wrote:
| On the computers (i.e. mac mini, macbook, iMac) Apple ships an
| unlocked bootloader and we can just install our own bare metal
| code very early on using their official tools.
|
| On the iPad Pro that bootloader is locked down and running
| Linux on there is unfortunately very unlikely to ever be
| possible.
| sudosysgen wrote:
| It would be possible, though very difficult, to turn the OS
| into a staging bootloader, and load another OS bare-metal
| from there. Still insanely difficult though.
| svenpeter wrote:
| Usually, once you can run code in kernel mode it's just a
| matter of bringing the hardware back to a sane state.
|
| Unfortunately, "just" running code in kernel mode is
| incredibly hard on the iPad. There's e.g. a hardware
| mitigation that turns a memory region to read-only and also
| only allows kernel code to run from this region. This
| mitigation is locked down and cannot be disabled once XNU
| is running on the iPad (http://siguza.github.io/KTRR/).
|
| On top of that page tables are also protected by a "kernel
| within the kernel"
| (https://blog.svenpeter.dev/posts/m1_sprr_gxf)
|
| Getting past all that is going to be very hard if not
| impossible.
| azalemeth wrote:
| I thought the first-generation iPad pro was
| checkra1n-compatible? Isn't checkm8 a bootloader exploit?
| somebody_amzn wrote:
| Yes the first gen iPad Pro can, and the second generation
| one too. The target user base for Linux on those might be
| too small though.
| londons_explore wrote:
| But all that's needed is a bootloader exploit...
| svenpeter wrote:
| which is not impossible but very unlikely.
| Wowfunhappy wrote:
| Chkm8 was the first of its kind since the early days of
| iOS. It's not impossible but we'd have to get very lucky.
| andrewmcwatters wrote:
| It's fun to do an' all, but the lack of drivers really made the
| experience half-baked for me when I realized I couldn't use any
| of the badger's limbs.
| Subsentient wrote:
| This is excellent to see. The only possible good use of a Mac, is
| to run Linux on it. This has been true since the PowerPC days,
| and it's still true today. Though, today, you're probably better
| off just buying a normal PC and loading your favorite distro on
| it.
| Karsteski wrote:
| I don't think this is fair to MacOS. Millions of people are
| very happy with how it works in its highly integrated but
| restricted fashion. While it's not the choice for you and I, I
| think credit where credit is due is important here.
| kragen wrote:
| It's legitimate to protest against injustices and menaces to
| human rights even when millions of people accept those
| injustices and don't recognize those menaces. You're
| reframing the issue as a personal choice, but to a large
| extent it is not.
| robflynn wrote:
| Sure, that is a legitimate protest, but the statement that
| was made was "there is no possible good use for a mac" and
| that is simply not true. You're reframing the issue to be
| about morality when that wasn't in question in the original
| comment.
| kragen wrote:
| No, the statement that was made was, "The only possible
| good use of a Mac, is to run Linux on it." Plausibly the
| poster might have had reasons other than moral
| considerations for making such a statement--maybe they
| really prefer Xlib to Quartz, System-V-style system calls
| to BSD, or Nautilus to Finder--but I doubt it. Apple's
| unethical and abusive treatment of their users seems more
| the more likely rationale for such a statement, since
| running Linux has historically been the escape route from
| such practices.
|
| It's legitimate to protest against injustices and menaces
| to human rights even when millions of people accept those
| injustices and don't recognize those menaces.
| Karsteski wrote:
| Well now you've gone in a completely different direction
| with it...
|
| How many companies whose products we all use on a daily
| basis are directly or indirectly involved in abhorrent
| practices? Probably a lot, to be honest.
|
| I'm not disagreeing with you, btw. I'm just saying the
| depth of what you're saying is a bit much for most people,
| since it feels inescapable.
| kragen wrote:
| The problem isn't that Apple is "directly or indirectly
| involved in abhorrent practices." The problem is that the
| abhorrent practices in question are specifically the
| licensing and technical design decisions of MacOS, and
| how they affect the owners of Apple M1 computers,
| especially those who run MacOS on them.
|
| I'm not talking about arm's-length issues like the extent
| of Apple's responsibility for Foxconn-factory worker
| welfare and to what extent Foxconn's workers are better
| or worse off than they would have been without Apple--
| whatever the truth of the accusations, they are
| unaffected by whether your Macintosh runs Linux or MacOS.
|
| I'm talking about proprietary software licensing turning
| your own computer into a weapon against you, and
| reserving the understanding and control of the world you
| live in (the birthright of every human being) for Apple's
| anointed priesthood of licensed developers, who retain
| their status purely at Apple's pleasure. This is the
| central issue solved by installing a free-software
| operating system like Linux.
| Subsentient wrote:
| Other than being proprietary, macOS is definitely much better
| than Windows. The problem is that macOS requires Apple
| hardware, which has been dog shit for years now.
| imwillofficial wrote:
| Apple has the highest user satisfaction with hardware of
| any mainstream manufacturer.
|
| I'm curious who you think does better than they do.
| AnthonyMouse wrote:
| > Apple has the highest user satisfaction with hardware
| of any mainstream manufacturer.
|
| This is from people who chose to buy Apple hardware. If
| you buy a Macbook with AppleCare and then sell it again
| by the time it expires, it doesn't bother you that it
| can't be repaired because you never own it out of
| warranty. That only works if you can afford a new Macbook
| every three years, but that's what Apple customers do. So
| then you get "hardware satisfaction ratings" that don't
| reflect the quality of the hardware.
|
| For example, for decades Apple has been sacrificing
| reliability for silence. In most PCs, if the temperature
| starts getting up there, it will spin up the fans. Apple
| characteristically doesn't do this until the temperature
| is at the limit of what the hardware is rated for. So the
| machine stays quiet, but operating at the upper limit on
| temperature for years negatively affects reliability.
| Pull the hard drive from a ten year old iMac and dump the
| SMART data from it. Chances are it says the drive has
| exceeded the drive manufacturer's temperature limits and
| correspondingly has non-zero reallocated sectors, if it
| hasn't already failed and been replaced.
|
| Also, you ask people how satisfied they are with their
| "hardware" and the fact that it runs a Unix instead of
| Windows is going to bleed into the answers.
|
| > I'm curious who you think does better than they do.
|
| So this is the other factor in this. If you go to Dell or
| Lenovo, they have low end models, and the low end models
| are lower quality, and they're also more popular (because
| they're cheaper). Apple doesn't have low end models. If
| you then do a survey by manufacturer, you're comparing
| high end hardware to low end hardware. It's the same
| reason Alienware does better than Dell even though
| they're the same company.
| busterarm wrote:
| These are not alike things.
|
| Apple presents themselves as a luxury brand. Self-
| satisfaction from your purchase is part of the
| experience. If you own a Ferrari you own a fucking
| Ferrari!
|
| Other computer hardware manufacturers are selling you
| business or entertainment machines.
| dannyw wrote:
| Other than the keyboard, Apple's screens and trackpad are
| amazing. Also, when in warranty, their support is genuinely
| great.
| bartvk wrote:
| If you want to see Marcan's latest stream (just an hour ago):
| https://www.youtube.com/watch?v=3hPtyaUFfY8
|
| And if you want to sponsor him:
| https://www.patreon.com/marcan/posts
| TimTheTinker wrote:
| You can also sponsor him on GitHub:
| https://github.com/sponsors/marcan
|
| (Correct me if I'm wrong, but I think more of the money makes
| it to him through a GitHub sponsorship.)
| jagger27 wrote:
| It appears that GitHub Sponsors is still considered in beta
| (whatever that means) and is waiving the 10% fee.
| GekkePrutser wrote:
| Interesting.. Now FreeBSD :)
| [deleted]
| a2tech wrote:
| Thats great. The Mini leaning on the screen like that is only
| mildly triggering me.
| rvz wrote:
| What is so substantiative about this comment?
|
| To Downvoters: Perhaps you can point out to everyone what part
| of the parent comment has substance in this discussion?
|
| Imagine being downvoted for asking a good question.
| dmd wrote:
| When I started[0] at my current job there was a production
| service running on a mac mini that was dangling by its ethernet
| cable _from the ceiling_
|
| [0] https://imgur.com/gallery/wHH3sow
| a2tech wrote:
| I'd like to say I've never worked at/done those kind of
| things...I'd like to say it.
| luke2m wrote:
| How is GPU support going?
| paulmd wrote:
| Surprisingly well, I think. I haven't heard any updates in a
| couple months (and I don't see it on her blog) but it sounded
| like Alyssa Rosenzweig had hammered out an early compiler and
| started working on a graphics driver itself.
|
| https://rosenzweig.io/blog/asahi-gpu-part-4.html
|
| At the launch there were various pronouncements that "it'll
| never happen, Apple will have locked it down so hard it'll
| never go anywhere" and the more optimistic "there should be a
| start in a couple years" and at this point I wouldn't be
| surprised if there was something alpha or pre-alpha grade that
| you can toy around with by the end of the year (my words not
| hers - I have no relation to any of the Asahi Linux efforts).
| Asmod4n wrote:
| ,,Current dEQP-GLES2 status: 93.8% passing."
| https://twitter.com/alyssarzg/status/1419064274350080003?s=2...
| marcan_42 wrote:
| This is on macOS, using the macOS kernel driver with the mesa
| open source userspace (i.e. not Metal) that Alyssa is working
| on.
|
| It means that right now there is no GPU support on Linux, but
| once the kernel driver (which is simpler than the userspace
| part) is written, things will go from nothing to likely able
| to run a full accelerated desktop in days, since the bulk of
| the userspace work will already be done.
|
| I'm working on the display controller driver first (since it
| is arguably more complex in interface, but shares concepts,
| and is also a dependency for "real" GPU acceleration since
| you need things like vsync/page flipping to do it properly),
| and once that's able to at least do basic screen bring-up,
| I'll tackle the GPU side.
| simcop2387 wrote:
| Not entirely sure myself, but with this I'm sure it'll be
| easier to reverse engineer and work on. I'm curious how the
| other periphrial support is still. Looks like some patches
| needed for at least usb, I winder what else.
| svenpeter wrote:
| That missing patch is the iommu driver which is currently
| under review and will hopefully make its way to mainline
| soon.
|
| Once that one is merged there's already another series to
| enable PCIe (which needs the iommu driver) which gives us
| more USB ports, ethernet and with another small patch WiFi.
| There's also a WIP series for NVMe.
|
| What's missing are then a few smaller things (i2c, spi,
| keyboard on the macbooks etc.).
|
| And then there are a few bigger tasks left, e.g. thunderbolt
| support, usb super speed support, support for the secure
| enclave, and ofc the largest one being the display controller
| and the GPU.
|
| And once that's all done there's the long tail of making this
| all work nicely (e.g. power management, making the
| installation as easy as possible, etc.)
| londons_explore wrote:
| And sadly that long tail of work will be completed just as
| the platform is becoming obsolete...
| marcan_42 wrote:
| Apple doesn't throw away their SoC design and start from
| scratch. Future iterations will share much of the same
| code. For example, the interrupt controller and the UART
| hardware haven't really changed since the first iPhones.
| freedomben wrote:
| From what I've been told, full support as it's becoming
| obsolete is mostly the point. Running Linux on a highly
| closed and manufacturer hostile system will never be a
| good experience. Anyone who wants a Linux machine will
| buy a frame.work, system76, Lenovo or Dell, etc, not an
| apple. The point of linux support here is to give the
| device a longer life once apple drops support. In other
| words, when the hardware is no longer a sufficient apple
| machine and is more of a toy, at least it will be
| _possible_ to put something else on it.
| marcan_42 wrote:
| You've been told wrong; our goal is absolutely to catch
| up to Apple's hardware cadence and make Linux on Apple
| Silicon something people want to run as an alternative to
| macOS, well within the platform's support lifetime.
| freedomben wrote:
| Interesting, thank you. How realistic do you think that
| goal is? (Honest question, nothing implied)
___________________________________________________________________
(page generated 2021-07-26 23:02 UTC)