From nobody@FreeBSD.org  Thu Sep 30 17:46:33 2010
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 A1D34106575C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 30 Sep 2010 17:46:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 920D98FC23
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 30 Sep 2010 17:46:33 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8UHkXLI073563
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 30 Sep 2010 17:46:33 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o8UHkXKf073562;
	Thu, 30 Sep 2010 17:46:33 GMT
	(envelope-from nobody)
Message-Id: <201009301746.o8UHkXKf073562@www.freebsd.org>
Date: Thu, 30 Sep 2010 17:46:33 GMT
From: Renato <renato.camarao@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: BTX 1.02 crashes on boot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151122
>Category:       i386
>Synopsis:       [boot] BTX 1.02 crashes on boot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-i386
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 30 17:50:01 UTC 2010
>Closed-Date:    
>Last-Modified:  Fri Sep 27 19:40:00 UTC 2013
>Originator:     Renato
>Release:        Every Release that has BTX 1.02
>Organization:
Politec
>Environment:
HP Compaq 6005 Pro Microtower

- AMD Phenom II X4 Processor B93 (2.8 GHz, 8 MB total cache)
- Chipset AMD 785G
- Everything is SATA (CD-ROM and HD)
>Description:
I want to install FreeBSD on this machine (HP) and when I boot, it stops on message below:

Attempting Boot From CD-ROM
CD Loader 1.2

Building the boot loadar arguments
Looking up /BOOT/LOADER... found
Relocating the loader and the BTX
Starting the BTX loader
_
BTX loader 1.00  BTX version is 1.02

Note the cursos blinking upon the last phrase. Keyboard not answer my calls. I test too plugging a pendrive with FreeBSD without success, having the same results.
For suspects from chipset and SATA controllers, i've changed some settings on BIOS (SATA emulator: RAID, IDE Native, IDE "Legado" and SATA) and all of changes has the same result.
I've tested others FreeBSD (the LiveCD ones) and I make it boot, but the FreeBSD's version was 4.3 and I need the last one (8.1). I note that LiveCD's BTX version was 1.01. So I downloaded others old versions that has the same version and works too (every old FreeBSD's has the same BTX version 1.01).
I tried to mix the loader of the old boot to the new boot, without success. The message was "BTX halted". I think that is not the right way to do this.
>How-To-Repeat:
Just boot the newer versions of FreeBSD that has BTX loader 1.02 on HP Compaq 6005 Pro Microtower to view the message.
>Fix:
To fix the problem is study the case and fix. I'm not developer, so I can't help you.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-i386 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Oct 1 00:21:25 UTC 2010 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151122 

