From mini@d198-232.uoregon.edu  Thu Oct 30 13:44:33 1997
Received: from d198-232.uoregon.edu (d198-232.uoregon.edu [128.223.198.232])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id NAA13284
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 30 Oct 1997 13:44:32 -0800 (PST)
          (envelope-from mini@d198-232.uoregon.edu)
Received: (from mini@localhost)
	by d198-232.uoregon.edu (8.8.5/8.8.5) id NAA27542;
	Thu, 30 Oct 1997 13:44:17 -0800 (PST)
Message-Id: <199710302144.NAA27542@d198-232.uoregon.edu>
Date: Thu, 30 Oct 1997 13:44:17 -0800 (PST)
From: Jonathan Mini <mini@d198-232.uoregon.edu>
Reply-To: mini@d198-232.uoregon.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: usr.sbin/mksodsfs/bootcode.asm references wrong register.
X-Send-Pr-Version: 3.2

>Number:         4901
>Category:       bin
>Synopsis:       usr.sbin/mksodsfs/bootcode.asm references wrong register.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 30 13:50:01 PST 1997
>Closed-Date:    Fri Nov 7 01:22:00 MET 1997
>Last-Modified:  Fri Nov  7 01:22:32 MET 1997
>Originator:     Jonathan Mini
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
Ingenious Productions
>Environment:

3.0-981028-SNAP

>Description:

  usr.sbin/mkdosfs/bootcode.asm attempts to set ds to 0x0040, but misses and
sets dx. oops. bootcode.asm will set a random segment's offset 0x72 to 0x1234.

>How-To-Repeat:

 $ cvs co mkdosfs
 $ cd mkdosfs
 $ more bootcode.asm

 At line 90 he source will read :

        mov     ax, *0x40       ; write 0x1234 to address 0x472 --
        push    ax              ; tell the BIOS that this is a warm boot
        pop     dx
        mov     0x72, *0x1234
        jmpf    0xfff0,0xf000   ; jump to CPU initialization code

  note the 'pop dx'. Oops

>Fix:

 Apply this diff to usr.sbin/mkdosfs/bootcode.asm :

69c69
<       pop     dx
---
>       pop     ds
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->joerg 
Responsible-Changed-By: joerg 
Responsible-Changed-When: Mon Nov 3 08:49:22 MET 1997 
Responsible-Changed-Why:  
This seems to be my "oops". 
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Fri Nov 7 01:22:00 MET 1997 
State-Changed-Why:  

Fixed in rev 1.5 of bootcode.asm, thanks! 
>Unformatted:
