summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-08-05 06:00:05 +0000
committerkan <kan@FreeBSD.org>2004-08-05 06:00:05 +0000
commitcd532d497e6014f748d96fb760671ebe7845db63 (patch)
tree8a78bedca80a28bbd3abeeedda74457d086981f3 /sys/boot
parentf9ad017b23bc8459fa42bbbfac37322d1538153e (diff)
downloadFreeBSD-src-cd532d497e6014f748d96fb760671ebe7845db63.zip
FreeBSD-src-cd532d497e6014f748d96fb760671ebe7845db63.tar.gz
Move boot2 BSS zeroing into btx startup code out of boot1. boot1 does not
have clear idea on boot2 BSS size and leaves portion of it not zeroed out. btxcsu.s is in much better position for this job. Obtained from: DragonflyBSD (with minor adjustments)
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/boot2/boot1.S4
-rw-r--r--sys/boot/i386/btx/lib/btxcsu.s10
2 files changed, 9 insertions, 5 deletions
diff --git a/sys/boot/i386/boot2/boot1.S b/sys/boot/i386/boot2/boot1.S
index 44af56b..5b0f6f7 100644
--- a/sys/boot/i386/boot2/boot1.S
+++ b/sys/boot/i386/boot2/boot1.S
@@ -193,10 +193,6 @@ main.5: mov %dx,MEM_ARG # Save args
sub %si,%cx # count
rep # Relocate
movsb # client
- sub %di,%cx # Byte count
- xorb %al,%al # Zero assumed bss from
- rep # the end of boot2.bin
- stosb # up to 0x10000
/*
* Enable A20 so we can access memory above 1 meg.
diff --git a/sys/boot/i386/btx/lib/btxcsu.s b/sys/boot/i386/btx/lib/btxcsu.s
index f08ae75..6a00659 100644
--- a/sys/boot/i386/btx/lib/btxcsu.s
+++ b/sys/boot/i386/btx/lib/btxcsu.s
@@ -30,7 +30,15 @@
#
# Client entry point.
#
-_start: movl %eax,__base # Set base address
+_start: cld
+ pushl %eax
+ movl $_edata,%edi
+ movl $_end,%ecx
+ subl %edi, %ecx
+ xorb %al, %al
+ rep
+ stosb
+ popl __base
movl %esp,%eax # Set
addl $ARGADJ,%eax # argument
movl %eax,__args # pointer
OpenPOWER on IntegriCloud