[HN Gopher] NetBSD Booting on the Apple M1
       ___________________________________________________________________
        
       NetBSD Booting on the Apple M1
        
       Author : jmmv
       Score  : 143 points
       Date   : 2021-08-28 15:22 UTC (7 hours ago)
        
 (HTM) web link (twitter.com)
 (TXT) w3m dump (twitter.com)
        
       | morpheos137 wrote:
       | Netbsd was interesting around 2000 when there were a bunch of
       | living computer architectures. Now when there is just basically
       | ARM, AMD64 and maybe IBM Power it makes less. As an avid Unix
       | afficionado I have yet to install NetBSD. OpenBSD does whatever I
       | need it to do. Maybe the ability of NetBSD to support commericial
       | linux software makes it still relevant but I suspect that is
       | rapidly going away with SystemD dependence. Does anybody know if
       | you can run a SystemD layer on Netbsd?
       | 
       | Otherwise the ability to support Alpha and Vax and M68k while
       | interesting once is for all intents and purposes irrelevant
       | today, at least for me.
       | 
       | >NetBSD/next68k System Requirements and Supported Devices
       | 
       | NetBSD/next68k 9.2 will run on the 25 MHz 68040-based NeXT
       | workstations. The Turbo (33 MHz) models are not supported. The
       | 68030 model is not supported. NetBSD/next68k 9.2 does not have
       | any local disk support, so you must netboot and run diskless.
       | 
       | >The minimum configuration requires 4 MB of RAM and a network
       | server capable of netbooting NetBSD/next68k. Serial consoles are
       | poorly supported by the hardware, see the FAQ for help...
       | 
       | In 2021 people spent developer hours testing NetBSD 9.2 on the
       | NeXT cube...like what the www started on before the USSR fell.
       | Anyway I guess everybody needs their hobbies...
        
         | sitzkrieg wrote:
         | netbsd is pure pain compared to openbsd, dont bother
        
           | crasla wrote:
           | What do you mean by pure pain? Netbsd and both openbsd are
           | great operating systems. Neither one of them is bad,they just
           | work differently and have other goals. Openbsd is more
           | security minded and netbsd works on more
           | computers/architectures
        
         | mlyle wrote:
         | > In 2021 people spent developer hours testing NetBSD 9.2 on
         | the NeXT cube...like what the www started on before the USSR
         | fell. Anyway I guess everybody needs their hobbies...
         | 
         | Do you see no utility in this? I think we should keep old
         | machines alive-- both their original operating system /
         | environment and also something like NetBSD which is quasi-
         | supported and quasi-modern have their roles.
         | 
         | Preserving the history of it all is important.
        
           | morpheos137 wrote:
           | For society as a whole I see negative utility in time wasted.
           | Not all history is important to keep alive. You don't see
           | people firing up coal fire steam engines in their back yard.
           | 
           | For the individual there may be some utility in such a hobby
           | though.
           | 
           | In life since we have a limited amount of time, we got to
           | pick our priorities. Maybe maintaining a modern operating
           | system on 30 year old esoteric hardware is rewarding to you.
           | It wouldn't be for me. Neither of us have to justify our
           | positions, however if I was looking at a resume and one kid
           | put "Helped maintain netbsd/NeXT 2018-2021" and another put
           | "Set up and maintained PostgreSQL based system for small
           | business CRM," I would probably take the latter more
           | seriously.
        
             | jraph wrote:
             | Why?
             | 
             | Most people have "non-contructive" hobbies and that's fine.
             | Everybody is out there for taking pleasure in life. What do
             | you do during your leisure time? I do hike among other
             | things. That probably does not help society too much.
             | 
             | If you need to fulfill a OS-related position you should
             | definitively the former, all other things being equal,
             | because they will probably be more qualified. If you need a
             | DBA, sure, take the latter.
        
               | morpheos137 wrote:
               | >what I do in my leisure time.
               | 
               | Sometimes I participate in HN.
               | 
               | My understanding is that systems programming is not in
               | demmand these days. Microsoft and Apple products are
               | mature. There is not a proliferation of different
               | hardware architectures to port to anymore. Almost nobody
               | gets paid for systems programing in unix or linux unless
               | you want to become an AIX programmer or maybe work in
               | academia. Again, OS programming was the big thing in the
               | late 1990s early 2000s.
               | 
               | Now it is important that your OS just works and gets out
               | of the way and lets you get real work done. Anyway I am
               | done with this thread because I don't want to be accused
               | of flaming.
        
               | banned23211 wrote:
               | New developers are born every day and these old systems
               | provide all kinds of opportunities for learning. It's an
               | historical preservation effort and an interesting
               | intellectual challenge. Some programmers have very high
               | IQ which makes them very curious. Low IQ programmers just
               | don't get it, and never will.
        
               | the_only_law wrote:
               | While I agree that systems programming has nowhere near
               | the demands of business application developer these days,
               | "almost nobody" seems like a hyperbole. There are a
               | number of jobs out there for Unix/Linux systems
               | programmers. Driver development at hardware companies,
               | all sorts of security software, etc.
        
               | jraph wrote:
               | Just a comment to say that I had no intent to piss you
               | off, and I don't think you are flaming, just exposing
               | your perspective. Maybe I should not have included my
               | question on your hobbies. It was more for the readers,
               | including you, to answer in their head.
        
               | [deleted]
        
             | zozbot234 wrote:
             | There are solid engineering reasons to keep support for
             | these systems alive. They're comparatively simple and very
             | well understood, so a well-maintained support for these
             | "toy" systems can be used as a trusted reference even when
             | working on more complex platforms.
        
             | mlyle wrote:
             | > Not all history is important to keep alive. You don't see
             | people firing up coal fire steam engines in their back
             | yard.
             | 
             | Actually, people do! I'm pretty grateful that people keep
             | old steam engines going. The context of where we've been
             | and how we've gotten here is important.
        
               | kelnos wrote:
               | Also if there's some sort of global semi-apocalypse, we
               | will likely need to fall back to some older technologies
               | in order to keep some semblance of civilization going,
               | where the alternative might be dropping back to a
               | completely pre-industrial state.
        
             | phist_mcgee wrote:
             | Reminds me of the old quote: "The ability to play chess is
             | the sign of a gentleman. The ability to play chess well is
             | the sign of a wasted life."
        
         | the_only_law wrote:
         | > Otherwise the ability to support Alpha and Vax and M68k while
         | interesting once is for all intents and purposes irrelevant
         | today, at least for me.
         | 
         | Great! You don't have to use it.
        
       | AceJohnny2 wrote:
       | I continue to be skeptical of all the "boots on Apple M1"
       | efforts. Ultimately, I don't expect them to get much further than
       | the "proof-of-concept" phase, as far as usability goes.
       | 
       | Apple's chips are SoCs, and as such are extremely complicated
       | systems. There are tons of parameters to make it work efficiently
       | that either need to be carefully reverse-engineered, or out-of-
       | reach entirely. Apple not only won't be any help, but will be
       | actively hindering these efforts.
       | 
       | For example, is anyone dealing with the performance modes of the
       | chip, tuning them for performance-vs-dissipation? What about the
       | DRAM interface?
       | 
       | Alyssa Rosenzweigs effort on reverse-engineering the GPU is
       | impressive and laudable, but it's just one component of the
       | dozens or so IP blocks in the chip, each of which require that
       | level of work.
       | 
       | Being able to boot your OS on the CPU is like landing on the
       | beaches of Brittania and calling it conquered. (I couldn't come
       | up with a better analogy)
       | 
       | I understand the appeal of the technical challenge, and that's
       | awesome! But people should lower their expectations if they ever
       | expect to run an open OS with the full power (or even significant
       | fraction) of the hardware.
        
         | liveoneggs wrote:
         | you sound fun. I'd love to see your operating system efforts.
        
         | 1vuio0pswjnm7 wrote:
         | "... if they expect to run an open OS with the full power (or
         | even a significant fraction) of the hardware."
         | 
         | When using open OS I never expect that.1 To me its a tradeoff
         | worth making.
         | 
         | 1 In some cases I dont want/need all the hardware features.
         | 
         | Is there a name for the common practice where a vendor produces
         | a low-priced and a high-priced version of a product that
         | actually contain the exact same chip, only the lower-priced
         | version has some features disabled. Vendors seem not to fear
         | that buyers will reject the lower-priced version because it
         | does not access all the chip's capabilities
        
         | rjsw wrote:
         | The Apple M1 is useful as a fast build machine even if the GPU
         | is never usable by non-Apple operating systems.
        
           | AceJohnny2 wrote:
           | Is it really the best option, performance-per-$?
        
           | amelius wrote:
           | Yeah, but one day Apple might pull the plug on non-Apple
           | OSes. By then, all of you people who supported Apple will
           | have to find another solution, which may not be as appealing
           | since the competition is now far behind because of all your
           | support of Apple hardware. Therefore it's better to switch
           | earlier than sooner even if it means a small step back in
           | performance.
        
             | rowanG077 wrote:
             | You don't actually have to find another solution. The state
             | it's in will continue working. The only thing apple can do
             | is release a new piece of hardware that is locked down. But
             | that could always happen regardless of vendor. Besides I
             | don't think that's a serious risk with macs.
        
               | amelius wrote:
               | > The state it's in will continue working.
               | 
               | Maybe so. But then again, maybe not if Apple decides to
               | blow a bunch of fuses remotely. Also, your laptop could
               | break. Or you might want to expand to more laptops but
               | the one you are using now runs out of production.
        
               | rowanG077 wrote:
               | > Apple decides to blow a bunch of fuses remotely
               | 
               | Then just... not update.
        
               | amelius wrote:
               | You seem to be under the impression that an OS has full
               | control over the system when it is running. This is not
               | necessarily true, see Intel ME.
        
               | rowanG077 wrote:
               | That is a class action law suit waiting to happen. I'm
               | not saying it's not technically possible. I think Apple
               | is smart enough to not do that.
        
         | rowanG077 wrote:
         | You truly expect every IP in the SoC to require GPU level
         | complexity? That's a far out assumption imo. The speed of
         | progress made on getting Linux to run is extremely high and
         | once the GPU runs they will focus on power management. I think
         | you are over way over estimating the impossibility of this
         | task.
        
           | amelius wrote:
           | You missed the point. Apple may decide to make it more
           | difficult to reverse-engineer their hardware. For now, we
           | (the Linux/BSD community) are allowed to use their hardware,
           | but this may not always be the case, e.g. when M1's successor
           | hits the market.
        
             | rowanG077 wrote:
             | So we are now speculating about future hardware? Apple macs
             | were never locked down. Why would they now suddenly start
             | being locked down?
             | 
             | If Apple wanted to lock them down there would not have been
             | a better moment then with the M1. They already have all the
             | tech ready to go. But they obviously decided not do to
             | that. Assuming a product line that has been not locked down
             | for decades to suddenly start being locked down AFTER the
             | best moment to do it is the wrong assumption.
        
               | webmobdev wrote:
               | > _If Apple wanted to lock them down there would not have
               | been a better moment then with the M1. ... But they
               | obviously decided not do to that._
               | 
               | That's a laugh - what other OS can you run on the M1
               | today apart from macOS? It is as good as locked down
               | already!
               | 
               | Apple understands very well that this is a very lacking
               | feature of the M1, and that is why Apple is very cleverly
               | using those reverse engineering effort as part of its
               | online marketing to mislead some into beliveing that
               | Linux or xBSD OSes will be available on the M1 in the
               | very near future. The sad reality is that even if the
               | reverse engineering is successful all you are going to
               | get are buggy versions of other OSes, with features
               | missing, which will make you regret purchasing the M1 if
               | you hoped to run other OSes on it.
        
               | rowanG077 wrote:
               | You can run linux TODAY, you can run netBSD TODAY. it's
               | not fully featured yet but you can run it. Locked down
               | has a clear meaning and macs aren't locked down. Ipads
               | are locked down, Iphones are locked down. It's impossible
               | to boot a different OS on those.
               | 
               | Linux has ran for years fine on macs. I don't see any
               | reason why it won't run fine on the M1 macs.
        
               | amelius wrote:
               | https://news.ycombinator.com/item?id=23640746
               | 
               | I will believe Apple _if_ they say they officially
               | support booting of other OSes, and will keep doing so in
               | the future.
        
               | rowanG077 wrote:
               | You mean like they supported bootcamp "officially" and
               | then just took it away suddenly with M1? I don't see how
               | that is different then having unofficial support and
               | apple then locking down a new Mac. In either case you
               | lost support with a new hardware platform.
        
               | zozbot234 wrote:
               | Boot Camp was always Intel-specific. There was no Boot
               | Camp on Power Macs, and they couldn't run Windows either.
               | MS has not made available a version of Windows on ARM for
               | the M1 platform, either.
        
               | rowanG077 wrote:
               | There is no "Windows for mac" for Intel either. Apple
               | just added some drivers. That could be done for the M1 as
               | well.
        
               | wpm wrote:
               | No it couldn't. Microsoft doesn't sell Windows for ARM.
        
               | mlyle wrote:
               | > In either case you lost support with a new hardware
               | platform.
               | 
               | If we're talking about "new hardware platforms" --- yes,
               | any vendor or vendor ecosystem may drop support for
               | anything at any time in future products. If ARM Ltd's
               | next core is a mechanical abacus, it will not run Linux.
        
               | rowanG077 wrote:
               | Right! So whether there's unofficial or official support.
               | It doesn't buy you anything.
        
         | CharlesW wrote:
         | > _Apple not only won 't be any help, but will be actively
         | hindering these efforts._
         | 
         | They won't hinder anything, because they make money from the
         | hardware.
        
           | breakfastduck wrote:
           | Seriously. Apple have absolutely fractional actual reasons to
           | limit non macOS boots on M1 devices. The fact they've made
           | the transition & taken macOS to a whole version beyond X and
           | kept supporting non apple OS boots on the devices proves (to
           | me at least) that they're not going to remove it. If there
           | ever was a time to lock that down, it was on the architecture
           | shift.
        
             | amelius wrote:
             | > and kept supporting non apple OS boots
             | 
             | They don't officially (!) support it.
        
               | jolux wrote:
               | Of course they don't, or people wouldn't have to be
               | reverse engineering things.
               | 
               | But it doesn't affect your hardware warranty.
        
             | bkallus wrote:
             | Suppose there's a macOS exploit found that makes use of the
             | unlocked bootloader. Are you certain Apple would actually
             | patch it, and not just lock the bootloader? Sony famously
             | did that to the PS3.
        
               | saagarjha wrote:
               | You can "exploit" macOS by disabling SIP, which requires
               | about as much effort.
        
           | webmobdev wrote:
           | They do make a profit on the hardware when they sell it to
           | you. But that's a one time profit. _The new buzzword of
           | capitalism is "recurring income"_. And that is where Apple's
           | software ecosystem comes into the picture. Apple today makes
           | billions of dollars from its App stores, paid iCloud
           | services, search bundling etc. These are profitable income
           | they continue to earn for the whole life-cycle of the device.
           | 
           | And this is why Apple wants a stranglehold on both its
           | hardware and software. And precisely why it will _sabotage_
           | any other viable OS that emerges on its platform (which it
           | can now do much more easily with its ARM SoCs).
           | 
           | For apple fans who crib about how Linux / xBSD OS sucks
           | because of all the configurations / "extra steps" they
           | require to do something, I'll wager that running a Hackintosh
           | on an Intel / AMD processor will be a less buggy experience
           | than running Linux / xBSD on the Mac M1 as a Desktop OS.
           | (Simply because AMD and Intel are actually happy to see macOS
           | running on their CPUs, unlike Apple that sees other OSes on
           | its ARM cpus as a threat.)
        
       | 2bitencryption wrote:
       | I understand that part of the "magic" behind the M1 is how it has
       | some cores that are "performance" cores and other cores that are
       | highly efficient "low power" cores.
       | 
       | My question is, how much of the sublime performance of M1 Macs
       | comes from MacOS being fine-tuned to take advantage of these two
       | different type of cores?
       | 
       | If you simply get the bare minimum of NetBSD booting on an M1,
       | will it not achieve nearly the same performance unless the OS is
       | fine-tuned to schedule properly across the "performance" cores
       | and the "efficient low power" cores?
       | 
       | I remember reading a recent article [0] about how future Intel
       | chips plan to have similar "perf" and "low power" cores, and part
       | of the presentation included someone from Microsoft saying they
       | spent lots of time on the Windows team making sure Windows could
       | schedule across these properly. So I wonder how much work it
       | really takes.
       | 
       | [0] https://www.pcworld.com/article/3629502/intels-alder-lake-
       | wh...
        
         | heavyset_go wrote:
         | ARM big.LITTLE[1] SoCs have been a thing for about a decade
         | now, and most operating systems have schedulers that take
         | advantage of each set of cores. macOS isn't doing anything
         | special that Linux et al. aren't doing.
         | 
         | [1] https://en.wikipedia.org/wiki/ARM_big.LITTLE
        
           | kbenson wrote:
           | > macOS isn't doing anything special that Linux et al. aren't
           | doing.
           | 
           | MacOS isn't doing anything Linux and others _aren 't_ doing,
           | or MacOS isn't doing anything those others _can 't_ do?
           | 
           | That is, do we actually know how well tuned MacOS is for
           | these cores and their capabilities, or is that an assumption?
           | I thought I had read there were some specific instructions in
           | the chip that were either new to it or were more aggressively
           | used by MacOS to get additional energy savings or performance
           | gains.
        
             | hedgehog wrote:
             | I don't know of anything really magical but for years Apple
             | has been steadily pushing apps towards APIs that give the
             | OS a lot of latitude to manage energy [1]. Grand Central
             | Dispatch, AVFoundation, etc. Then on iOS BackgroundTasks
             | etc (and iPhones have had little cores for quite a while
             | now). I would imagine a lot of that experience transfers to
             | macOS.
             | 
             | The centralized + draconian approach they take has a lot of
             | problems but does help sweeping changes like this.
             | 
             | 1. https://developer.apple.com/library/archive/documentatio
             | n/Pe...
        
         | webmobdev wrote:
         | Apple system developers definitely deserve a lot of credit for
         | optimising ios / macOS Big Sur for its ARM hardware platform.
         | If we could run another OS on it, it would be evident that part
         | of the performance boost of Apple's M1 ARM processor is
         | definitely due to the optimised software it runs.
        
         | gjsman-1000 wrote:
         | If that is the case though, I wouldn't be surprised if newer
         | Linux and BSD releases gain additional support for per-core-
         | type performance scheduling and optimizations therein.
         | 
         | It's not entirely new - Remember pretty much all ARM processors
         | that aren't MCUs have big.LITTLE, but there is no doubt
         | additional work to be done in the area.
        
         | vbezhenar wrote:
         | macOS/iOS have API for marking jobs as background which will
         | run on slow cores. And this API is used, AFAIK. I'm not sure if
         | widely used Windows or Linux software routinely marks its
         | threads for background jobs. I know that I never did that in my
         | software.
        
           | ing3ng wrote:
           | Well you could determine that from the priority of the
           | process couldn't you?
        
             | heavyset_go wrote:
             | On both macOS and Linux, process scheduling goes further
             | than just niceness. On macOS in particular, it has a
             | concept of process priorities[1] and I/O policies, and the
             | OS itself defines special priorities and policies for
             | background processes.
             | 
             | [1] https://www.manpagez.com/man/2/setpriority/
        
         | wmf wrote:
         | _how much of the sublime performance of M1 Macs comes from
         | MacOS being fine-tuned to take advantage of these two different
         | type of cores?_
         | 
         | Basically none. The performance comes from the big cores.
         | Linux/BSD can guarantee good performance in the short term by
         | disabling the little cores.
        
       | gjsman-1000 wrote:
       | When Linux and (fingers-crossed) BSD get full M1 support in the
       | next year or two, these machines will be _fantastic_ Linux and
       | BSD computers. Not just from the unique hardware advantages
       | (quiet operation, performance, etc.), but also from the upstream
       | open-source kernel support and community documentation that is
       | being written.
       | 
       | And MacOS handles security on a partition level rather than on a
       | system chip level, so I could have a Full Security MacOS install
       | dual-booting with Linux/BSD someday. Exciting stuff.
        
         | nix23 wrote:
         | >MacOS handles security on a partition level rather than on a
         | system chip level
         | 
         | Really?
         | 
         | https://en.wikipedia.org/wiki/Apple_T2
         | 
         | >>Controllers for microphones, camera, ambient light sensors
         | and Touch ID, decoupling the main operating system's access to
         | those.
        
           | marcan_42 wrote:
           | > Really?
           | 
           | M1 macs are not T2 macs, nor does that have anything to do
           | with the issue at hand. What the parent means is that it's
           | not like Android where you "unlock your bootloader" and it's
           | global and locks you out of certain features. The Apple
           | Silicon secure boot mode is per OS install, so installing
           | Linux does not taint your macOS security (i.e. you can still
           | use iOS apps and watch Netflix in 4K on macOS).
        
           | gjsman-1000 wrote:
           | This is the M1, which does not quite work like the T2 does.
           | 
           | The partition-level system means that you could have a Full
           | Security MacOS install (with Secure Boot equivalent, System
           | Integrity Protection, AMFI, etc. turned on), a Permissive
           | Security MacOS install (no Secure Boot, SIP, or other
           | measures, or some on and some off), and a Linux install all
           | dual-booting on the same system.
           | 
           | Unlike other architectures, there's no "this chip is in full
           | security mode or no security mode," like unlocking the
           | bootloader on Android, where the entire system is secure or
           | insecure. On the M1, you can just have OS installs with
           | different security.
        
       | yjftsjthsd-h wrote:
       | So if it's booting from USB, does that imply that drivers for
       | internal storage aren't there yet? Still excellent progress, of
       | course:)
        
         | brynet wrote:
         | OpenBSD has a WIP driver for the NVMe controller on the M1
         | chip, but AFAIK it's not working 100% reliably yet.
         | 
         | https://github.com/openbsd/src/commit/1c31dbaaf6000562ff37f7...
         | 
         | https://github.com/openbsd/src/commit/0ccab0b00204b8c23f121d...
         | 
         | Patrick Wildt posted an early video of OpenBSD booting on the
         | M1 Mac Mini back in January. A lot of the internal hardware is
         | supported now as of 7.0-beta, such as the Broadcom Gigabit, Wi-
         | Fi and USB.
         | 
         | https://twitter.com/bluerise/status/1354216838406823936
        
       | wiredfool wrote:
       | Honestly, Today I'd be happy with Big Sur booting after a borked
       | upgrade.
        
       ___________________________________________________________________
       (page generated 2021-08-28 23:00 UTC)