Von this Artikel über OSDev, können Sie entweder die ACPI oder die APM-Schnittstellen verwenden. ACPI scheint zu kompliziert, wie Sie in this article sehen können, während APM viel einfacher ist. Ich werde die grundlegenden Schritte berichten, wie sie erscheinen here:
1) Installation zu überprüfen, um zu sehen, ob APM unterstützt:
mov ah,53h ;this is an APM command
mov al,00h ;installation check command
xor bx,bx ;device id (0 = APM BIOS)
int 15h ;call the BIOS function through interrupt 15h
jc APM_error ;if the carry flag is set there was an error
;the function was successful
;AX = APM version number
;AH = Major revision number (in BCD format)
;AL = Minor revision number (also BCD format)
;BX = ASCII characters "P" (in BH) and "M" (in BL)
;CX = APM flags (see the official documentation for more details)
2) Trennen Sie an jede vorhandene Schnittstelle:
;disconnect from any APM interface
mov ah,53h ;this is an APM command
mov al,04h ;interface disconnect command
xor bx,bx ;device id (0 = APM BIOS)
int 15h ;call the BIOS function through interrupt 15h
jc .disconnect_error ;if the carry flag is set see what the fuss is about.
jmp .no_error
.disconnect_error: ;the error code is in ah.
cmp ah,03h ;if the error code is anything but 03h there was an error.
jne APM_error ;the error code 03h means that no interface was connected in the first place.
.no_error:
;the function was successful
;Nothing is returned.
3) Verbinden Sie sich mit der Real-Mode-Schnittstelle (01h):
;connect to an APM interface
mov ah,53h ;this is an APM command
mov al,[interface_number];see above description
xor bx,bx ;device id (0 = APM BIOS)
int 15h ;call the BIOS function through interrupt 15h
jc APM_error ;if the carry flag is set there was an error
;the function was successful
;The return values are different for each interface.
;The Real Mode Interface returns nothing.
;See the official documentation for the
;return values for the protected mode interfaces.
4) Aktivieren Sie die Energieverwaltung für alle Geräte: Schließlich
;Enable power management for all devices
mov ah,53h ;this is an APM command
mov al,08h ;Change the state of power management...
mov bx,0001h ;...on all devices to...
mov cx,0001h ;...power management on.
int 15h ;call the BIOS function through interrupt 15h
jc APM_error ;if the carry flag is set there was an error
5) gesetzt, die Leistungszustand aus (03h):
;Set the power state for all devices
mov ah,53h ;this is an APM command
mov al,07h ;Set the power state...
mov bx,0001h ;...on all devices to...
mov cx,[power_state] ;see above
int 15h ;call the BIOS function through interrupt 15h
jc APM_error ;if the carry flag is set there was an error
Ich denke, diese Frage könnte Ihnen helfen: http://stackoverflow.com/questions/3145569/how-to-Power-down-the-Computer-from-a-freistehende-Umgebung –