Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2011 13:13:07 +0200
From:      Guido Falsi <mad@madpilot.net>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: BTX loader problem on specific hardware
Message-ID:  <20110610111307.GD76732@megatron.madpilot.net>
In-Reply-To: <201106091543.16028.jhb@freebsd.org>
References:  <20110609152820.GC57263@megatron.madpilot.net> <201106091543.16028.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 09, 2011 at 03:43:15PM -0400, John Baldwin wrote:
> On Thursday, June 09, 2011 11:28:20 am Guido Falsi wrote:
> > 
> > I'm having a problem with BTX hanging on an HP 6005 Pro PC.
> > 
> > I have filed a followup to an existing PR about this exact problem:
> > 
> > http://www.freebsd.org/cgi/query-pr.cgi?pr=151122
> > 
> 
> Hmm, these are not so easy to debug.  You can try putting a 'foo: jmp foo'

Thank you for your reply! I have something to try now, at least :P

I really see the difficulty in this kind of debugging. It's something
I'd really like to help solve, if possible.

I forgot to mention that I fear the blame goes to the machine BIOS, and
the FreeBSD boot loaders are just victims.

> instruction in various places as a sort of 'while (1)' loop.  The first test I 
> would do is to put it earlier in btxld before the messages that BTXLDR_VERBOSE 
> logs to see if when it hangs the cursor stays at its current location rather 
> than jumping back up.  If that works out then you can start moving the 'foo: 
> jmp foo' later until you find a point where it hangs and moves the cursor 
> (which means it hung in between your previous 'jmp foo' and the one you most 
> recently added).  I would start by walking down through btxldr.S.  If it makes 
> it all the way through that, start walking through the BTX init code.

Unluckily it did not work this well. Wherever I put the loop in btxldr
makes the cursor go to the top and stay there, the machine hanging.(num
lock not reacting too)

This happens even if the loop is the first statement, but I observed a
small delay from when the code reaches the loop and the hang. It looks
like something times out.

Considering what I write below I have a theory about boot2 leaving
something in an incorrect state for whatever stage comes next.

> 
> Oddly enough, BTX had to run at least once so that boot2 could find the loader 
> and kick off the btxldr.S.

I experimented with boot2 too. I tried to make boot2 load the kernel
directly (as described in boot(8)) and got this error 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


(the -_ after kernel are the spinner and the cursor, which really are in
the same place)

This makes me think that it is really boot2 to blame, I'm trying to
understand something there, but I'm really stuck.

I'm trying to add some output to boot2 to see what it is doing. I don't
really know what to look for though.

The above error is fully reproduceable giving always the exact same
values in the dump.

I also filed this information as a followup to PR i386/151122.

-- 
Guido Falsi <mad@madpilot.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110610111307.GD76732>