From owner-freebsd-current@FreeBSD.ORG Tue Aug 16 13:15:04 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 821661065670; Tue, 16 Aug 2011 13:15:04 +0000 (UTC) (envelope-from christoph_hoffmann@me.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id 626B58FC08; Tue, 16 Aug 2011 13:15:04 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Received: from tunnel0.sec101.ch ([62.2.44.112]) by asmtp029.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <0LQ000FCKVFKDX30@asmtp029.mac.com>; Tue, 16 Aug 2011 06:14:16 -0700 (PDT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.4.6813,1.0.211,0.0.0000 definitions=2011-08-16_03:2011-08-16, 2011-08-16, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=2 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1108160125 From: Christoph Hoffmann In-reply-to: <201108151212.07874.jhb@freebsd.org> Date: Tue, 16 Aug 2011 15:14:08 +0200 Content-transfer-encoding: quoted-printable Message-id: <7BD5F062-A7B0-4D05-989F-F23C9353E7D8@me.com> References: <9B42BCDF-43E3-4517-9972-47A8B539880F@me.com> <3D9B1E72-385F-493A-A6B3-4684A2DB50E4@me.com> <201108151212.07874.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1244.3) Cc: freebsd-current@freebsd.org 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: Tue, 16 Aug 2011 13:15:04 -0000 Hello John, Thank you very much indeed for your reply. The pmbr.s passes the ARGS set to 0x900 to main() in zfsboot.c and *(uint8_t *)PTOV(ARGS)) is 0x80.=20 In zfsboot.c main(), before the line bootinfo.bi_version =3D BOOTINFO_VERSION; gets executed we still keep the right value of the dsk->drive and just = after the execution, the dsk->drive is equal to zero. Adding printf("hello\n"); before dsk =3D malloc(sizeof(struct dsk)); keeps the dsk->drive value assigned to 0x80 and the box will boot. Any comments will be appreciated. Best Regards, Christoph -- Christoph Hoffmann On Aug 15, 2011, at 6:12 PM, John Baldwin wrote: > 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. >=20 > But that shouldn't happen if ARGS has a drive number of 0. (In that = case 0x80=20 > !=3D 0x0, so it shouldn't match.) >=20 > This shows that PTOV(ARGS) actually has a %dl value of 0x80 which is = correct. =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): >=20 > dsk->drive =3D *(uint8_t *)PTOV(ARGS); > dsk->type =3D dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; >=20 > Somewhere between where 'dsk' is initalized in main() and before = probe_drive()=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? >=20 > --=20 > John Baldwin > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org"