From ffdb12bc9b4d82e8e27890bde1bc2d65d67525fd Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Tue, 8 Jan 2013 15:12:37 +0000 Subject: [PATCH] Drop obsolete klib16.S The 16-bit poweroff16() function is not called any more. --- kernel/arch/i386/Makefile.inc | 2 +- kernel/arch/i386/klib16.S | 100 ---------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 kernel/arch/i386/klib16.S diff --git a/kernel/arch/i386/Makefile.inc b/kernel/arch/i386/Makefile.inc index a9dc907ec..b4ca69ddf 100644 --- a/kernel/arch/i386/Makefile.inc +++ b/kernel/arch/i386/Makefile.inc @@ -34,7 +34,7 @@ CLEANFILES+= $(ORIG_UNPAGED_OBJS) SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \ do_iopenable.c do_readbios.c do_sdevio.c exception.c i8259.c io_inb.S \ - io_inl.S io_intr.S io_inw.S io_outb.S io_outl.S io_outw.S klib.S klib16.S memory.c \ + io_inl.S io_intr.S io_inw.S io_outb.S io_outl.S io_outw.S klib.S memory.c \ oxpcie.c protect.c direct_tty_utils.c arch_reset.c \ pg_utils.c usermapped_glo_ipc.S usermapped_data_arch.c diff --git a/kernel/arch/i386/klib16.S b/kernel/arch/i386/klib16.S deleted file mode 100644 index 36a0683cc..000000000 --- a/kernel/arch/i386/klib16.S +++ /dev/null @@ -1,100 +0,0 @@ -/* sections */ - - -#include -#include -#include -#include -#include "archconst.h" -#include "kernel/const.h" -#include "sconst.h" -#include - -/* - * This file contains a number of 16-bit assembly code utility routines needed by the - * kernel. - */ - -.text -.code16 - -/*===========================================================================*/ -/* poweroff16 */ -/*===========================================================================*/ -/* PUBLIC void poweroff16(); */ -/* Power down system */ -ENTRY(poweroff16) - /* Assume eax is already set to required value of cr0*/ -.byte 0x0F,0x22,0xC0 /* mov %cr0,%eax */ - ljmp $0,$(BIOS_POWEROFF_ENTRY + real_mode - _C_LABEL(poweroff16)) -real_mode: - mov $((BIOS_POWEROFF_ENTRY >> 4) + 0x200),%ax - mov %ax, %ds - mov %ax, %es - mov %ax, %ss - mov $0x1000, %sp - - xorb %ah, %ah -/* Close gate A20 */ -gate_A20: - call kb_wait - movb $0xD1,%al - outb $0x64 - call kb_wait - movb $0xDD,%al - orb %ah,%al - outb $0x60 - call kb_wait - movb $0xFF,%al - outb $0x64 - call kb_wait - - /* Connect to APM */ - mov $0x5301,%ax - mov $0x0,%bx - int $0x15 - jc apm_err - - /* Enable power management */ - mov $0x5308,%ax - mov $0x1,%bx - mov $0x1,%cx - int $0x15 - jc apm_err - - /* Set power state to off */ - mov $0x5307,%ax - mov $0x01,%bx - mov $0x3,%cx - int $0x15 - jc apm_err -0: hlt - jmp 0b - -poweroff_msg: -.ascii "You can poweroff the machine safely now" -poweroff_msg_end: -#define POWEROFF_MSG_LEN (poweroff_msg_end-poweroff_msg) -apm_err: - /* If APM can't perform the shutdown, print something to inform */ - mov $0x02, %ax /* clear screen */ - int $0x10 - - mov $(BIOS_POWEROFF_ENTRY >> 4), %ax - mov %ax, %es - mov $0x1301, %ax - mov $0x07, %bx - mov $POWEROFF_MSG_LEN, %cx - mov $0x0300, %dx - mov $(poweroff_msg - _C_LABEL(poweroff16)), %bp - int $0x10 -0: hlt - jmp 0b - -kb_wait: - inb $0x64 - testb $0x02,%al - jnz kb_wait - ret -/*mark the end for copy*/ -LABEL(poweroff16_end) -- 2.44.0