XNU source code for Sierra 10.12.6 is incomplete…

The XNU source code for Sierra 10.12.6, the source code that Apple is sharing with us, is missing some vital definitions. This makes it even more incomplete than it already was. I mean just look at this (cpuid.h):

#define CPU_MODEL_SKYLAKE		0x4E
#define CPU_MODEL_SKYLAKE_ULT		0x4E
#define CPU_MODEL_SKYLAKE_ULX		0x4E
#define CPU_MODEL_SKYLAKE_DT		0x5E

That should really be this:

#define CPU_MODEL_SKYLAKE		0x4E
#define CPU_MODEL_SKYLAKE_ULT		0x4E
#define CPU_MODEL_SKYLAKE_ULX		0x4E
#define CPU_MODEL_SKYLAKE_DT		0x5E
#define CPU_MODEL_SKYLAKE_W		0x55

#define CPU_MODEL_KABYLAKE		0x8E
#define CPU_MODEL_KABYLAKE_ULT		0x8E
#define CPU_MODEL_KABYLAKE_ULX		0x8E
#define CPU_MODEL_KABYLAKE_DT		0x9E

And this line is also missing in machine.h:

#define CPUFAMILY_INTEL_KABYLAKE	0x0f817246

Why? Because Kaby Lake processors where introduced in Mac’s long before the High Sierra GM. Without these even Apple cannot compile the source code. But hey. I guess that Apple isn’t expecting us to pay attention to detail.

Note: The source code for High Sierra 10.13 is correct. As in the lines are there in the SDK already.

16 thoughts on “XNU source code for Sierra 10.12.6 is incomplete…

  1. Hi piker
    I just want to ask even though its not the correct post etc, so sry for that.
    But i just wanna get this off my chest man…

    Why in gods name is apple keep being a pain in the a*s about adding window snapping support like in windows 10 where you can just drag and drop a window and it will maximize or get half of the screen or even put it in any top corner etc and it will snap.
    Like im so tired of using moom program in 10.11.6 and it keep failing to work well with the browser im using like opera, chrome etc, it just doesnt work smooth and keeps hacking even though i have the latest version etc.

    Is there some terminal command you could find that can activate that future, window snapping in 10.13, if there is such thing hidden i mean…

    Oh my god whats wrong with apple and how many 100 years do they need to make something as obvious and needed as this simple future available to their users.

    Are the just ignorans or is there no one complaining about missing that future and how important it is… I rather pay them then some 3rd party app and have that future baked in, in the system and soon 10.13 is here and still there is no such simple future in it… like what is wrong with this company.

    Its like they have added every stupid future possible but this simple one that makes working with many web browsers window opened so easy and any other window for that matter.
    Why not perfect the workflow for people instead of making it harder and a pain and endless headache.

      • This is how it works piker ( https://www.youtube.com/watch?v=_tqYXklSRaw )
        Really helpful feature.. I dont understand how people can live without it in mac to be honest.

        I hope you can find out something, maybe in 10.13 code or maybe even contact apple and give them some peace of mind about how they are still behind about something so simple and helpful for the workflow..
        I would gladly write to them if i knew what mail adress to send too etc.. but then again i dont think they would take me so serious like when someone as great as you write to them.
        Who knows maybe after 1 year or something this future will be available thanks to your writing or complain.

  2. Hi. Sorry for being annoying, but i am still very interesting in getting sample code to speak with the NVMeSMARTLib. I found list of the function in the NVMeSMARTClient:: class using “nm NVMeSMARTLib | c++filt -p -i”, but still not sure how to process further. I was able to create plugin interface using IOCreatePlugInInterfaceForService and kIONVMeSMARTUserClientTypeID from the plist, but not sure where to get structure for the QueryInterface call.

    Could you please help?

  3. Hi @pikeralpha
    Do you know something about missing “thread_self_restrict.h” in HS xnu sources? Looks like it is also incomplete…

      • Aha, so this is WebKit? Will try. By the way, just built release kernel from sources – somehow, it is much smaller than real kernel, and during kext cache rebuild – it is throwing a lot of errors that starts from “In interface com.apple.kpi.private of __kernel__, couldn’t find symbol”
        Did you try to build HS kernel from sources? And boot it? I’m trying to build my own kernel with some extra debug output (don’t want to spend days trying to do same with Hopper) – and still have not much luck.

      • Yes. Last week already. Been lobbying for the missing ARM bits and I’m glad that it’s there now.

        Make sure to match your kernel with the proper version of System.kext I’m not at home and have no time to run any kind of test builds now. Sorry.

        I don’t use AMD processors and thus I have no need to use my own kernel. XCPM is still missing. Apple even removed the directory for it.

  4. Luckily i’m on Intel 🙂 But i’m trying to investigate why Thunderbolt 3 is not working properly. I have made my controller to be powered permanently, so no power-on/power-off issue. But, for some reason, NHI (Native Host Interface) communication is broken – in IOReg macos says that it sent 8 requests to NHI and got zero response (in Win and Linux TB works perfectly). So, i’m trying to get kernel_debug output to logs from IOThunderboltFamily and APpleThunderboltNHI. That’s why I’m trying to make own kernel – with no luck atm…
    If you will have free minute – could you share your steps for compiling good working HS kernel?

Leave a reply to pikeralpha Cancel reply