from Hacker News

Booting a macOS Apple Silicon Kernel in QEMU

by empyrical on 11/12/20, 12:09 AM with 70 comments

  • by userbinator on 11/12/20, 12:47 AM

    The fact that he even got that far with emulating what is essentially completely undocumented hardware is a very good sign, adding the rest of the hardware to QEMU might not be as hard as initially thought.

    This approach will help with none of these

    Don't underestimate the community -- a lot of Hackintosh (and emulation) stuff is done for the "just because I can" reasons, and getting a fully emulated ARM Mac working enough for any sort of actual use would be a huge win even if it's slower than their hardware and not 100% complete (just like Hackintoshes usually are.)

  • by PaulDavisThe1st on 11/12/20, 1:19 AM

    > 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 everything else hands down. The same is true of every other embarrassingly parallel, linearly-scaling compute problem.

    In such cases, the "speed" of Apple's own silicon doesn't help at all.

  • by als0 on 11/12/20, 1:07 AM

    > 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?

  • by Maursault on 11/12/20, 6:22 AM

    I'm impressed. One nitpik...

    Rosetta 2 != Rosetta

    We practice all day for accuracy.

  • by mshockwave on 11/12/20, 5:27 AM

    emulating iOS/MacOS is also useful for CI environment
  • by tambourine_man on 11/12/20, 1:07 AM

    This is some very cool hacking, but I’m more interested in knowing how Apple Silicon will run x86 Windows and Linux stuff. Can virtualization software get help from Rosetta 2? Or is QEMU and similar the best we can hope for?
  • by my123 on 11/12/20, 2:18 AM

    Note that macOS on Apple Silicon has AppleVirtIO.kext, Apple16X50Serial.kext and AppleEmbeddedUSBXHCIPCI.kext.

    As such, might be a better approach to start with the set of devices exposed by Qemu. :-)

  • by fgblanch on 11/12/20, 1:16 AM

    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?
  • by protoman3000 on 11/12/20, 1:23 AM

    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?

  • by Koshkin on 11/12/20, 2:28 AM

    I am curious how or why this is different from trying to boot Darwin on aarch64.
  • by ngcc_hk on 11/12/20, 2:13 AM

    Hackintosh no more on arm based one? Understand apple is fastest but memory ?