On Linux, you can allocate memory at a specific address like so:
void *foo = (void *)0xDEADBEEF;
size_t MyLength = 1024;
void *bar = mmap(foo, MyLength, PROT_READ | PROT_WRITE | MAP_ANONYMOUS | MAP_FIXED, MAP_PRIVATE, -1, 0);
Is this same method also possible on Mac OS, or if not, how does one do this on Mac OS?
My goal is to write a kernel extension to map out (and thus disable) a region of defective memory on a MacBook Pro with a non-removable defective RAM chip.
This is std C
. It compiles fine on Xcode. Make sure to add:
#include <sys/mman.h>
Before you invest too much time writing a kernel extension for macOS be aware of its deprecation.
User contributions licensed under CC BY-SA 3.0