Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C
572 B
Raw Blame
#!/bin/sh
# The speakers' guard (drivers/audio/hakios.guard.c) on this machine: tools/guard_test.c built against it and run.
# The kernel's header is all it needs, and an empty sys/ioccom.h beside it (the ioctl numbers are not used).
set -e
cd "$(dirname "$0")/.."
SRC=xnu-src/xnu-8796.121.2/bsd
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
mkdir -p "$tmp/sys"
cp $SRC/sys/hakios.audio.h "$tmp/sys/"
printf '#define _IOW(g, n, t) 0\n' > "$tmp/sys/ioccom.h"
cc -O2 -Wall -DKERNEL -I"$tmp" tools/guard_test.c $SRC/dev/hakios.guard.c -lm -o "$tmp/guard_test"
"$tmp/guard_test"