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

Wi-Fi: a network joined from Settings with a finger

vcvkk497866c9d5f6
diff --git a/README.md b/README.md
index ca5829d..6a933c5 100644
--- a/README.md
+++ b/README.md
@@ -112,8 +112,9 @@ qemu/run-ios.sh 1200 -display gtk > logs/qemu.log # сеанс на 20 ми
сеть из файла подключается снова.
Выключатель Wi-Fi в Настройках выключает радио и включает его снова, и сеть из файла подключается опять.
У подключённой сети стоит галочка — и когда сеть подключило само ядро (при старте, после выключателя, после
- неверного пароля). Чтобы проверить подключение из Настроек пальцем, ядру дают
- `wifi_file=0`: тогда сеть из файла при старте не подключается, и радио ждёт выбора в Настройках. Без `WIFID=1`
+ неверного пароля). Подключение из Настроек пальцем проверено на телефоне: сеть выбрана, пароль набран на
+ экранной клавиатуре — галочка; неверный пароль — штатное сообщение iOS о неверном пароле. Чтобы радио при старте
+ ждало выбора в Настройках, а не подключало сеть из файла, ядру дают `wifi_file=0`. Без `WIFID=1`
Wi-Fi в Настройках по-прежнему «Выкл.». Чего нет ещё: WPA3, открытых сетей, каналов шире 20 МГц, экономии
энергии; скорость — около 15 Мбит/с.
- Несколько QEMU сразу: `QEMU_INSTANCE=1 qemu/run-ios.sh …` (у каждого номера свои порты; `touch.py`,
diff --git a/prebuilt/SHA256SUMS b/prebuilt/SHA256SUMS
index 8d130aa..b684c2b 100644
--- a/prebuilt/SHA256SUMS
+++ b/prebuilt/SHA256SUMS
@@ -1,6 +1,6 @@
-Built 2026-10-14 20:38 from this tree.
+Built 2026-10-14 20:51 from this tree.
-09231dbf122b9be00b55450a89827ef0042a7b52f5e3adc2872ccc6dfbc72485 prebuilt/mach.development.bcm2837
+351e89a9c0456a35daf1d567966dc002b665975cf6569e6742019de5344a9095 prebuilt/mach.development.bcm2837
1332a598d2dec00a1d8e930044e4f00a12ad44c6e5e50eecf4b7fe7fae803bf2 prebuilt/loader.efi
d2a35a4a1d6658ffb3696914f727661b52c9333de8a3af8a31642b8023ce03ac prebuilt/userland/child
1a413befd511384052e1962c1394adce20f718e1f2657ce63ab09828ebc4bd1b prebuilt/userland/cpu_test
diff --git a/prebuilt/mach.development.bcm2837 b/prebuilt/mach.development.bcm2837
index d10167f..8d06291 100755
Binary files a/prebuilt/mach.development.bcm2837 and b/prebuilt/mach.development.bcm2837 differ
diff --git a/xnu/files/bsd/dev/redwood_apple80211.c b/xnu/files/bsd/dev/redwood_apple80211.c
index 8ad60b4..e2674ee 100644
--- a/xnu/files/bsd/dev/redwood_apple80211.c
+++ b/xnu/files/bsd/dev/redwood_apple80211.c
@@ -292,29 +292,27 @@ get(struct apple80211req *request)
int error = 0;
switch (request->req_type) {
- case 43: { /* the driver's name: a version, a length, the text */
- static const char name[] = "redwood: ath11k for the WCN6750";
- struct {
- uint32_t version;
- uint16_t length;
- char text[256];
- } __attribute__((packed)) answer = { .version = 1, .length = sizeof(name) - 1 };
-
- memcpy(answer.text, name, sizeof(name));
- return give(request, &answer, sizeof(answer));
- }
- case 12: { /* what the card can do, a bit each (apple80211_var.h: APPLE80211_CAP_*) */
- struct {
- uint32_t version;
- uint8_t bits[9];
- } __attribute__((packed)) answer = { .version = 1 };
- static const uint8_t has[] = { 2, 3, 6, 9, 10, 14, 17, 19 }; /* AES, AES-CCM, power management, short slot
- * and preamble, WPA2, WME, short guard at 20 MHz */
+ case 43:
+ case 44: { /* the driver's and the hardware's name: the text alone, in 256 bytes */
+ static const char name[256] = "redwood: ath11k for the WCN6750";
+
+ return give(request, name, sizeof(name));
+ }
+ case 12: {
+ /*
+ * What the card can do, a bit each (apple80211_var.h: APPLE80211_CAP_*): the 13 bytes are the
+ * bits alone, from the first (the framework hands in a buffer that begins after the old
+ * header's version word). AES, AES-CCM, power management, short slot and preamble, WPA2, WME,
+ * short guard interval at 20 MHz. Read wrong, the framework sees no WPA2 and builds no join
+ * for a WPA2 network ("Unable to join").
+ */
+ uint8_t bits[13] = { 0 };
+ static const uint8_t has[] = { 2, 3, 6, 9, 10, 14, 17, 19 };
for (unsigned i = 0; i < sizeof(has); i++) {
- answer.bits[has[i] / 8] |= (uint8_t)(1u << (has[i] % 8));
+ bits[has[i] / 8] |= (uint8_t)(1u << (has[i] % 8));
}
- return give(request, &answer, sizeof(answer));
+ return give(request, bits, sizeof(bits));
}
case 19: { /* the radio's power: one radio. Until the driver is up it counts as on: it */
struct { /* is being brought up, and iOS asks this once, early */
@@ -696,6 +694,12 @@ note(const struct apple80211req *request, bool is_set, int error)
void
redwood_apple80211_summary(void)
{
+ static bool said;
+
+ if (said) {
+ return;
+ }
+ said = true;
for (unsigned i = 0; i < kind_count; i++) {
printf("apple80211: in this run: %s %d (%s) %u times, answered %u times%s", kinds[i].set ? "set" : "get", kinds[i].type,
type_name(kinds[i].type), kinds[i].times, kinds[i].answered, kinds[i].last_error == 0 ? "\n" : "");
diff --git a/xnu/files/bsd/dev/redwood_wifi.c b/xnu/files/bsd/dev/redwood_wifi.c
index 0890565..052f966 100644
--- a/xnu/files/bsd/dev/redwood_wifi.c
+++ b/xnu/files/bsd/dev/redwood_wifi.c
@@ -4059,6 +4059,7 @@ redwood_wifi_stop(void)
void
redwood_wifi_quiesce(void)
{
+ redwood_apple80211_summary(); /* (also when the run is ended from the phone: five fingers) */
if (!dsp_started || dirty) {
return;
}