1 ; ****************************************************************************
5 ; Copyright 2009 Sebastian Herbszt
9 ; This program is free software; you can redistribute it and/or modify
10 ; it under the terms of the GNU General Public License as published by
11 ; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
12 ; Boston MA 02111-1307, USA; either version 2 of the License, or
13 ; (at your option) any later version; incorporated herein by reference.
15 ; ****************************************************************************
28 mov ax,5300h ; APM Installation Check (00h)
29 xor bx,bx ; APM BIOS (0000h)
33 mov bx, msg_notpresent
37 cmp bx,504Dh ; signature 'PM'
40 mov bx, msg_notpresent
44 cmp ax,0101h ; Need version 1.1+
51 test cx,8 ; bit 3 APM BIOS Power Management disabled
54 mov bx, msg_pmdisabled
58 mov ax,5301h ; APM Real Mode Interface Connect (01h)
59 xor bx,bx ; APM BIOS (0000h)
67 mov ax,530Eh
; APM Driver Version (0Eh)
68 xor bx,bx ; APM BIOS (0000h)
69 mov cx,0101h ; APM Driver version 1.1
77 cmp cx,0101h ; APM Connection version
84 mov ax,5307h ; Set Power State (07h)
85 mov bx,0001h ; All devices power managed by the APM BIOS
86 mov cx,0003h ; Power state off
98 msg_notpresent: db 'APM not present.',0dh,0ah,0
99 msg_notsup: db 'APM 1.1+ not supported.',0dh,0ah,0
100 msg_pmdisabled: db 'Power management disabled.',0dh,0ah,0
101 msg_connect: db 'APM RM interface connect failed.',0dh,0ah,0
102 msg_failed: db 'Power off failed.',0dh,0ah,0