4 #include <minix/config.h>
5 #include <minix/const.h>
6 #include <machine/asm.h>
7 #include <machine/interrupt.h>
9 #include "kernel/const.h"
11 #include <machine/multiboot.h>
14 * This file contains a number of 16-bit assembly code utility routines needed by the
21 /*===========================================================================*/
23 /*===========================================================================*/
24 /* PUBLIC void poweroff16(); */
25 /* Power down system */
27 /* Assume eax is already set to required value of cr0*/
28 .byte 0x0F,0x22,0xC0 /* mov %cr0,%eax */
29 ljmp $0,$(BIOS_POWEROFF_ENTRY + real_mode - _C_LABEL(poweroff16))
31 mov $((BIOS_POWEROFF_ENTRY >> 4) + 0x200),%ax
58 /* Enable power management */
65 /* Set power state to off */
75 .ascii "You can poweroff the machine safely now"
77 #define POWEROFF_MSG_LEN (poweroff_msg_end-poweroff_msg)
79 /* If APM can't perform the shutdown, print something to inform */
80 mov $0x02, %ax /* clear screen */
83 mov $(BIOS_POWEROFF_ENTRY >> 4), %ax
87 mov $POWEROFF_MSG_LEN, %cx
89 mov $(poweroff_msg - _C_LABEL(poweroff16)), %bp
99 /*mark the end for copy*/
100 LABEL(poweroff16_end)