From owner-svn-src-head@FreeBSD.ORG Wed Nov 26 18:01:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E797D1065677; Wed, 26 Nov 2008 18:01:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5C948FC16; Wed, 26 Nov 2008 18:01:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAQI1LHj062261; Wed, 26 Nov 2008 18:01:21 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAQI1LRp062260; Wed, 26 Nov 2008 18:01:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200811261801.mAQI1LRp062260@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 26 Nov 2008 18:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185339 - head/sys/boot/i386/boot0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2008 18:01:22 -0000 Author: luigi Date: Wed Nov 26 18:01:21 2008 New Revision: 185339 URL: http://svn.freebsd.org/changeset/base/185339 Log: 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. Modified: head/sys/boot/i386/boot0/boot0.S Modified: head/sys/boot/i386/boot0/boot0.S ============================================================================== --- head/sys/boot/i386/boot0/boot0.S Wed Nov 26 17:16:54 2008 (r185338) +++ head/sys/boot/i386/boot0/boot0.S Wed Nov 26 18:01:21 2008 (r185339) @@ -319,8 +319,9 @@ main.15: movw $LOAD,%bx # Address for 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 /*