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

Loader: the gamut=p3 test switch holds for its own run only

vcvkke803bd480ae7
diff --git a/xnuloader/loader.c b/xnuloader/loader.c
index 3a0d27c..5542565 100644
--- a/xnuloader/loader.c
+++ b/xnuloader/loader.c
@@ -1737,6 +1737,8 @@ run_kernel(int have_checkpoint, uint64_t checkpoint)
int more_cores = 0, battery_requested = 0;
/* "torch=N" (not 0) there too: the phone's flashlight is the kernel's (bsd/dev/redwood_torch.c) */
int torch_requested = 0;
+ /* (the loader stays for run after run: what the last run's arguments said must not hold for this one) */
+ gamut_p3 = 0;
for (const char *c = pi.cmdline; *c; c++) {
if (starts_with(c, "bootcpu=") && (c == pi.cmdline || c[-1] == ' ') && c[8] >= '0' && c[8] <= '7') {
kernel_mpidr = (uint64_t)(c[8] - '0') << PLAT->core_shift;