Implemented "poweroff" to shutdown PC or QEMU with APM

This commit is contained in:
cas 2021-04-12 22:28:34 +02:00
parent c3d3da6771
commit 38c3914fc4
2 changed files with 11 additions and 2 deletions

View File

@ -18,7 +18,7 @@ floppy:
.PHONY: qemu
qemu:
qemu-system-i386 -curses -drive file=floppy.img,if=floppy,format=raw
qemu-system-i386 -curses -drive file=floppy.img,if=floppy,format=raw -monitor telnet:127.0.0.1:1234,server,nowait
.PHONY: clean
clean:

View File

@ -1522,7 +1522,16 @@ Target Forth also definitions
( ----- 114 )
( ----- 115 )
\ APM PC Shutdown - poweroff
CODE poweroff ( -- )
\ Connect to APM API
$5301 # A mov R R xor $15 int
\ Try to set APM version (to 1.2)
$530E # A mov R R xor $0102 # C mov $15 int
\ Turn off the system
$5307 # A mov $01 # R mov $03 # C mov $15 int
END-CODE
( ----- 116 )
\ BIOS keyboard input ks 16 sep 88