From owner-freebsd-current@FreeBSD.ORG Mon Aug 15 16:12:09 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F6ED1065674 for ; Mon, 15 Aug 2011 16:12:09 +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 674FB8FC28 for ; Mon, 15 Aug 2011 16:12:09 +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 2115646B39; Mon, 15 Aug 2011 12:12:09 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9E6BA8A02E; Mon, 15 Aug 2011 12:12:08 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 15 Aug 2011 12:12:07 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <9B42BCDF-43E3-4517-9972-47A8B539880F@me.com> <3D9B1E72-385F-493A-A6B3-4684A2DB50E4@me.com> In-Reply-To: <3D9B1E72-385F-493A-A6B3-4684A2DB50E4@me.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201108151212.07874.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 15 Aug 2011 12:12:08 -0400 (EDT) Cc: Christoph Hoffmann Subject: Re: gptzfsboot error using HP Smart Array P410i Controller X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2011 16:12:09 -0000 On Friday, August 05, 2011 10:08:27 am Christoph Hoffmann wrote: > Hello Everyone, >=20 > Despite the BIOS information about the nonexistent floppy, the zfsboot.c= =20 code=20 > will prevent to boot from the first HDD if a floppy is given as a first=20 available device. >=20 > The drive 0x0 (floppy) will be probed before the code below and an error= =20 occurs: > [=85] > gptzfsboot: error 1 lba 32 = =20 > gptzfsboot: error 1 lba 1 = =20 > [=85] >=20 > The continue statement will skip the rest of the iteration because =20 > if ((i | DRV_HARD) =3D=3D *(uint8_t *)PTOV(ARGS))=20 > is true if the drive equals 0x80. As a result we do not call probe_drive() > for this drive. But that shouldn't happen if ARGS has a drive number of 0. (In that case 0= x80=20 !=3D 0x0, so it shouldn't match.) This shows that PTOV(ARGS) actually has a %dl value of 0x80 which is correc= t. =20 The question is how your initial 'dsk' ended up using 0x0 instead of 0x80. Note that your 'type' is 0, so that means that it was ok initially (TYPE_AD= is=20 0): dsk->drive =3D *(uint8_t *)PTOV(ARGS); dsk->type =3D dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; Somewhere between where 'dsk' is initalized in main() and before probe_driv= e()=20 is called in main() for 'dsk', 'dsk->drive' is getting clobbered. Can you = add=20 some additional printfs to nail down where that is happening? =2D-=20 John Baldwin