Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

kernel: iopmroot bridge driver -- IOPMrootDomain0 node and /dev/iopmroot user client for sleep request, acknowledgement and state

Abierto
#243 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
70/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
c

Línea de trabajo

Start by creating the three new files outlined in the design: the kernel driver src-overlay/sys/dev/iokit/iokit_pmroot.c, the ABI header src-overlay/sys/sys/iopmroot.h, and the config entry src-overlay/conf/files.iopmroot. Implement the IOPMrootDomain0 pseudo-device, /dev/iopmroot user client with the specified ioctl handlers, property publishing, and event subscriptions as described. Validate your work against the acceptance criteria: confirm the node appears in ioreg -c IOPMrootDomain, test the full sleep request/acknowledgement/S3/resume flow in QEMU, and verify that an error acknowledgement cancels sleep.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:power enhancement

Summary

The kernel half of "pmconfigd plays IOPMrootDomain". A new pseudo-driver publishes the node Apple's code looks for, and a character device stands in for RootDomainUserClient.

Design

New src-overlay/sys/dev/iokit/iokit_pmroot.c (~800-1000 LOC), src-overlay/sys/sys/iopmroot.h (ABI), src-overlay/conf/files.iopmroot -- all standard, no module.

  • Node: a newbus pseudo-device IOPMrootDomain0 (child of acpi0 on x86, of nexus0 elsewhere), so iokit_registry.c mints it an id with no registry changes and IOServiceMatching("IOPMrootDomain") matches by class name
  • /dev/iopmroot (root:operator 0660), one open per pmconfigd; the fd carries the K1 listener registration:
    • IOPMROOT_SLEEP{reason} -> records reason/PID, calls acpi_ReqSleepState(sc, suspend_sx)
    • IOPMROOT_ACK{serial, allow|errno} -> acpi_AckSleepState(sc->acpi_clone, ...); an error cancels (clears acpi_next_sstate)
    • IOPMROOT_GETSTATE (sleep supported, clamshell, AC, last sleep/wake reason), IOPMROOT_SETCLAMSHELLSLEEP, IOPMROOT_SETPROP (System Shutdown -> kern.suspend_blocked; SleepDisabled)
  • Subscribes: the K1 listener (Suspend), power_suspend_early (stamp sleep time / UUID), power_resume (wake), acpi_acad_event, acpi_sleep_event / acpi_wakeup_event, and the K3 hook for Lid, Button, CMBAT, Thermal
  • Publishes on the node (via K5): Last Sleep Reason, Wake Reason, Wake Type, AppleClamshellState, AppleClamshellCausesSleep, IOPMSystemSleepType = 2, IOSleepSupported (from hw.acpi.supported_sleep_state), Supported Features, SleepWakeUUID, System Capabilities
  • Emits (via K6): "sleep requested {serial, reason}", "did wake", kIOPMMessageClamshellStateChange, kIOPMMessageSystemPowerEventOccurred (thermal 0xcc)
  • Timestamps: kern.sleeptime / kern.waketime with xnu semantics, which pmconfigd and IOPMGetLastWakeTime read and FreeBSD lacks

The kernel mints the acknowledgement serial even in v1, so it already has its final meaning if R1 moves the fan-out into the kernel.

Acceptance

  • ioreg -c IOPMrootDomain shows the node and its properties
  • a sleep request -> listener message -> IOPMROOT_ACK -> S3 -> resume -> "did wake", in QEMU
  • IOPMROOT_ACK with an error cancels the sleep

K4 in epic nextbsd/nextbsd#490 (E17 Power management). Depends on: nextbsd/nextbsd-kernel#238 (K1), nextbsd/nextbsd-kernel#240 (K3), nextbsd/nextbsd-kernel#241 (K5), nextbsd/nextbsd-kernel#242 (K6).

Plan: https://pkgdemon.github.io/nextbsd-power-management-plan.html · Draft: https://pkgdemon.github.io/nextbsd-e17-tickets.html#k4

Lenguaje dominante
C
Estrellas
12
Forks
3
Merge medio
7 h 1 min
PR fusionados (30 d)
7

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextbsd/nextbsd-kernel

Todos los issues de nextbsd/nextbsd-kernel

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.