From e1efa49a84eea8b42ec5d881adb8c574464dc6d4 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 24 May 2000 02:20:34 +0000 Subject: [PATCH] Convert the short stub of real-mode code into 16-bit assembly. --- sys/boot/i386/btx/btxldr/btxldr.S | 22 +++++++++++----------- sys/boot/i386/btx/btxldr/btxldr.s | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/boot/i386/btx/btxldr/btxldr.S b/sys/boot/i386/btx/btxldr/btxldr.S index a1f7ee8b7be..67a986c7673 100644 --- a/sys/boot/i386/btx/btxldr/btxldr.S +++ b/sys/boot/i386/btx/btxldr/btxldr.S @@ -234,24 +234,24 @@ ifdef(`BTXLDR_VERBOSE',` ') movl $start.8,%esi # Real mode stub movl $MEM_STUB,%edi # Destination - movl $SIZ_STUB,%ecx # Size + movl $start.9-start.8,%ecx # Size rep # Relocate movsb # it ljmp $SEL_RCODE,$MEM_STUB # To 16-bit code -start.8: xorl %eax,%eax # Data + .code16 +start.8: xorw %ax,%ax # Data movb $SEL_RDATA,%al # selector - movl %eax,%ss # Reload SS - movl %eax,%ds # Reset - movl %eax,%es # other - movl %eax,%fs # segment - movl %eax,%gs # limits + movw %ax,%ss # Reload SS + movw %ax,%ds # Reset + movw %ax,%es # other + movw %ax,%fs # segment + movw %ax,%gs # limits movl %cr0,%eax # Switch to - decl %eax # real + decw %ax # real movl %eax,%cr0 # mode - .byte 0xea # Jump to - .word MEM_ENTRY # BTX entry - .word 0x0 # point + ljmp $0,$MEM_ENTRY # Jump to BTX entry point start.9: + .code32 # # Output message [ESI] followed by EAX in hex. # diff --git a/sys/boot/i386/btx/btxldr/btxldr.s b/sys/boot/i386/btx/btxldr/btxldr.s index a1f7ee8b7be..67a986c7673 100644 --- a/sys/boot/i386/btx/btxldr/btxldr.s +++ b/sys/boot/i386/btx/btxldr/btxldr.s @@ -234,24 +234,24 @@ ifdef(`BTXLDR_VERBOSE',` ') movl $start.8,%esi # Real mode stub movl $MEM_STUB,%edi # Destination - movl $SIZ_STUB,%ecx # Size + movl $start.9-start.8,%ecx # Size rep # Relocate movsb # it ljmp $SEL_RCODE,$MEM_STUB # To 16-bit code -start.8: xorl %eax,%eax # Data + .code16 +start.8: xorw %ax,%ax # Data movb $SEL_RDATA,%al # selector - movl %eax,%ss # Reload SS - movl %eax,%ds # Reset - movl %eax,%es # other - movl %eax,%fs # segment - movl %eax,%gs # limits + movw %ax,%ss # Reload SS + movw %ax,%ds # Reset + movw %ax,%es # other + movw %ax,%fs # segment + movw %ax,%gs # limits movl %cr0,%eax # Switch to - decl %eax # real + decw %ax # real movl %eax,%cr0 # mode - .byte 0xea # Jump to - .word MEM_ENTRY # BTX entry - .word 0x0 # point + ljmp $0,$MEM_ENTRY # Jump to BTX entry point start.9: + .code32 # # Output message [ESI] followed by EAX in hex. #