Questions tagged [xnu]

xnu is the name of the operating system kernel that underpins Mac OS X/darwin and iOS.

xnu is the name of the operating system kernel that underpins Darwin, which in turn is the core of Apple's macOS (formerly OS X and Mac OS X), iOS/iPadOS (formerly iPhoneOS), tvOS, and watchOS operating systems. It has its origins in the NeXTStep operating system, and is a combination of parts of the Mach kernel (mainly the virtual memory subsystem and inter-process communication via Mach "ports"), the 4.3BSD kernel (networking, process management, POSIX compatibility, VFS/file system layer) and a device driver subsystem called the I/O Kit, which was developed in C++ specifically for the xnu kernel.

147 questions
1
vote
1 answer

What are the possible return values for mach_timebase_info?

I know mach_timebase_info has a return type of kern_return_t, but I'm not able to locate documenation that specifies the possible return values. Where can I find this information?
Coder
  • 441
  • 2
  • 17
1
vote
1 answer

Mac OS X: How is the tcpcb struct of a TCP connection obtained by a kernel extension?

I want to provide a user space function that obtains TCP connection stats by implementing a kernel extension. From examining the TCP source, I see the tcpcp struct holds such stats. How can I, given a socket handle from user space, obtain the…
Coder
  • 441
  • 2
  • 17
1
vote
2 answers

Errors while compiling XNU-2782.1.97

I tried to compile XNU-2782.1.97 for my Mac that's on OSX Yosemite 10.10.3, but I got the following errors at the end of the compilation. I think that normally I have everything that's needing for doing it. ... clang: error: optimization flag…
Siccoi
  • 21
  • 3
1
vote
1 answer

Building xnu & using it @ Xcode

I'm currently developing a driver in osx and i'm having problem using XNU files in my Xcode project. I built XNU according to the instructions here: http://shantonu.blogspot.co.il/2013/10/building-xnu-for-os-x-109-mavericks.html It successfully…
Rouki
  • 2,239
  • 1
  • 24
  • 41
1
vote
1 answer

Override Mac XNU kernel without recompiling source code

I want to use Macbook air in clamshell mode without AC adapter connected. However, Mac OS will force system going to sleep when I close lid. I found this part of XNU kernel from apple open source may relate to this…
Ricky Zhang
  • 140
  • 1
  • 9
1
vote
2 answers

Always have much xcrun error in xnu installing(OSX 10.8.3)

i searched much websites to install the xnu kernel. however, there are some errors when i was installing xnu. Xcode version: 4.6 (installed command line tool) XNU version: xnu-2050.22.13 dtrace version: dtrace-96 here is the ERRORS: xcrun: error:…
Jacky Shek
  • 953
  • 1
  • 11
  • 35
0
votes
0 answers

How to support multiple external displays on Apple M1 silicon

I have a MacBook Pro with Apple M1 Chip used for the software development. I want to use two external displays to connect with my MacBook. But according to Apple documentation, Apple M1 chip only supports one external displays. I have searched many…
Kayroger
  • 11
  • 2
0
votes
1 answer

Example of IPC communication between a daemon running as root and another non-root process using Mach messages for macOS

I'm trying to understand the low-level mechanism of IPC using Mach messages between a launch daemon (running as root) and another process, running in a user-content. Assuming the following data structs: struct MACH_MSG_BASE { mach_msg_header_t…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
0
votes
0 answers

Why do I have different shell commands available to me in terminal vs xcode?

When I run swiftgen in Terminal the command is recognized. When a script in a xcode build runs swiftgen it says command not found. How are the two environments different, and how can I get them in sync? I tried different shells in both and they…
0
votes
1 answer

Why is the XNU revision different from the `uname -a` output?

On apple's website, MacOS 12.5.1 is shipped with XNU kernel 8020.140.41 But from uname -a I got root:xnu-8020.240.7~1 Darwin devnull 21.6.0 Darwin Kernel Version 21.6.0: xxxx; root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64 i386 xxx Darwin So the…
daisy
  • 22,498
  • 29
  • 129
  • 265
0
votes
1 answer

Xcode Building fails why?

Is my headers corrupted or something? or is something missing ? I already uninstalled and deleted everything and all the folders xcode made in /Library and did a fresh reinstall and yet im still gettin errors such as: Heres my command : clang -o…
0
votes
0 answers

Prior to macOS Sierra, why didn't XNU handle THREAD_RESTART in its kqueue_scan_continue function?

I'm trying to find the cause of a nasty kernel panic triggered by Chromium Legacy, a project to backport modern versions of Chromium to old versions of macOS (10.7 – 10.10). The kernel panic occurs when the kqueue_scan_continue function is called…
Wowfunhappy
  • 168
  • 7
0
votes
1 answer

A third party NVMe driver won't load during macOS 11 boot

My NVMe driver works fine in macOS 10.15, but in macOS 11.0, it won't be loaded when the system boots up. I knew my driver is installed to auxiliary kext collection. when the macOS11 boot, the system always load applenvme driver in Boot Kernel…
Song
  • 97
  • 7
0
votes
1 answer

How mach trap become syscall?

I'm new to XNU kernel and partially confused. I see that we a function in file vm_unix.c: kern_return_t task_for_pid(struct task_for_pid_args *args) with the comment: // This should be a BSD system call, not a Mach trap!!! then 2 declarations in…
park joh
  • 23
  • 3
0
votes
1 answer

Is OS X have any kernel function similar to on_each_cpu() in linux

I want to execute function on each processors. Is OS X have any kernel function similar to on_each_cpu() in linux?
이유찬
  • 43
  • 4