xnu | XNU kernel is part of the Darwin operating system

 by   argp C Version: Current License: Non-SPDX

kandi X-RAY | xnu Summary

kandi X-RAY | xnu Summary

xnu is a C library. xnu has no bugs, it has no vulnerabilities and it has low support. However xnu has a Non-SPDX License. You can download it from GitHub.

config - configurations for exported apis for supported architecture and platform. SETUP - Basic set of tools used for configuring the kernel, versioning and kextsymbol management. EXTERNAL_HEADERS - Headers sourced from other projects to avoid dependency cycles when building. These headers should be regularly synced when source is updated. libkern - C++ IOKit library code for handling of drivers and kexts. libsa - kernel bootstrap code for startup. libsyscall - syscall library interface for userspace programs. libkdd - source for user library for parsing kernel data like kernel chunked data. makedefs - top level rules and defines for kernel build. osfmk - Mach kernel based subsystems. pexpert - Platform specific code like interrupt handling, atomics etc. security - Mandatory Access Check policy interfaces and related implementation. bsd - BSD subsystems code. tools - A set of utilities for testing, debugging and profiling kernel.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              xnu has a low active ecosystem.
              It has 12 star(s) with 1 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              xnu has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of xnu is current.

            kandi-Quality Quality

              xnu has no bugs reported.

            kandi-Security Security

              xnu has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              xnu has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              xnu releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of xnu
            Get all kandi verified functions for this library.

            xnu Key Features

            No Key Features are available at this moment for xnu.

            xnu Examples and Code Snippets

            No Code Snippets are available at this moment for xnu.

            Community Discussions

            QUESTION

            Trying to get CLI app STDOUT through a pipe but blocked till buffer is fulfilled
            Asked 2021-May-24 at 19:34

            I am working now on a macOS Sierra, which does not have the /proc/sys/fs/pipe-max-size nor fcntl's F_SETPIPE_SZ. (Darwin macos-1012 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64)

            I am trying to get macOS' log stream output through pipe() since I am opening it with execvp() but I only get its logs when the whole buffer is filled (16384 bytes), this may take hours, days, or more depending on the filter used with log stream.

            When I run log stream in a command-line it shows log by log and there is no need to wait for the 16384 bytes to be written on STDOUT. But I do have to wait also when I redirect STDOUT as follows:

            ...

            ANSWER

            Answered 2021-May-24 at 19:34

            You can use command like:

            Source https://stackoverflow.com/questions/67675001

            QUESTION

            OSX fix Selenium Chromedriver launch error spawn Unknown system error -86 Bad CPU type in executable?
            Asked 2021-May-11 at 11:55

            Suddenly on the afternoon of January 6, 2021, my Selenium Protractor tests under OSX stopped working with the mysterious error

            ...

            ANSWER

            Answered 2021-Feb-03 at 18:26

            Edit: this answer should be considered deprecated now that the underlying bug in webdriver-manager has been fixed. A better solution would be to upgrade to the newest version of webdriver-manager. The answer below may be useful if people need to use an older version of webdriver-manager which still has the bug.

            As per Deepak Srinivasan's comment above, this error is caused by https://github.com/angular/webdriver-manager/issues/476

            Root Cause: The ChromeDriver team added "_m1" to the end of the filename for their Apple Silicon ARM builds of Chromedriver -- but both the Silicon and Intel versions of chromedriver have "mac64" in the filename, and the version number is exactly the same. This causes webdriver-manager to always download the Silicon build of Chromedriver, even on Intel macs. As a general solution, simply avoid using the chromedriver that has _m1 in its filename if you are on an Intel mac.

            Solution 1: Downgrade to Chrome 86.0.4240.198 and Chromedriver 86.0.4240.22. These versions work together and are the most recent versions prior to the new and problematic support for Silicon ARM

            Chrome 86 download page: https://google-chrome.en.uptodown.com/mac/download/2920124

            Disable auto-updates in Chrome: https://superuser.com/questions/1359017/how-do-i-disable-automatic-updates-of-google-chrome-on-mac-os-x

            Chromedriver 86: https://chromedriver.storage.googleapis.com/index.html?path=86.0.4240.22/

            Source https://stackoverflow.com/questions/65618558

            QUESTION

            What are the alignments referred to when discussing the strings section of a process address space
            Asked 2021-Apr-13 at 05:00

            I'm trying to write a program to expose the arguments of other pids on macOS. I've made the KERN_PROCARGS2 sysctl, but it turns out that everyone and their dog use this wrong. Including Apple's ps, and Google's Chrome. The exec family of functions all allow you to pass an empty string as argv[0], which is not great but it can happen and so must be dealt with. In this case, the standard approach of skipping forward past the NULLs following the exec_path in the returned buffer doesn't work, as the last NULL before the rest of the arguments is actually the terminating NULL of an empty string, So you wind up skipping an argument you didn't mean to, which can result in printing an env var as an argument (I've confirmed this behaviour in many programs).

            To do this properly one must calculate how many nulls to skip, instead of skipping them all every time. There are references around the web to the different parts of the returned buffer being pointer aligned, however no matter what part of the buffer I try to check with len % 8 I don't get a correct count of padding NULLs.

            ...

            ANSWER

            Answered 2021-Apr-13 at 05:00

            It's the length of the saved exec_path that needs to be padded to a multiple of the system pointer length.

            Source https://stackoverflow.com/questions/66943561

            QUESTION

            Xdebug works on CLI but Apache wont load it
            Asked 2021-Mar-18 at 16:11

            For the love of my life, I cannot figure this one out: I've compiled xdebug from source code and while the CLI will show me that it is active the webserver will not.

            This is the process I went through.

            ...

            ANSWER

            Answered 2021-Mar-18 at 16:10

            After banging my head against the wall for a few hours, I was finally able to figure out what the problem was.

            There was an error message about xcode not being code signed:

            Source https://stackoverflow.com/questions/66658486

            QUESTION

            Behavior of fread when only a partial record is available before the end of file
            Asked 2021-Mar-14 at 19:11

            I work on what can be seen as a C interpreter that detects all undefined behaviors in the program it interprets. While using this interpreter to find bugs in a legacy open-source C application, I was puzzled by the following behavior:

            The legacy application expected a 10-byte header that it needed it its entirety in order to do further work. It was correctly calling fread(buffer, 10, 1, f);. Incorrectly, it did not assign the result of the fread call, and started parsing the buffer right away.

            When this fread was applied on a file with less than 10 bytes available, what happened was that buffer was partially filed with the available data. The interpreter, as it is designed to, detected that an uninitialized part of the buffer was used later and warned about that and I was able to trace the problem to the result of fread being discarded.

            It puzzled me for one minute that the fread written by my colleagues had partially filled the buffer, even though it was going to return 0 eventually, and I wondered if this could be improved. Obviously some implementations do read into the buffer and in the end return the number of read record as return n_bytes / __size;, letting the division round down, in this case to 0. But I wondered if other implementations might only write to buffer if an entire record is available, and leave it entirely uninitialized otherwise.

            In practice, on the two Unices that I have at hand, fread behaves the same way as the model implementation written by my colleagues:

            ...

            ANSWER

            Answered 2021-Mar-14 at 19:11

            Both C99 (§7.19.8.2) and C11 (§7.21.8.2) define fread() with the following description:

            The fread function reads, into the array pointed to by ptr, up to nmemb elements whose size is specified by size, from the stream pointed to by stream. For each object, size calls are made to the fgetc function and the results stored, in the order read, in an array of unsigned char exactly overlaying the object. The file position indicator for the stream (if defined) is advanced by the number of characters successfully read. If an error occurs, the resulting value of the file position indicator for the stream is indeterminate. If a partial element is read, its value is indeterminate.

            That last bit should clear your doubts:

            If a partial element is read, its value is indeterminate.

            So, even though all the implementations you see appear to behave "nicely", you cannot rely on that, as it is implementation-dependent behavior that the standard does not define. A program that wishes to read a partial element (if the file contains one) should use a size of 1 and check the return value. Indeed, if a program does not do this and instead reads with size > 1 and nmemb = 1, it wouldn't even have the ability to distinguish between initialized and unitialized data into the buffer in the case of a last partial element.

            Source https://stackoverflow.com/questions/66627957

            QUESTION

            Cannot run npm install from nvm, but working well using source from https://nodejs.org/en/download/
            Asked 2021-Mar-08 at 05:12

            need help. in few days i got error like this.

            ...

            ANSWER

            Answered 2021-Mar-08 at 05:12

            Try to completely Uninstall Node.js from the system and try to install node v12.13.0 (You can install it from https://nodejs.org/dist/v12.13.0/)

            Source https://stackoverflow.com/questions/66524565

            QUESTION

            Cannot install DBD::Oracle on macOS Big Sur => dependent dylib '@rpath/libclntsh.dylib.19.1' not found
            Asked 2021-Feb-21 at 18:12

            I cannot build and install Oracle Instant Client 19.8 on macOS Big Sur 11.2.1. I get the following error:

            ...

            ANSWER

            Answered 2021-Feb-21 at 18:12

            The problem is that the DYLD_LIBRARY_PATH environment variable is not propagated to perl when running make test as described here. Instead of running cpanm DBD::Oracle, you can download the module run the tests manually using e.g. prove. The following worked for me (macOS BigSur 11.2.1), perlbrew perl version 5.32.0:

            Source https://stackoverflow.com/questions/66302271

            QUESTION

            Cannot find module 'npmlog' using NVM
            Asked 2021-Feb-17 at 14:10

            Node Version Manager (v0.35.3)

            I am getting the following error using multiple different commands, even just opening up my terminal I get this.

            ...

            ANSWER

            Answered 2021-Feb-17 at 14:10

            If you're looking to troubleshoot how things got to the state they're in, there may be a lot of things to investigate. However, if you just want to fix the problem, it should be harmless and effective to reinstall nvm. No need to uninstall (as installing over an existing nvm is the same as updating nvm).

            Per the instructions on installing/updating, run either:

            Source https://stackoverflow.com/questions/66241595

            QUESTION

            Should macOS driverkit system extensions be arm64 or arm64e for Apple Silicon / M1?
            Asked 2021-Feb-02 at 21:26

            I compile a macOS driverkit system extension as a Universal library so that it contains both x86_64 and arm64. One Apple Silicon computer A the driver starts when I attach the USB device. On Apple Silicon computer B I can see kernel: exec_mach_imgact: disallowing arm64 platform driverkit binary "com.example.driver", should be arm64e being printed in the Console.app when the USB device is attached. I've looked at the source code of where this is happening but I cannot figure out what the problem is. If I compile it for arm64e then it get exec_mach_imgact: not running binary "com.example.driver" built against preview arm64e on computer A, bit then it starts on computer B.

            None of the computers have -arm64e_preview_abi set in the boot-args.

            If I create a new Xcode (12.4) project on each machine and build Release then computer A and otool -fvv com.example.driver gives

            ...

            ANSWER

            Answered 2021-Jan-31 at 10:41

            My experience so far indicates that arm64e is the correct and only correct Apple Silicon architecture to use for dexts.

            For one, there's the "disallowing arm64 platform" error, and also Apple's own DriverKit based drivers are built for arm64e:

            Source https://stackoverflow.com/questions/65970643

            QUESTION

            What would be the best approach patch-finding the pointer of a certain function on the XNU Kernel?
            Asked 2020-Dec-31 at 16:55

            I am currently working on an iOS Jailbreak for iOS 13.7. As part of the jailbreak, I need to do a series of patches to the XNU Kernel live in the memory. Of course, the kernel is protected by kASLR, KPP / KTRR, and other memory watchdogs that would trigger a Kernel Panic if something is modified. As luck would have it, KTRR (Kernel Text Ready Only Region) can only protect, well, static data that is not supposed to change (i.e. the TEXT section and constants). The variables can still be altered.

            I am building a PatchFinder which is supposed to locate a function or a variable in the XNU memory based on tell-tale symbols and I am wondering what would be the most effective approach for this.

            I am currently adapting on top of the PatchFinder made publicly available back in the iOS 8 era by in7egal which looks like this:

            ...

            ANSWER

            Answered 2020-Dec-31 at 16:55

            The variable you're looking for doesn't exist anymore.

            The bytes in your first snippet make up Thumb instructions, which find this function in AMFI in a 32bit kernelcache:

            Source https://stackoverflow.com/questions/65516664

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install xnu

            To install IOKit headers, see additional comments in [iokit/IOKit/Makefile](). XNU installs header files at the following locations -. Kernel.framework is used by kernel extensions.\ The System.framework and /usr/include are used by user level applications. \ The header files in framework’s PrivateHeaders are only available for Apple Internal Development . The directory containing the header file should have a Makefile that creates the list of files that should be installed at different locations. If you are adding the first header file in a directory, you will need to create Makefile similar to xnu/bsd/sys/Makefile. Add your header file to the correct file list depending on where you want to install it. The default locations where the header files are installed from each file list are -. The Makefile combines the file lists mentioned above into different install lists which are used by build system to install the header files. There are two types of install lists: machine-dependent and machine-independent. These lists are indicated by the presence of MD and MI in the build setting, respectively. If your header is architecture-specific, then you should use a machine-dependent install list (e.g. INSTALL_MD_LIST). If your header should be installed for all architectures, then you should use a machine-independent install list (e.g. INSTALL_MI_LIST). If the install list that you are interested does not exist, create it by adding the appropriate file lists. The default install lists, its member file lists and their default location are described below -. If you want to install the header file in a sub-directory of the paths described in (1), specify the directory name using two variables INSTALL_MI_DIR and EXPORT_MI_DIR as follows -. A single header file can exist at different locations using the steps mentioned above. However it might not be desirable to make all the code in the header file available at all the locations. For example, you want to export a function only to kernel level but not user level.
            $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers
            $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
            $(DSTROOT)/usr/include/
            $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
            DATAFILES : To make header file available in user level - $(DSTROOT)/usr/include
            PRIVATE_DATAFILES : To make header file available to Apple internal in user level - $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders
            KERNELFILES : To make header file available in kernel level - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
            PRIVATE_KERNELFILES : To make header file available to Apple internal for kernel extensions - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders
            INSTALL_MI_LIST : Installs header file to a location that is available to everyone in user level. Locations - $(DSTROOT)/usr/include Definition - INSTALL_MI_LIST = ${DATAFILES}
            INSTALL_MI_LCL_LIST : Installs header file to a location that is available for Apple internal in user level. Locations - $(DSTROOT)/System/Library/Frameworks/System.framework/PrivateHeaders Definition - INSTALL_MI_LCL_LIST = ${PRIVATE_DATAFILES}
            INSTALL_KF_MI_LIST : Installs header file to location that is available to everyone for kernel extensions. Locations - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers Definition - INSTALL_KF_MI_LIST = ${KERNELFILES}
            INSTALL_KF_MI_LCL_LIST : Installs header file to location that is available for Apple internal for kernel extensions. Locations - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders Definition - INSTALL_KF_MI_LCL_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
            EXPORT_MI_LIST : Exports header file to all of xnu (bsd/, osfmk/, etc.) for compilation only. Does not install anything into the SDK. Definition - EXPORT_MI_LIST = ${KERNELFILES} ${PRIVATE_KERNELFILES}
            PRIVATE : If defined, enclosed definitions are considered System Private Interfaces. These are visible within xnu and exposed in user/kernel headers installed within the AppleInternal "PrivateHeaders" sections of the System and Kernel frameworks.
            KERNEL_PRIVATE : If defined, enclosed code is available to all of xnu kernel and Apple internal kernel extensions and omitted from user headers.
            BSD_KERNEL_PRIVATE : If defined, enclosed code is visible exclusively within the xnu/bsd module.
            MACH_KERNEL_PRIVATE: If defined, enclosed code is visible exclusively within the xnu/osfmk module.
            XNU_KERNEL_PRIVATE: If defined, enclosed code is visible exclusively within xnu.
            KERNEL : If defined, enclosed code is available within xnu and kernel extensions and is not visible in user level header files. Only the header files installed in following paths will have the code - $(DSTROOT)/System/Library/Frameworks/Kernel.framework/Headers $(DSTROOT)/System/Library/Frameworks/Kernel.framework/PrivateHeaders

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/argp/xnu.git

          • CLI

            gh repo clone argp/xnu

          • sshUrl

            git@github.com:argp/xnu.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link