APM(4)
π APM(4) β the i386 Kernel Interfaces Manual glow-up
ok so bestie, welcome to APM(4), straight out of the i386 Kernel Interfaces Manual β¨ this is the page for apm, and yeah she's a legacy queen but she still has lore. let's get into it π«Ά
β¨ NAME β¨
apm β APM BIOS interface π»β‘
π SYNOPSIS π
device apm
π DEPRECATION NOTICE π
ok so heads up: this driver is scheduled for removal prior to the release of FreeBSD 13.0. she's on her farewell tour, no cap. π
πΈ DESCRIPTION πΈ
apm is your interface to the Intel / Microsoft APM (Advanced Power Management) BIOS on laptop PCs. that's the vibe. it's giving "my battery is my whole personality." π
here's everything apm does for you, in order, because we love a numbered list:
- when the system wakes up from suspended mode,
apmadjusts the system clock to RTC. β°β¨ - when the system wakes up from suspended mode,
apmpasses a message tosyslogd(8)comprising of system wakeup time and elapsed time during suspended mode. she's a gossip, she tells on you. π apmslows the CPU clock when there are no system activities (runnable processes, interrupts, etc.). this function is available only on systems whose APM supports CPU idling. if yours doesn't, don't come for her. πapmexports an application interface as a character device. applications can control APM, or retrieve APM status information via this interface.apmexports the following interfaces. these symbols are defined in<machine/apm_bios.h>. πAPMIO_SUSPENDβ Suspend system. π΄APMIO_GETβ Get power management information. πAPMIO_ENABLE/APMIO_DISABLEβ Enable / Disable power management. πAPMIO_HALTCPU/APMIO_NOTHALTCPUβ Control execution of HLT in the kernel context switch routine. πAPMIO_GETPWSTATUSβ Get per battery information. ππ
okay so about those last two, the HLT ones, because this is where it gets real:
Some APM implementations execute the HLT (Halt CPU until an interrupt occurs) instruction in the "Idle CPU" call, while others do not. Thus enabling this may result in redundant HLT executions because "Idle CPU" is called from the kernel context switch routine that inherently executes HLT. This may reduce peak system performance.
Also the system hangs up if HLT instruction is disabled in the kernel context switch routine, and if the APM implementation of the machine does not execute HLT in "Idle CPU". On some implementations that do not support CPU clock slowdown, APM might not execute HLT.apmdisablesAPMIO_NOTHALTCPUoperation on such machines. π
The current version of apm does not call "Idle CPU" from the kernel context switch routine if clock slowdown is not supported, and it executes HLT instruction by default. Therefore, there is no need to use these two operations in most cases. periodt. π
these interfaces are used by apm(8). π
apmpolls APM events and handles the following events. here's the whole roster, bestie, nobody's getting cut:PMEV_STANDBYREQβ suspend system β standby requestPMEV_SUSPENDREQβ suspend system β suspend requestPMEV_USERSUSPENDREQβ suspend system β user suspend requestPMEV_CRITSUSPENDβ suspend system β critical suspend requestPMEV_NORMRESUMEβ resume system β normal resumePMEV_CRITRESUMEβ resume system β critical resumePMEV_STANDBYRESUMEβ resume system β standby resumePMEV_BATTERYLOWβ notify message β battery lowPMEV_UPDATETIMEβ adjust clock β update time
π¦ SEE ALSO π¦
π AUTHORS π
Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org> β thank you for your service, king π«‘
π₯ BUGS π₯
WARNING! Many, if not most, of the implementations of APM-bios in laptops today are buggy. You may be putting your LCD-display and batteries at a risk by using this interface. (The reason this is not a problem for MS-Windows is that they use the real-mode interface.) If you see any weird behavior from your system with this code in use, unplug the power and batteries ASAP, if not immediately, and disable this code.
like bestie that is not a drill, that is a whole fire emoji situation. π₯π
We are very interested in getting this code working, so please send your observations of any anomalous behavior to us. she's asking for feedback, respectfully. π
When apm is active, calling the BIOS setup routine by using hot-keys, may cause serious trouble when resuming the system. BIOS setup programs should be called during bootstrap, or from DOS. π
Some APM implementations cannot handle events such as pushing the power button or closing the cover. On such implementations, the system must be suspended only by using apm(8) or zzz(8). no improvising. π
βοΈ
Disk spin-down, LCD backlight control, and power on demand have not been supported on the current version. not yet, babes. π
and that's the whole page, bestie!! this one came from the <strong>Debian</strong> crew, dated <strong>November 1, 1994</strong>, and it's filed under <strong>APM(4)</strong>. vintage icon behavior. mwah πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms