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

Merge ufs: the kernel reads the phone's flash through the loader, and the iOS root container is on it

vcvkk186f63bf68c0
diff --cc xnu/redwood.patch
index 3111f18,157db95..58e2c8c
--- a/xnu/redwood.patch
+++ b/xnu/redwood.patch
@@@ -45,27 -45,11 +45,27 @@@ index 222158a93918..68bb0f3e56bf 10075
set path = ($path .)
######################################################################
# HISTORY
+diff --git a/bsd/conf/Makefile.arm64 b/bsd/conf/Makefile.arm64
+index a4d25040f38f..aad72993d139 100644
+--- a/bsd/conf/Makefile.arm64
++++ b/bsd/conf/Makefile.arm64
+@@ -5,6 +5,11 @@
+ # Inline assembly doesn't interact well with LTO
+ fbt_arm.o_CFLAGS_ADD += $(CFLAGS_NOLTO_FLAG)
+
++# libdeflate's arm headers (bsd/miscfs/apfs/libdeflate) include the compiler's own <arm_acle.h>
++# and <arm_neon.h>, which the kernel's include paths do not have: they come after those paths,
++# so the kernel's <stdint.h> and the rest are still the ones found.
++apfs_deflate.o_CFLAGS_ADD += -idirafter $(shell $(CC) -print-resource-dir)/include
++
+ kern_csr.o_INCFLAGS += -I$(SRCROOT)/osfmk
+ kern_debug.o_INCFLAGS += -I$(SRCROOT)/osfmk
+
diff --git a/bsd/conf/files b/bsd/conf/files
- index 44274016a4cf..8cf6540f1a50 100644
-index 44274016a4cf..94a03cc34d2c 100644
++index 44274016a4cf..872767b197b8 100644
--- a/bsd/conf/files
+++ b/bsd/conf/files
- @@ -109,6 +109,34 @@ bsd/dev/munge.c optional config_requires_u32_munging
-@@ -109,6 +109,32 @@ bsd/dev/munge.c optional config_requires_u32_munging
++@@ -109,6 +109,35 @@ bsd/dev/munge.c optional config_requires_u32_munging
bsd/dev/unix_startup.c standard
bsd/dev/monotonic.c optional monotonic
@@@ -100,7 -82,7 +101,7 @@@
bsd/dev/dev_perfmon.c optional config_perfmon
bsd/libkern/crc32.c standard
- @@ -155,6 +183,14 @@ bsd/miscfs/devfs/devfs_vfsops.c optional devfs
-@@ -155,6 +181,10 @@ bsd/miscfs/devfs/devfs_vfsops.c optional devfs
++@@ -155,6 +184,14 @@ bsd/miscfs/devfs/devfs_vfsops.c optional devfs
bsd/miscfs/mockfs/mockfs_fsnode.c optional mockfs
bsd/miscfs/mockfs/mockfs_vfsops.c optional mockfs
bsd/miscfs/mockfs/mockfs_vnops.c optional mockfs
@@@ -115,7 -93,7 +116,7 @@@
bsd/miscfs/routefs/routefs_ops.c optional routefs
- @@ -361,6 +397,7 @@ bsd/security/audit/audit_syscalls.c standard
-@@ -361,6 +391,7 @@ bsd/security/audit/audit_syscalls.c standard
++@@ -361,6 +398,7 @@ bsd/security/audit/audit_syscalls.c standard
bsd/security/audit/audit_worker.c optional config_audit
bsd/pthread/pthread_shims.c standard
@@@ -123,7 -101,7 +124,7 @@@
bsd/pthread/pthread_priority.c standard
bsd/pthread/pthread_workqueue.c standard
- @@ -383,6 +420,7 @@ bsd/kern/kern_debug.c standard
-@@ -383,6 +414,7 @@ bsd/kern/kern_debug.c standard
++@@ -383,6 +421,7 @@ bsd/kern/kern_debug.c standard
bsd/kern/kern_symfile.c standard
bsd/kern/kern_descrip.c standard
bsd/kern/kern_guarded.c standard