From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 2 20:23:20 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03BA91065670 for ; Thu, 2 Dec 2010 20:23:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B64D68FC15 for ; Thu, 2 Dec 2010 20:23:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4223E46B2E; Thu, 2 Dec 2010 15:23:19 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4A8738A01D; Thu, 2 Dec 2010 15:23:18 -0500 (EST) From: John Baldwin To: Darmawan Salihun Date: Thu, 2 Dec 2010 15:23:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <64838.99820.qm@web76801.mail.sg1.yahoo.com> In-Reply-To: <64838.99820.qm@web76801.mail.sg1.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201012021523.17828.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 02 Dec 2010 15:23:18 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: How to debug BTX loader? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 20:23:20 -0000 On Thursday, December 02, 2010 2:12:04 pm Darmawan Salihun wrote: > Hi John, > > --- On Thu, 12/2/10, John Baldwin wrote: > > > From: John Baldwin > > Subject: Re: How to debug BTX loader? > > To: freebsd-hackers@freebsd.org > > Cc: "Darmawan Salihun" > > Date: Thursday, December 2, 2010, 8:58 AM > > On Wednesday, December 01, 2010 > > 4:09:42 pm Darmawan Salihun wrote: > > > Hi John, > > > > > > --- On Tue, 11/30/10, John Baldwin > > wrote: > > > > > > > From: John Baldwin > > > > Subject: Re: How to debug BTX loader? > > > > To: freebsd-hackers@freebsd.org > > > > Cc: "Darmawan Salihun" > > > > Date: Tuesday, November 30, 2010, 9:38 AM > > > > On Monday, November 29, 2010 1:01:27 > > > > pm Darmawan Salihun wrote: > > > > > Hi guys, > > > > > > > > > > I'm currently working on a BIOS for a custom > > Single > > > > Board Computer (SBC). > > > > > I have the required BIOS source code and > > tools at > > > > hand. > > > > > However, the boot process always stuck in > > the BTX > > > > loader > > > > > (the infamous "ACPI autoload failed") when I > > booted > > > > out of USB stick > > > > > (with the FreeBSD 8.1 USB stick image). > > > > > > > > > > I could get the system to boot into FreeBSD > > 8.1 > > > > > (by keeping the CDROM tray open and close it > > when the > > > > board looks for > > > > > boot device, otherwise BTX will reboot > > instantly). > > > > > > > > Are you getting an actual BTX error message or a > > > > freeze? BTX is just a > > > > minikernel written all in assembly. It > > doesn't handle > > > > loading the kernel, > > > > etc. All that work is done by the > > /boot/loader > > > > program (which is written in > > > > C). You can find all the source to the boot > > code in > > > > src/sys/boot. The BTX > > > > kernel is in src/sys/boot/i386/btx/btx/. > > > > > > > > However, to debug this further we would need more > > info such > > > > as what exactly > > > > you are seeing (a hang, a BTX fault with a > > register dump, > > > > etc.). > > > > > > One of the BTX fault shows the register dump in the > > attachment. > > > I hope this could help. Anyway, If I were to try to > > interpret > > > such register dump, where should I start? I understand > > x86/x86_64 > > > assembly pretty much, but I'm not quite well versed > > with the > > > FreeBSD code using it. > > > > Looks like the mailing list stripped the attachment. > > Can you post the > > attachment at a URL? > > > > The BTX crash message is in the attachment. Ok, so clearly the instruction pointer has jumped off into the weeds given that the instruction stream is all 0xff. The instruction pointer value (0xc09d3600) implies that this is in the kernel already during early kernel startup (before the kernel installs its own IDT with its own fault and exception handlers). It might be helpful to pull up gdb on your kernel.debug file and do 'l *0xc09d3600' to see what you get. Looking at the stack '0xc1830188' might be another address in the kernel. -- John Baldwin