summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386/boot0
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-08-04 22:37:21 +0000
committerjhb <jhb@FreeBSD.org>2000-08-04 22:37:21 +0000
commit7ec758080b907d46febe5826c1a9032b736c3427 (patch)
tree05c1606b6bf5bd2f45fc197b86eba8449ca6f685 /sys/boot/i386/boot0
parent55273123eeb5e5a10ca895a63a1893d544a7e131 (diff)
downloadFreeBSD-src-7ec758080b907d46febe5826c1a9032b736c3427.zip
FreeBSD-src-7ec758080b907d46febe5826c1a9032b736c3427.tar.gz
Argh! Fix a brainfart of mine. In the old boot0, we relocated ourself
to 0x600 via a 'rep movsw'. Once that was done, %cx was zero, so we could simply use 'movb' to update the lower byte of %cx in preparation for zeroing out the fake partition entry used to boot to other drives via F5. Well, in the new boot0, we don't actually relocate ourselves, instead it is easier to create the fake partition entry first and then just use it to get the BIOS to load all of boot0 into memory at 0x600. However, since we aren't doing the relocate code anymore, we don't know that %cx == 0 when we hit the 'movb' to setup %cx for clearning the fake partition entry. Thus, if %ch != 0 when the BIOS started boot0, then it would end up zeroing a lot more memory than just 8 words. The solution is to do a word move of $8 into %cx. Debugging help from: David Wolfskill <dhw@whistle.com>
Diffstat (limited to 'sys/boot/i386/boot0')
-rw-r--r--sys/boot/i386/boot0/boot0.s2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/i386/boot0/boot0.s b/sys/boot/i386/boot0/boot0.s
index 85ce25a..eccdd50 100644
--- a/sys/boot/i386/boot0/boot0.s
+++ b/sys/boot/i386/boot0/boot0.s
@@ -81,7 +81,7 @@ start: cld # String ops inc
#
movw $fake,%bp # Address variables
movw %bp,%di # %di used in stosw
- movb $0x8,%cl # Words to clear
+ movw $0x8,%cx # Words to clear
rep # Zero
stosw # them
incb -0xe(%di) # Sector number 1
OpenPOWER on IntegriCloud