The text of a manual · part 28 of 42
JANUS PSK for C/C++ Reference Manual, Version 2.1, pages 271 to 280
Pages 271 to 280 of 414
The original document is the PDF (690 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec J2020, Intermec J2010 and Intermec J2050
Page 271
Get PM Event
4
The 01H system Standby request notification informs the PM partner that the system BIOS wants to place the system in a Standby state. The system BIOS does not take any action at this time, but waits passively for the PM partner to call the system Standby function. The 02H system Suspend request notification informs the PM partner that the system BIOS wants to place the system into a Suspend state. The system BIOS does not actually perform a Suspend at this time, but waits passively for the partner to call the Suspend system function. A Resume system notification indicates that a critical system Suspend and Resume operation occurred without the cooperation of the PM partner. When a Suspend operation is scheduled to occur, the system BIOS normally notifies the partner through the Suspend system request, but does not actually perform the Suspend until the partner calls the Suspend system function. In some emergency situations the system BIOS needs to Suspend the system immediately. In this situation, the system BIOS informs the partner that the system has resumed from such a Suspend through a Resume system notification. The partner must recover from the Suspend as best it can. Critical Suspend situations include power on and off, low battery, dead battery, and battery interlock. The 05H battery low notification informs the PM partner that the system battery is running low. This call is available in both the APM INT 15H and protect mode interfaces.
4-29
Page 272
Get Power Status
Get Power Status Purpose:
This function returns the system current power status.
Call With:
AH =
53H
AL =
0AH
BX =
0001H
Return Value:
If the function is successful: Carry flag =
Clear
BH =
AC line status: 00H 0 indicates offline 01H 1 indicates online FFH 255 indicates unknown All other values reserved
BL =
Battery status: 00H 0 indicates high 01H 1 indicates low 02H 2 indicates critical 03H 3 indicates charging FFH 255 indicates unknown All other values reserved
CL =
Remaining battery life: 00H–64H Percent of full charge (0–100) in increments of 10 FFH 255 indicates unknown
If the function is unsuccessful:
Notes:
4-30
Carry flag =
Set
AH =
Unrecognized device ID
09H
This call is available in both the APM INT 15H and protect mode interfaces.
Page 273
Interface Connect
4
Interface Connect Purpose:
This function establishes the cooperative interface between the caller and the system BIOS. Before the interface is established, the system BIOS provides its own power management functionality as implemented by the OEM. Once the interface is connected, the system BIOS and the caller coordinate PM activities according to this specification.
Call With:
AH =
53H
AL =
01H
BX =
0000H
Return Value:
System BIOS
If the function is successful: Carry flag =
Clear
If the function is unsuccessful: Carry flag = AH =
Notes:
Set
Error code: 02H Interface connection is already in effect 09H Unrecognized device ID
This call is only available using the APM INT 15H interface.
4-31
Page 274
Interface Disconnect
Interface Disconnect Purpose:
This function breaks the cooperative interaction between the system BIOS and the caller, and in the process restores the system BIOS default functionality. Any protected mode connection set up by the protected mode 16-bit interface connect or protected mode 32-bit interface connect functions is also invalidated by this call. Even though this call returns control of power management strategy to the system BIOS, the parameter values (such as timer values and enable and disable settings) in effect at the time of the disconnect remain in effect.
Call With:
Return Value:
AH =
53H
AL =
04H
BX =
0000H System BIOS
If the function is successful: Carry flag =
Clear
If the function is unsuccessful: Carry flag = AH =
Notes:
4-32
Set
Error code: 03H Interface is not connected 09H Unrecognized device ID
This call is available in both the APM INT 15H and the protect mode interfaces.
Page 275
Protected Mode 16-Bit Interface Connect
4
Protected Mode 16-Bit Interface Connect Purpose:
This function initializes the optional 16-bit protected mode interface between the caller and the system BIOS. This interface allows a protected mode caller to invoke the system BIOS functions without the need to first switch into real or virtual-86 mode. A caller that does not operate in protected mode might not need to use this call. This function establishes a 16-bit protected mode interface, but you must invoke this function in either real or virtual-86 mode using the INT 15H interface.
Call With:
AH =
53H
AL =
02H
BX =
0000H System BIOS
Return Value:
If the function is successful: Carry flag =
Clear
AX =
PM 16-bit code segment (real mode segment base address)
BX =
Offset of entry point
CX =
PM 16-bit data segment (real mode segment base address)
If the function is unsuccessful: Carry flag = Set AH =
Notes:
Error code: 05H 16-bit protected mode interface already established 06H 16-bit protected mode interface not supported 09H Unrecognized device ID
The system BIOS 16-bit protected mode interface requires two consecutive selector and segment descriptors to use for a 16-bit code and data segment, respectively. The caller must initialize these descriptors using the segment base information returned by the BIOS.
4-33
Page 276
Protected Mode 16-Bit Interface Connect
The segment limit fields are set to 64K. These selectors can either be in the Global Descriptor Table (GDT) or Local Descriptor Table (LDT), but must be valid whenever the system BIOS is called in protected mode. The code segment descriptor must specify protection level 0, and must invoke the BIOS routines with CPL = 0 so they can execute privileged instructions. The caller invokes the system BIOS using the 16-bit interface by making a far call to the initialized code segment selector, with the offset returned in BX. The caller must supply a stack large enough for the BIOS and potential interrupt handlers to use. The caller’s stack is active when interrupts are enabled in the BIOS routine; the BIOS does not switch stacks when interrupts are enabled, including nonmaskable interrupts (NMI). The BIOS 16-bit interface requires a call using a 16-bit stack. When you call the system BIOS routines in protected mode, the current I/O permission bit map must permit access to any I/O ports that the BIOS might need. The system BIOS rejects additional 16-bit protected mode connections when a connection has already been established. This call is only available using the APM INT 15H interface.
4-34
Page 277
Protected Mode 32-Bit Interface Connect
4
Protected Mode 32-Bit Interface Connect Purpose:
This function initializes the optional 32-bit protected mode interface between the caller and the system BIOS. This interface invokes the system BIOS functions without needing to switch into real or virtual-86 mode first. A caller that does not operate in protected mode might not need to use this call. This function establishes a 32-bit protected mode interface, but must be invoked in either real or virtual-86 mode using the INT 15H interface.
Call With:
AH =
53H
AL =
03H
BX =
0000H System BIOS
Return Value:
If the function is successful: Carry flag =
Clear
AX =
PM 32-bit code segment (real mode segment base address)
BX =
Offset of entry point
CX =
PM 16-bit code segment (real mode segment base address)
DX =
PM data segment (real mode segment base address)
If the function is unsuccessful: Carry flag = AH =
Set
Error code: 07H 32-bit protected mode interface already established 08H 32-bit protected mode interface not supported 09H Unrecognized device ID
4-35
Page 278
Protected Mode 32-Bit Interface Connect
Notes:
The system BIOS 32-bit protected mode interface requires three consecutive selector/segment descriptors for use as 16- and 32-bit code and data segments, respectively. The system BIOS 32-bit interface needs both 16- and 32- bit code descriptors to call other BIOS routines in a 16-bit code segment if it becomes necessary. The caller must initialize these descriptors using the segment base information returned in the call from the BIOS. The segment limit fields are set to 64K. These selectors can be either in the GDT or LDT, but must be valid whenever the system BIOS is called in protected mode. The code segment descriptors must specify protection level 0, and must invoke the BIOS routines with CPL = 0 so that they can execute privileged instructions. The caller invokes the system BIOS using the 32-bit interface by making a far call to the initialized 32-bit code segment selector, with the offset returned in BX. The caller must supply a stack large enough for the BIOS and potential interrupt handlers to use. The caller stack is active when interrupts are enabled in the BIOS routine; the BIOS does not switch stacks when interrupts are enabled, including NMI interrupts. The BIOS 32-bit entry point requires a call using a 32-bit stack. When you call the system BIOS routines in protected mode, the current I/O permission bit map must permit access to the I/O ports the BIOS might need. The system BIOS rejects additional 32-bit protected mode connections if a 32-bit protected mode connection has already been established. This call is only available using the APM INT 15H interface.
4-36
Page 279
Restore System BIOS Power-On Defaults
4
Restore System BIOS Power-On Defaults Purpose:
This function directs the system BIOS to reinitialize all its power-on defaults.
Call With:
AH =
53H
AL =
09H
BX =
FFFFH
Return Value:
If the function is successful: Carry flag =
Clear
If the function is unsuccessful: Carry flag = AH = 09H Notes:
Set
Error code: Unrecognized device ID
This call is available in both the APM INT 15H and protect mode interfaces.
4-37
Page 280
Set Power State
Set Power State Purpose:
This function places the system or device specified in the power device ID into the requested state.
Call With:
AH =
53H
AL =
07H
BX =
Power device ID
CX =
System state ID 0000H Ready (Not supported for system device ID 0001H) 0001H Standby 0002H Suspend 0003H Off (Not supported for system device ID 0001H) 0004H–FFFFH Reserved
Return Value:
If the function is successful: Carry flag =
Clear
If the function is unsuccessful: Carry flag = AH =
Notes:
4-38
Set
Error code: 01H Power management functionality is disabled 09H Unrecognized device ID 0AH Parameter value in CX is out of range 60H Cannot enter the requested state
This call is available in both the APM INT 15H and protect mode interfaces.