From nobody@FreeBSD.org  Tue Jan 10 10:53:00 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 322EF1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Jan 2012 10:53:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 21AD78FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Jan 2012 10:53:00 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0AAqw4Z037325
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 10 Jan 2012 10:52:58 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0AAqwbh037321;
	Tue, 10 Jan 2012 10:52:58 GMT
	(envelope-from nobody)
Message-Id: <201201101052.q0AAqwbh037321@red.freebsd.org>
Date: Tue, 10 Jan 2012 10:52:58 GMT
From: Yaniv <ykamay@ccc.net.il>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Incorrect operand size in boot0
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163985
>Category:       kern
>Synopsis:       [boot0] Incorrect operand size in boot0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 10 11:00:31 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Jan 16 01:39:39 UTC 2012
>Originator:     Yaniv
>Release:        8.2
>Organization:
>Environment:
>Description:
In boot0.S, decw instruction is used on the drive number that was received
from the loader. boot0 push the loader dx value, at early stage, and restore
it later into ax

                popw %ax                        # Drive number
                subb $0x80-0x1,%al              # Does next
                cmpb NHRDRV,%al                 #  drive exist? (from BIOS?)
                jb print_drive                  # Yes
        /*
         * If this is the only drive, don't display it as an option.
         */
                decw %ax                        # Already drive 0?
                jz print_prompt                 # Yes

According to my knowledge, dh is undefined during the jump to boot0-start
so the result of "decw %ax" is undefined.

The result is that an incorrect boot option is displayed.

>How-To-Repeat:

>Fix:



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jan 16 01:39:01 UTC 2012 
Responsible-Changed-Why:  
possibly not i386-specific. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163985 
>Unformatted:
