]> Zhao Yanbai Git Server - minix.git/commitdiff
both ack and gcc can compile klib16.S
authorTomas Hruby <tom@minix3.org>
Fri, 6 Aug 2010 12:46:44 +0000 (12:46 +0000)
committerTomas Hruby <tom@minix3.org>
Fri, 6 Aug 2010 12:46:44 +0000 (12:46 +0000)
kernel/arch/i386/Makefile.inc
kernel/arch/i386/klib16.S

index bf8b79daf43d8de2bcc9eeef53364256e018f7db..c496247c066e1f24fa65d3c9dcbaa9c3f8b1e6da 100644 (file)
@@ -32,8 +32,10 @@ SRCS+=       arch_do_vmctl.c \
        arch_watchdog.c \
        pre_init.c
 
+.if ${COMPILER_TYPE} == "ack"
 I86CPPFLAGS =  -mi86
 I86LDFLAGS =   -mi86
 
 CPPFLAGS.klib16.S =    ${I86CPPFLAGS}
 LDFLAGS.klib16.S  =    ${I86LDFLAGS}
+.endif
index eefd421601a4f15799106daca29f5fff093eabae..5c5574a7a54efc38d6ad3a6c72381d907541c496 100644 (file)
@@ -18,6 +18,7 @@
 .globl _poweroff16_end
 
 .text
+.code16
 
 /*===========================================================================*/
 /*                             poweroff16                                           */
@@ -27,7 +28,7 @@
 _poweroff16:
        /* Assume eax is already set to required value of cr0*/
 .byte  0x0F,0x22,0xC0  /* mov %cr0,%eax */
-       jmpf    $0,$(BIOS_POWEROFF_ENTRY + real_mode - _poweroff16)
+       ljmp    $0,$(BIOS_POWEROFF_ENTRY + real_mode - _poweroff16)
 real_mode:
        mov     $((BIOS_POWEROFF_ENTRY >> 4) + 0x200),%ax
        mov     %ax, %ds
@@ -40,34 +41,34 @@ real_mode:
 gate_A20:
        call    kb_wait
        movb    $0xD1,%al
-       outb    0x64
+       outb    $0x64
        call    kb_wait
        movb    $0xDD,%al
        orb             %ah,%al
-       outb    0x60
+       outb    $0x60
        call    kb_wait
        movb    $0xFF,%al
-       outb    0x64
+       outb    $0x64
        call    kb_wait
        
        /* Connect to APM */
        mov     $0x5301,%ax
        mov     $0x0,%bx
-       int     0x15
+       int     $0x15
        jc      apm_err
        
        /* Enable power management */
        mov     $0x5308,%ax
        mov     $0x1,%bx
        mov     $0x1,%cx
-       int     0x15
+       int     $0x15
        jc      apm_err
        
        /* Set power state to off */
        mov     $0x5307,%ax
        mov     $0x01,%bx
        mov     $0x3,%cx
-       int     0x15
+       int     $0x15
        jc      apm_err
 0:     hlt
        jmp     0b
@@ -93,7 +94,7 @@ apm_err:
        jmp     0b
        
 kb_wait:
-       inb     0x64
+       inb     $0x64
        testb   $0x02,%al
        jnz     kb_wait
        ret