Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,8 @@ Fetched at build time, never committed:
His patches under tools/mesa/panvk/ change Mesa (MIT) and those under tools/metal/m2v/ change metal2vulkan
(GPL-2.0-or-later OR LGPL-3.0-or-later), each under the licence of the code it changes, as their headers say.
- Nils (github.com/dwaris): his commits to this repository, from 12 November 2026 (drivers/audio/abox/hakios.exynos_abox.c,
drivers/audio/codec/hakios.max98512.c), under the licence of the files they change.
drivers/audio/codec/hakios.max98512.c; from 18 November also drivers/camera/exynos/hakios.exynos_camera_star2.c,
userland/src/camera_device.c and userland/src/inject_media.c), under the licence of the files they change.
- deLiseLINO (github.com/deLiseLINO): his commits to this repository, from 18 November 2026 (avf/shim/avfboot.c,
avf/shim/start.S, userland/src/eagl.c, drivers/virtio/hakios.virtio_net.c, avf/scion/avf.properties), under the licence
of the files they change.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,14 @@ from your own device.
- **Nils** ([@dwaris](https://github.com/dwaris)), a Galaxy S9+ owner and one of the installer's testers. Two fixes for the
speakers found on his own phone: the first sound no longer lost when the stream starts before the amplifiers' driver has
registered, and the MAX98512's enable given a moment before it is read back, with a pause between a bus transfer's
retries. His commits are in the history under his name. Thank you, Nils.
retries. Then four for the S9+'s cameras: the S5K3M3 telephoto's two virtual channels told apart so its frames are
real, the telephoto's availability read again after a failure, and the capture graph's audio ended cleanly when the
camera is switched (end-of-stream markers sent, late samples and stale notifications dropped). His commits are in the
history under his name. Thank you, Nils.
- **deLiseLINO** ([@deLiseLINO](https://github.com/deLiseLINO)), who runs Scion in AVF on a Pixel 7: the boot hang there
found and fixed (FP/SIMD turned on before the jump to XNU), CoreAnimation's masks drawn on the Mali-G710 (GLSL ES 1.00
extension lines dropped from ES 3.00 shaders), and the guest's network as a stream on the virtio socket device, served by
libslirp in the Scion app (`virtio_net_vsock=PORT`). His commits are in the history under his name. Thank you.

## Licenses and the legal side

Expand Down
6 changes: 3 additions & 3 deletions avf/scion/avf.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ disk.0=system.apfs
# gl=1: CoreAnimation draws through OpenGL ES on the phone's GPU (userland/src/eagl.c over gfx,
# gfxstream through /dev/vgpu3d), which needs a GPU below (gpu=scgpu or gpu=gfxstream). Without gl=1 it draws in
# software.
# virtio_net_wifi=1: with Scion's "Network" setting on, AVF adds a virtio-net card (Android's VM
# tethering behind it) and iOS sees it as Wi-Fi, joined to the open network "Scion"
# (bsd/dev/hakios.virtio_net.c). Without the setting there is no card and it does nothing.
# virtio_net_wifi=1: with Scion's "Network" setting on, the app adds virtio_net_vsock=PORT and serves
# the guest's en0 over a virtio socket stream (libslirp in the app), and iOS sees it as Wi-Fi, joined
# to the open network "Scion" (bsd/dev/hakios.virtio_net.c). Without the setting there is no link.
params=md0=rvblk0 cpus=8 gl=1 virtio_net_wifi=1
memory_mib=4096
cpus=host
Expand Down
11 changes: 11 additions & 0 deletions avf/shim/avfboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,17 @@ void avfboot_main(uint64_t fdt_pa)
uart_puts("\n\n");

stage = "xnu";
/*
* FP/SIMD on before the kernel runs, on whichever core it starts (here or in avfboot_hop).
* XNU's start.s turns it on itself (CPACR_EL1.FPEN in common_start, MMU on), and its first FP
* instruction (cpu_data_init(), from arm_init()) should then run. On the Pixel 7 (pKVM)
* it took an "FP/SIMD access trapped" exception instead (ESR 0x1fe00000) with CPACR_EL1
* reading 0x300000 in the vector. With no thread pointer yet, sleh_synchronous() faulted on it,
* and so on until the exception stack ran into the interrupt stack: the vCPU spun at 100%,
* nothing on the console. Half the boots at first, all of them later the same day. With FPEN
* set here, before the jump, the same kernel boots every time.
*/
__asm__ volatile("msr cpacr_el1, %0" : : "r"(3ULL << 20));
__asm__ volatile("dsb sy; ic iallu; dsb sy; isb" ::: "memory");
if (m.mpidr[0] != m.self) {
/* the kernel starts on the big core (see "fdt: cpus"); this one switches itself off */
Expand Down
4 changes: 3 additions & 1 deletion avf/shim/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ _start:
/*
* A core started with PSCI CPU_ON (avfboot_main hands the kernel to the biggest core): EL1,
* MMU and caches off like the boot core. Jumps to hop_entry with x0 = hop_arg, as the boot
* core would have.
* core would have, with FP/SIMD on (CPACR_EL1.FPEN: see the jump at the end of avfboot_main).
*/
.globl avfboot_hop
avfboot_hop:
msr daifset, #0xf
mov x1, #(3 << 20) /* CPACR_EL1.FPEN: no traps at EL1 or EL0 */
msr cpacr_el1, x1
adrp x1, hop_entry
ldr x1, [x1, :lo12:hop_entry]
adrp x0, hop_arg
Expand Down
1 change: 1 addition & 0 deletions configs/boot-args.lst
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ virtio_input k
virtio_mmio k
virtio_net k
virtio_net_ssid k
virtio_net_vsock k
virtio_net_wifi k
virtio_poll k
virtio_sound k
Expand Down
9 changes: 6 additions & 3 deletions configs/common_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# HakiOS common defconfig: every setting there is, with what it does.
# Made by tools/hakios-config.py listing common -o <this file>; the values are the ones that file sets, and tests/CI check that it names every symbol.
#
# 765 symbols in 20 groups; 54 are set, 45 of them drivers built in.
# 766 symbols in 20 groups; 54 are set, 45 of them drivers built in.
#

#
Expand Down Expand Up @@ -181,7 +181,7 @@ CONFIG_HAKIOS_VIRTIO_SOUND=y
# QEMU's virtio tablet and keyboard as the touch screen and the buttons (virtio_input=1). QEMU only [hakios.virtio_input.c]
CONFIG_HAKIOS_VIRTIO_INPUT=y

# QEMU's virtio network device as the link behind en0 (virtio_net=1). QEMU only [hakios.virtio_net.c; requires CONFIG_HAKIOS_WIFI_STA]
# QEMU's virtio network device as the link behind en0 (virtio_net=1), or on AVF a stream to the Scion app on the ... [hakios.virtio_net.c; requires CONFIG_HAKIOS_WIFI_STA]
CONFIG_HAKIOS_VIRTIO_NET=y

# a disk image of the host as /dev/rvblk0 (virtio_blk=1). QEMU only [hakios.virtio_blk.c]
Expand Down Expand Up @@ -1590,7 +1590,7 @@ CONFIG_MODEM_AGAIN=y
# CONFIG_TMU_UNGATE is not set

#
# Network (5)
# Network (6)
#

# a log line for each of the first N frames on the network interfaces
Expand All @@ -1605,6 +1605,9 @@ CONFIG_MODEM_AGAIN=y
# read by hakios.virtio_net.c (kernel)
# CONFIG_VIRTIO_NET_SSID is not set

# read by hakios.virtio_net.c (kernel)
# CONFIG_VIRTIO_NET_VSOCK is not set

# iOS is told that en0 is a radio, the way the phone's is (hakios.net.c, hakios.wlan.cpp, hakios.apple80211.c), and a ...
# CONFIG_VIRTIO_NET_WIFI is not set

Expand Down
1 change: 1 addition & 0 deletions configs/symbols.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ VIRTIO_CONSOLE arg virtio_console User space k hakios.virtio_console.c none. Wit
VIRTIO_INPUT arg virtio_input Touch and buttons k hakios.virtio_input.c
VIRTIO_MMIO arg virtio_mmio User space k hakios.virtio.c
VIRTIO_NET_SSID arg virtio_net_ssid Network k hakios.virtio_net.c
VIRTIO_NET_VSOCK arg virtio_net_vsock Network k hakios.virtio_net.c
VIRTIO_NET_WIFI arg virtio_net_wifi Network k hakios.virtio_net.c iOS is told that en0 is a radio, the way the phone's is (hakios.net.c, hakios.wlan.cpp, hakios.apple80211.c), and a station of this file's stands
VIRTIO_POLL arg virtio_poll User space k hakios.virtio.c
VIRTIO_SOUND arg virtio_sound Audio and battery k hakios.virtio_sound.c
Expand Down
5 changes: 3 additions & 2 deletions docs/boot-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Made by `tools/boot-args.py --markdown`; CI fails if it is out of date with the source (`tools/boot-args.py --check`).

Every argument that the kernel, the loader or user space of this port reads, and which file reads it. **707 arguments**: 615 read by the kernel, 24 by the loader, 85 by user space (one is read in more than one place).
Every argument that the kernel, the loader or user space of this port reads, and which file reads it. **708 arguments**: 616 read by the kernel, 24 by the loader, 85 by user space (one is read in more than one place).

This is a catalogue of what exists and who reads it, not a manual. What an argument means is in the head of the file that reads it. The stable switches have a symbol in the configuration (`tools/hakios-config.py help SYMBOL`, `docs/configs.md`); the rest are the knobs of bring-up (a driver's steps, pauses, traces, test modes) and can change with the driver. Any of them can be given in a configuration with `CONFIG_BOOTARGS="name=value ..."`, which checks that each name is in this list. What the arguments of the two Metal paths do: [Metal on the Adreno](reference/metal.md#boot-arguments).

Expand Down Expand Up @@ -477,14 +477,15 @@ Layers: **K** the kernel, **L** the loader, **U** user space (through `sysctl ke
| `virtio_blk` | K | `hakios.virtio_blk.c` | `CONFIG_VIRTIO_BLK` | |
| `virtio_blk_rw` | K | `hakios.virtio_blk.c` | `CONFIG_VIRTIO_BLK_RW` | |

## Network (5)
## Network (6)

| Argument | Layer | Read by | Configuration | Set by |
|---|---|---|---|---|
| `net_names` | K | `hakios.net.c` | `CONFIG_NET_NAMES` | |
| `net_trace` | K | `hakios.net.c` | `CONFIG_NET_TRACE` | |
| `virtio_net` | K | `hakios.virtio_net.c` | `CONFIG_VIRTIO_NET` | |
| `virtio_net_ssid` | K | `hakios.virtio_net.c` | `CONFIG_VIRTIO_NET_SSID` | |
| `virtio_net_vsock` | K | `hakios.virtio_net.c` | `CONFIG_VIRTIO_NET_VSOCK` | |
| `virtio_net_wifi` | K | `hakios.virtio_net.c` | `CONFIG_VIRTIO_NET_WIFI` | |

## USB (10)
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Every driver the kernel can be built with. `CONFIG_HAKIOS_<NAME>=y` in a defconf
|---|---|---|---|---|---|---|---|---|---|---|
| **`HAKIOS_VIRTIO_SOUND`**<br>QEMU's virtio sound device as the player of /dev/hakios-audio (virtio_sound=1). QEMU only | `hakios.virtio_sound.c` | | `virtio_sound=` | | | | built | built | | | |
| **`HAKIOS_VIRTIO_INPUT`**<br>QEMU's virtio tablet and keyboard as the touch screen and the buttons (virtio_input=1). QEMU only | `hakios.virtio_input.c` | | `virtio_input=` | | | | built | built | | | |
| **`HAKIOS_VIRTIO_NET`**<br>QEMU's virtio network device as the link behind en0 (virtio_net=1). QEMU only | `hakios.virtio_net.c` | `HAKIOS_WIFI_STA` | `virtio_net=`, `virtio_net_ssid=`, `virtio_net_wifi=` | | | | built | built | | | |
| **`HAKIOS_VIRTIO_NET`**<br>QEMU's virtio network device as the link behind en0 (virtio_net=1), or on AVF a stream to the Scion app on the virtio socket device (virtio_net_vsock=PORT) | `hakios.virtio_net.c` | `HAKIOS_WIFI_STA` | `virtio_net=`, `virtio_net_ssid=`, `virtio_net_vsock=`, `virtio_net_wifi=` | | | | built | built | | | |
| **`HAKIOS_VIRTIO_BLK`**<br>a disk image of the host as /dev/rvblk0 (virtio_blk=1). QEMU only | `hakios.virtio_blk.c` | | `virtio_blk=`, `virtio_blk_rw=` | | | | built | built | | | |

## wifi
Expand Down
3 changes: 2 additions & 1 deletion drivers/camera/exynos/hakios.exynos_camera_star2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,8 @@ paths_init(void)
.name = "the telephoto camera (S5K3M3 on CSIS2)", .sensor = TELE_SENSOR, .bus = &tele_bus, .addr = &tele_addr,
.csis_pa = TELE_CSIS_PA, .phy_pa = TELE_PHY_PA, .wdma_pa = TELE_WDMA_PA, .phy_size = 0x4000, .phy_off = 0x1400,
.iso_off = TELE_ISO, .reset_bit = 1, .iso_shared = false, .bias = false,
.lanes = 4, .settle = TELE_SETTLE, .interleave = 0, .w = 2016, .h = 1512, .slot_bytes = 6u << 20,
/* CSI_MODE_VC_ONLY is 2: VC0 carries pixels and VC1 carries the PDAF tail. */
.lanes = 4, .settle = TELE_SETTLE, .interleave = 2, .w = 2016, .h = 1512, .slot_bytes = 6u << 20,
.mode_lines = S3M3_MODE_LINES, .margin = TELE_MARGIN, .line_ns = S3M3_MODE_LINE_NS, .bayer = 1, .turn = false,
.exp = 1000, .gain = 0x80,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/virtio/conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ driver VIRTIO_INPUT
driver VIRTIO_NET
file bsd/dev/hakios.virtio_net.c
requires WIFI_STA
help QEMU's virtio network device as the link behind en0 (virtio_net=1). QEMU only
help QEMU's virtio network device as the link behind en0 (virtio_net=1), or on AVF a stream to the Scion app on the virtio socket device (virtio_net_vsock=PORT)

driver VIRTIO_BLK
file bsd/dev/hakios.virtio_blk.c
Expand Down
Loading
Loading