Live data from Hacker News

Linux Running on Apple M1

twitter.com

261–270 of 282 posts

Re: Linux Running on Apple M1

#261

Earlier quoted context omitted.

Funny, that's how I feel with Windows and Mac. I grab a machine and install Linux, and it works more or less out of the box. Maybe a few fixable quirks. And I don't use Thinkpads. I try to use Windows or macos, and it's a coin toss. Windows handling USB like hot garbage (hub balancing/buffer sizes leading to devices unable to activate, webcams glitching, input lagging at random intervals), display issues (macos doesn…

> having been a proprietary kernel driver developer for Windows, FreeBSD and Linux May I ask how you learned how to do this? I'd like to learn too! I had a great experience developing a Linux user space driver for my own laptop's LEDs. Couldn't figure out how to control the fans though.

1. Accept that printf (preferably over serial) is The One True Debugger. It is the tool you always have - if you can't get a print over serial, you're in too deep to use a debugger anyway.

2. Play around with embedded. You can use an arduino, but get rid of the Arduino IDE. Once you've ridded yourself from their weird environment and code in C, you're pretty close to what kernel programming is: Direct hardware control, debugging over a serial console, and if you mess up you don't get saved by a segfault.

You can upgrade to playing with ARM boards later if you want. Things like a Raspberry Pi can also be useful to boot random kernels you've built later on for HW stuff, otherwise you can use VMs. QEMU can boot a kernel file directly, which makes debugging easier.

3. Look at one of the tutorial for writing hello-world kernel modules. There's also usually smaller cleanup tasks you can do to get started submitting work. Looking at Linux and FreeBSD both can be useful, and things like Plan9 have very small kernels that can be used as reference. Linux and FreeBSD are not that different. (Windows is a pain with really weird interfaces, but it can be made to work.)

4. Find something you want to do with the kernel or fix in it.

Kernel developers aren't that common, so I imagine a lot of places are willing to train people. The first job I had doing kernel work was pretty open, and just threw minor stuff to begin with at me, e.g. "things stopped working after kernel X.Y, figure out what happened". Bisecting, testing in VMs, printk'ing a lot to compare state, stuff like that. I later ended up being the owner of the kernel drivers of all our platforms, so I guess I did okay. :)

Re: Linux Running on Apple M1

#262
post #255

Earlier quoted context omitted.

You are incorrectly assigning platform popularity as equal to driver maintenance. First, non-desktop uses of Linux significantly outnumber uses of Windows and macOS in general, and a large majority of drivers and functionality is shared there. Second, drivers not made by the usual giants are, as I mentioned earlier and experienced first hand, written and shipped once, maybe with a few updates for obvious issues, but…

I know all of that, but it does not square up with real life. Go to your favorite computer store. Randomly pick 5 laptops, regardless of the price. So no cherry picking. Use these laptops with Windows installed on them, for a reasonably long period, for example 1 month, as your daily driver. Perform varied tasks on them, such as printing, connecting to external displays, to projectors, other peripherals, playing mode…

You will pay me just $100 to out of my own pocket buy five random laptops regardless of price, some of which will be several thousand dollars, from the local electronics store.

You're very right that there is no value in continuing a discussion if that's the level of debate you're presenting. I'm off.

Re: Linux Running on Apple M1

#263
post #127

Earlier quoted context omitted.

Funny, that's how I feel with Windows and Mac. I grab a machine and install Linux, and it works more or less out of the box. Maybe a few fixable quirks. And I don't use Thinkpads. I try to use Windows or macos, and it's a coin toss. Windows handling USB like hot garbage (hub balancing/buffer sizes leading to devices unable to activate, webcams glitching, input lagging at random intervals), display issues (macos doesn…

The thing is, many more people are using Windows, than Macs and many more people are using Macs, than desktop Linuxes. So your anecdata goes against a mountain of anecdata from people using those platforms.

hmmm ... yes. anecdata.

Re: Linux Running on Apple M1

#264
post #127

Earlier quoted context omitted.

The thing is, many more people are using Windows, than Macs and many more people are using Macs, than desktop Linuxes. So your anecdata goes against a mountain of anecdata from people using those platforms.

You are incorrectly assigning platform popularity as equal to driver maintenance. First, non-desktop uses of Linux significantly outnumber uses of Windows and macOS in general, and a large majority of drivers and functionality is shared there. Second, drivers not made by the usual giants are, as I mentioned earlier and experienced first hand, written and shipped once, maybe with a few updates for obvious issues, but…

There are many people like me, however, who choose to run Linux in a VM under Windows so they don't have to deal with bugs.

Linux as a personal operating system got WAY better over the last years, sure, but you can't seriously argue that it got Windows AND MacOS beat.

Re: Linux Running on Apple M1

#265

Earlier quoted context omitted.

