APM: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Roman (talk | contribs)
No edit summary
Line 81: Line 81:
;the function was successful
;the function was successful
;Nothing is returned.
;Nothing is returned.
</source>

=== Setting APM Driver Version ===
After an APM interface is connected, APM '''always''' runs as if it was version 1.0, to support legacy code. Unfortunately in that mode it isn't possible to do some things as setting the power state for all devices (as needed e.g. to shut the system down). So, if the APM installation check reports a version higher than 1.0, it might be useful to tell the APM that you support 1.1 or 1.2 version using INT 0x15 / AX=0x530E

<source lang="asm">
mov ah,53h ;this is an APM command
mov al,0eh ;set driver supported version command
mov bx,0000h ;device ID of system BIOS
mov ch,01h ;APM driver major version
mov cl,01h ;APM driver minor version (can be 01h or 02h if the latter one is supported)
int 15h
jc .version_error
;at this point AX holds the APM version that is connected, AH=major version AL=minor version
;so an additional check might be implemented
jmp .no_error
.version_error:
;ah can hold: 03h if the interface wasn't connected, 09h if the device ID wasn't recognised (BX nonzero), 0Bh if APM v1.1 still isn't engaged
.no_error:
;continue
</source>
</source>