Wildboar Technical Backgrounds

( This document is borrowed from old documentation. More info will be added here. )

Implementation of APM

To provide the power management support in BSD/OS, we needed to find a machine independent mechanism. After some experimentation, we determined that it is best to use the PM-BIOS 32-bit protected mode interface. PM-BIOS is implemented on most modern laptops, in a more or less standard way, thanks to Microsoft, which supplied a PM-BIOS specification.

The APM standard permits access to APM functionality from protected mode kernels. At boot time, the system must initialize the protected mode interface, by issuing an `int 15', function `0x53' (in AH). If this succeeds, the PM-BIOS returns the values necessary to access the PM-BIOS directly (more or less), from the running kernel. These correspond to addresses where the PM-BIOS code will be mapped into the system memory. The necessary information to reserve and map these memory regions into the kernel are saved and passed from the boot program to the kernel.

The kernel has to be modified to expect the additional boot-time parameters, and to extend the global descriptor table, which is used to map various things into the kernel address space. These memory regions are usually located in ROM (or it's shadow), or equivalent place, and these areas are already reserved as I/O memory area. In the approximately 20 different machines which were checked, very few returned a 32-bit interface address pointing to other than the I/O area. In the cases where the address was outside the I/O area, they return a pointer to the center of conventional memory for data segment value and on the entry to PM-BIOS, the ROM appears at the area, so there are no known fatal problems.