Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

kernel: IOPMPowerSource nodes for ACPI batteries and AC, with Apple's power-source keys

Aperta
#244 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Start with BatteryTimeRemaining.m around _batteryChanged (roughly lines 790–870), then trace the existing acpi_battery.c unit conversions and the K3/K6 notification hooks. Implementing the ACPI-backed power-source nodes depends on issues #243 and #241; verify completion with ioreg -c IOPMPowerSource on a laptop and in QEMU, checking battery capacity/charge state and the AC-only source.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:power enhancement

Summary

pmconfigd finds batteries with IOServiceMatching("IOPMPowerSource") and re-reads every property on any general-interest message. It drops any battery lacking BatteryInstalled, CurrentCapacity or MaxCapacity (BatteryTimeRemaining.m _batteryChanged, ~790-870).

Design

Children of IOPMrootDomain0: IOPMPowerSource0..N, one per acpi_cmbat unit, plus one AC-only source when acpi_battery_get_units() == 0 (VMs, desktops). Properties read on demand through acpi_battery_get_battinfo / ACPI_BATT_GET_INFO / ACPI_BATT_GET_STATUS and acpi_acad_get_acline:

Apple key FreeBSD source
ExternalConnected acpi_acad_get_acline
BatteryInstalled not ACPI_BATT_STAT_NOT_PRESENT
IsCharging ACPI_BATT_STAT_CHARGING
CurrentCapacity / MaxCapacity / DesignCapacity bst.cap / bix.lfcap / bix.dcap (convert mAh x voltage when units are mA, as acpi_battery.c does)
TimeRemaining battinfo.min
Amperage / Voltage bst.rate / bst.volt
CycleCount bix.cycles
Manufacturer / Model / Serial bix.oeminfo / model / serial
AtWarnLevel / AtCriticalLevel cap <= wcap / lcap

acpi_cmbat's notify (0x80 status, 0x81 info) is the push signal; it arrives through the K3 hook and becomes kIOPMMessageBatteryStatusHasChanged on the node (K6).

Acceptance

  • on a laptop, ioreg -c IOPMPowerSource shows real capacity and charge state
  • in QEMU, a single AC-only source appears

K7 in epic nextbsd/nextbsd#490 (E17 Power management). Depends on: nextbsd/nextbsd-kernel#243 (K4), nextbsd/nextbsd-kernel#241 (K5).

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

Lingua principale
C
Stelle
12
Fork
3
Merge medio
7h 1m
PR unite (30g)
7

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nextbsd/nextbsd-kernel

Tutte le issue di nextbsd/nextbsd-kernel

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.