From: George Morgan <gm.swdev@gmail.com>
To: bug-followup@FreeBSD.org, renato.camarao@gmail.com
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Wed, 25 May 2011 17:43:03 -0400

 --0016e68dea50d887fe04a42096a9
 Content-Type: text/plain; charset=ISO-8859-1
 
 I have two of these systems.  Updated the system BIOS to the latest from HP
 and still no luck.  I'm a software developer and interested in at least
 helping troubleshoot this problem.
 
 George Morgan
 
 --0016e68dea50d887fe04a42096a9
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 I have two of these systems.=A0 Updated the system BIOS to the latest from =
 HP and still no luck.=A0 I&#39;m a software developer and interested in at =
 least helping troubleshoot this problem.<br><br>George Morgan<br><br><br>
 
 --0016e68dea50d887fe04a42096a9--

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org, renato.camarao@gmail.com,
	George Morgan <gm.swdev@gmail.com>
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Thu, 9 Jun 2011 13:02:14 +0200

 Hi,
 
 I'm also getting this problem on the same hardware.
 
 I compiled a loader binary with BTXLDR_VERBOSE defined.
 
 I have no experience with ASm programming, and know very little about PC
 booting process internals, so I don't know if I'll be able to do much
 better about this. I'll anyway keep looking.
 
 For now I'm sending the output from the verbose loader when trying
 to boot with a USB umass device just in case someone can understand
 something from this:
 
 --------
 Attempting Boot From USB Device
 _
 BTX loader 1.00 Starting in protected mode (base mem=9f800)
 Arguments passed (esp=9e78c):
 <howto=80000000 bootdev=a050001e junk=0 0 0 bootinfo=df34>
 Relocated bootinfo (size=48) to 9f7b8
 Relocated arguments (size=18) to 9f7a0
 BTX version is 1.02
 Relocated kernel (size=690) to 9000
 Client base address is a000
 Client format is ELF
 text segment: offset=1000 vaddr=0 filesz=2f8bc memsz=2f8bc
 data segment: offset=31000 vaddr=30000 filesz=5568 memsz=c7e0
 Loading complete
 ---------
 
 This is the screen just after locking up. The cursor at this point goes
 in the second line(where the _ is) and keeps blinking there.
 
 (the first line is oviously from the BIOS, but I included it for
 completeness)
 
 Thanks in advance for any help!
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org, renato.camarao@gmail.com
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Fri, 10 Jun 2011 11:57:48 +0200

 I performed some more testing following suggestions from John Baldwin.
 
 Inserting simple loops in btxldr (foo: jmp foo) made the system hang
 anyway, even when adding the loop as first statement in btxldr. It looks
 like something times out, but this is just a conjecture.
 
 I tested booting the kernel directly from boot2, bypassing loader, as
 described in boot(8) and got this erro from BTX:
 
 /
 FreeBSD/x86 boot
 Default: 0:ad(0,a)/boot/loader
 boot: 0:da(0,a)/boot/kernel/kernel-_
 int=00000006  err=00000000  efl=00010002  eip=23ec42c6
 eax=0018e070  ebx=00000000  ecx=00000000  edx=a0500004
 esi=ffff6000  edi=0018e070  ebp=000003fa  esp=00210608
 cs=0008  ds=0010  es=0010    fs=0010  gs=0010  ss=0010
 cs:eip=ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
        ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
 es:esp=d9 03 00 00 00 00 00 00-00 00 00 00 00 00 20 00
        40 00 60 00 8d 64 24 00-55 4e 44 49 16 1d 00 00
 BTX halted
 
 
 (-_ should be in the same spot. - is the spinning thing, _ is the
 cursor)
 
 After this I start thinking that real blame should go on boot2, loader
 being just a victim. I'm trying to figure out how boot2 works, but it's
 a whole new world to me.
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Mon, 13 Jun 2011 14:49:06 +0200

 More information I collected.
 
 I tested with old install CDs.
 
 7.0 and 6.3 do work.
 
 7.1 and 6.4 do show this problem.
 
 This is when BTX version bump to 1.02 was MFCed.
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Mon, 13 Jun 2011 15:57:25 +0200

 I started putting while(1) cycles through loader/main.c and found out
 the lockup happens in bios_getmem().
 
 One of the BIOS routines called from in there is causing problems.
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Mon, 13 Jun 2011 17:36:04 +0200

 After more debugging I discovered That lockup is happening in loader
 when calling bios_getmem().
 
 In there the system lockup just after calling BIOS int 0x15 function
 0xe820.
 
 This BIOS function is, I think, doing something nasty which locks up the system.
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Fri, 17 Jun 2011 16:46:39 +0200

 By disassembling the BIOS function mentioned above in this PC and
 another HP one on which FreeBSD hass no problems I could find one main
 difference.
 
 On the 8005Pro the BIOS works with the cr[034] and MSR control
 registers, while in another BIOS the function is performed without
 touching those.
 
 Reading the history of BTX in cvs I see the old BTX 1.01 used to emulate
 such accesses through exceptions, the new one gives full control to the
 BIOS so I'm quite lost on why there should be such a regression.
 
 I have the disassebled code which modifies the CRs if nyone should need
 to look at it. (Not sure about policies for posting such things on gnats
 so I play it safe)
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Guido Falsi <mad@madpilot.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Tue, 25 Oct 2011 15:37:42 +0200

 Just a quick followup to note the following:
 
 Problem still happens in 8.2 with a newer BIOS (1.15).
 
 Tested with 9.0-RC1(both with same BIOS as before(1.12) and the last
 one) and with this version of the system I get a reboot instead of a
 lockup. The point of lockup is the same, when calling BIOS int 0x15
 function 0xe820.
 
 As an additional reference the hang/reboot happens in file
 /usr/src/sys/boot/i386/libi386/biosmem.c, line 63.
 
 svn of /usr/src is 226679, revision of the mentioned file is 200219.
 
 -- 
 Guido Falsi <mad@madpilot.net>

From: Scott Mraz <scott.mraz@gmail.com>
To: bug-followup@FreeBSD.org, renato.camarao@gmail.com
Cc:  
Subject: Re: i386/151122: [boot] BTX 1.02 crashes on boot
Date: Fri, 27 Sep 2013 12:38:07 -0700

 --089e013c66da3634de04e762a039
 Content-Type: text/plain; charset=ISO-8859-1
 
 This still appears to be broken in 9.1, has anyone an update on a work
 around / resolution?
 
 
 -Scott
 
 --089e013c66da3634de04e762a039
 Content-Type: text/html; charset=ISO-8859-1
 
 <div dir="ltr"><p class="">This still appears to be broken in 9.1, has anyone an update
 on a work around / resolution?</p><p class=""><br></p><div>-Scott<br></div>
 </div>
 
 --089e013c66da3634de04e762a039--
>Unformatted:
