summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2008-11-26 18:01:21 +0000
committerluigi <luigi@FreeBSD.org>2008-11-26 18:01:21 +0000
commit6d7402ae81464d87de6c696eaaf85c0f1431cf37 (patch)
treebf2311eb9fd9e0cead6793d2ea50cda20c0e951b /sys/boot/i386
parentba4574257e2fc260473cd2ae011050d129e43cd0 (diff)
downloadFreeBSD-src-6d7402ae81464d87de6c696eaaf85c0f1431cf37.zip
FreeBSD-src-6d7402ae81464d87de6c696eaaf85c0f1431cf37.tar.gz
Pass the pointer to the selected partition in %si to the next stage
boot code. The bug was introduced in rev.1.13, and went unnoticed because FreeBSD's boot1 does not use it, but other systems might. (I have been struggling for almost a full day trying to figure out why a syslinux'ed partition would not boot when started with the FreeBSD /boot/boot0, only to realize that the bug was ours!) The space for the two extra bytes (push %si and pop %si) is reclaimed by removing an extra CRLF that is printed before booting. The bug is not a major one but if there is time it might be a good thing to merge it into the upcoming releases.
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/boot0/boot0.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/boot/i386/boot0/boot0.S b/sys/boot/i386/boot0/boot0.S
index 64be3dd..246372d 100644
--- a/sys/boot/i386/boot0/boot0.S
+++ b/sys/boot/i386/boot0/boot0.S
@@ -319,8 +319,9 @@ main.15: movw $LOAD,%bx # Address for read
jc main.10 # If error
cmpw $MAGIC,0x1fe(%bx) # Bootable?
jne main.10 # No
- movw $crlf,%si # Leave some
- callw puts # space
+ pushw %si # Save ptr to selected part.
+ callw puts # Leave some space
+ popw %si # Restore, next stage uses it
jmp *%bx # Invoke bootstrap
/*
OpenPOWER on IntegriCloud