It's the smaller things. Obviously MacOS won't have trouble with mac hardware, but my work macbook can't wake up my monitor through HDMI, or chain DP displays, or connect to my phone's storage through USB, etc...

I’ve never experienced the wake issue, but I always use usb-c to DP or HDMI and apparently those aren’t affected? Assuming it’s the same issue, a little googling shows the problem was fixed a year ago. What phone are you having issues with? Every android phone I’ve used will communicate with adb. iPhone has never used USB mass storage, and support for that has nothing to do with MacOS. Can’t comment on the daisy chai…

My 2019 Macbook Pro has consistent issues waking from sleep. Nothing plugged in except the included power supply.

Screen will remain black. Or, screen will power on, display nothing. Or, screen will power on, mouse cursor will appear, but no password prompt.

Re: Linux Running on Apple M1

#266

Earlier quoted context omitted.

A 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.)

> "we'd love to see what you'll do with it" ...without the documentation that would help you. When Broadcom act like this they're considered villains and we're recommended to stay away from their hardware. But when Apple do it, they're being benevolent? And that's ignoring the fact that I could actually get Broadcom documentation in exchange for dollars and NDA.

> ...without the documentation that would help you.

Well, it's not really worse than their usual documentation on products they officially support: https://www.caseyliss.com/2020/11/10/on-apples-pisspoor-docu...

Re: Linux Running on Apple M1

#267
post #265

Earlier quoted context omitted.

I’ve never experienced the wake issue, but I always use usb-c to DP or HDMI and apparently those aren’t affected? Assuming it’s the same issue, a little googling shows the problem was fixed a year ago. What phone are you having issues with? Every android phone I’ve used will communicate with adb. iPhone has never used USB mass storage, and support for that has nothing to do with MacOS. Can’t comment on the daisy chai…

My 2019 Macbook Pro has consistent issues waking from sleep. Nothing plugged in except the included power supply. Screen will remain black. Or, screen will power on, display nothing. Or, screen will power on, mouse cursor will appear, but no password prompt.

You should return it and get a free replacement. It’s clearly defective.

Re: Linux Running on Apple M1

#268
post #84

Linux 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 expensi…

Agreed. Check out the state of Linux support on Intel Macs that were released in and after 2016[1], it's abysmal. Once Apple started adding non-standard hardware, Linux support never caught up. It isn't like the lack of support is Linux developers' fault. Apple doesn't provide datasheets for their hardware, and they don't cooperate with developers writing drivers for their custom hardware. There are hundreds, if not…

Apple is a hardware vendor. How are the parts they use "non-standard"? What are the "standard" parts that Linux uses and further what consumer or business hardware has Linux indicated is standard?

It appears what should be being asked for is Apple to commit resources to natively support things like: Docker, Kubernetes, Virtualization and Linux drivers on their M1 Macs going forward.

Re: Linux Running on Apple M1

#269

Earlier quoted context omitted.

You are incorrectly assigning platform popularity as equal to driver maintenance. First, non-desktop uses of Linux significantly outnumber uses of Windows and macOS in general, and a large majority of drivers and functionality is shared there. Second, drivers not made by the usual giants are, as I mentioned earlier and experienced first hand, written and shipped once, maybe with a few updates for obvious issues, but…

There are many people like me, however, who choose to run Linux in a VM under Windows so they don't have to deal with bugs. Linux as a personal operating system got WAY better over the last years, sure, but you can't seriously argue that it got Windows AND MacOS beat.

I am arguing just that, with a reasonably large and varied sample-size, although heavily biased towards macs over windows-powered machines. I get a lot of machines from clients.

Now, a mac on its own tends to work quite well out of the box, but this does not hold for peripherals, and I feel like the machines always end up developing... quirks.

I always felt that the path you picked just gives you the sum of all problems with few of the benefits. I could maybe do the other way around for compat, but the laptop wouldn't be able to stay on this side of the balcony railing for long if I did it the way suggested... :|

Re: Linux Running on Apple M1

#270

Earlier quoted context omitted.

> that doesn't mean much because they're actually running Linux forks Many of these Arm SoCs are running linux forks because there are some terrible baked in drivers, and no spec associated with them. Still, that is a step ahead of the M1 as there are at least drivers that don't have to be decompiled and reverse engineered.

These drivers are baked, even if there are specs for them. The thing is, that these SoCs have no PCIe or other enumerable bus. You (=your kernel) must know what hardware it is running on and which drivers to load without being able to ask the hardware, what is really present. One wrong POKE and the entire system can hang. And that is on top of the problem, how to boot in the first place. There is not such thing as UE…

This is a little out of date. Device tree exists explicitly to avoid needing a machine file for your board. Bootloaders like uboot will load your kernel and dtb together, and the kernel uses the dtb to enumerate the hardware on the system.

Again, the problem isn't that the mainline kernel _couldnt_ support these boards, is that no one wants to put in the work to bring their implementations up to the standards of the mainline kernel.

Post reply on HN