Live data from Hacker News

Booting a macOS Apple Silicon Kernel in QEMU

worthdoingbadly.com

21–30 of 73 posts

Re: Booting a macOS Apple Silicon Kernel in QEMU

#22

Incredible. Emulating AppleSilocon before they even announced it. Does anybody know where one can learn about how these people approach and learn about the inner workings of what is essentially a black box from the outside?

Load the file into a decompiler, run it in QEMU with GDB attached, compare. Also have a general idea of how XNU boots.

I remember a comment (maybe from HN) that said "Everything's open source when you can read assembly".

Re: Booting a macOS Apple Silicon Kernel in QEMU

#23
post #6

I am wondering if with a hack like this and a jailbroken apple tv 4k we could have mac os running on a very cheap apple device?

Apple TV 4K uses the A10X, which is ARMv8.0. That's so old that it even pre-dates the true atomics instructions (which are intro'd in 8.1-A). So it'll have to be a pretty heavyweight JIT to adapt ARMv8.3 code to that baseline.

For Apple A11 though, going from 8.3 -> 8.2 is much easier... and doable through a patch on fault method.

Re: Booting a macOS Apple Silicon Kernel in QEMU

#25
post #15
post #5

> macOS uses CPU instructions that aren’t available yet on non-Apple ARM CPUs, so you can’t have hardware accelerated virtualization, Does anyone know what these instructions are? And could you not trap and emulate them if the hypervisor detects an invalid instruction?

So in the future macOS will run on arm64e architecture? Could Linux[1] run on that as well? Any chance of seeing more ARM laptops in the future? 1: https://wiki.debian.org/Arm64Port

macOS already runs on arm64e, that's what was given to developers as part of the Universal App Quick Start program.

Re: Booting a macOS Apple Silicon Kernel in QEMU

#26
post #22

Earlier quoted context omitted.

Load the file into a decompiler, run it in QEMU with GDB attached, compare. Also have a general idea of how XNU boots.

I remember a comment (maybe from HN) that said "Everything's open source when you can read assembly".

XNU happens to be mostly open-source.

Re: Booting a macOS Apple Silicon Kernel in QEMU

#27

> Besides, Hackintoshes are often built when Apple’s own hardware isn’t fast enough; in this case, Apple’s ARM processors are already some of the fastest in the industry. They are also used when one wants more cores than are possible on Apple hardware. If you want a build engine for a medium to large sized compiled language project, Apple has no options that make economic sense, since a Ryzen Threadripper will beat e…

This speed advantage won’t apply when emulating Apple silicon on an x86-64 CPU, as discussed here.

Emulating ARM on x86-64 is doable, but it has dramatically more overhead. It’s doubtful that a high core count would be enough to overcome this relative to just using Apple silicon.

Re: Booting a macOS Apple Silicon Kernel in QEMU

#28

> Besides, Hackintoshes are often built when Apple’s own hardware isn’t fast enough; in this case, Apple’s ARM processors are already some of the fastest in the industry. They are also used when one wants more cores than are possible on Apple hardware. If you want a build engine for a medium to large sized compiled language project, Apple has no options that make economic sense, since a Ryzen Threadripper will beat e…

Let’s wait the Apple Silicon Mac Pro. I think they are all in on this fastest chip race thing, with deep pockets, high paying customers and scale behind them.

Re: Booting a macOS Apple Silicon Kernel in QEMU

#29

> Besides, Hackintoshes are often built when Apple’s own hardware isn’t fast enough; in this case, Apple’s ARM processors are already some of the fastest in the industry. They are also used when one wants more cores than are possible on Apple hardware. If you want a build engine for a medium to large sized compiled language project, Apple has no options that make economic sense, since a Ryzen Threadripper will beat e…

This speed advantage won’t apply when emulating Apple silicon on an x86-64 CPU, as discussed here. Emulating ARM on x86-64 is doable, but it has dramatically more overhead. It’s doubtful that a high core count would be enough to overcome this relative to just using Apple silicon.

My point was that the best use of hackintosh/VM tech is unrelated to "speed advantage". Apple has nothing that can touch a Threadripper for linearly scaled parallel workflows. The gap is so big that it might even overcome the arm/x86-64 emulation cost, though that wasn't what I was suggesting.
Post reply on HN