From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 29 16:27:02 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B645F106564A; Wed, 29 Feb 2012 16:27:02 +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 75C118FC18; Wed, 29 Feb 2012 16:27:02 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 1329846B39; Wed, 29 Feb 2012 11:27:02 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75422B926; Wed, 29 Feb 2012 11:27:01 -0500 (EST) From: John Baldwin To: rank1seeker@gmail.com Date: Wed, 29 Feb 2012 11:26:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <20120217.074355.853.1@DOMY-PC> <201202271123.59244.jhb@freebsd.org> <20120228.200906.958.1@DOMY-PC> In-Reply-To: <20120228.200906.958.1@DOMY-PC> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_UHlTP57llgl4TNw" Message-Id: <201202291127.00209.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 29 Feb 2012 11:27:01 -0500 (EST) Cc: Roman Divacky , hackers@freebsd.org Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) 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: Wed, 29 Feb 2012 16:27:02 -0000 --Boundary-00=_UHlTP57llgl4TNw Content-Type: Text/Plain; charset="windows-1250" Content-Transfer-Encoding: 7bit On Tuesday, February 28, 2012 3:09:06 pm rank1seeker@gmail.com wrote: > ----- Original Message ----- > From: John Baldwin > To: rank1seeker@gmail.com > Cc: hackers@freebsd.org, "Roman Divacky" > Date: Mon, 27 Feb 2012 11:23:59 -0500 > Subject: Re: BUG: 9.0 stage 2 boot (/boot/boot) > > > On Saturday, February 25, 2012 9:41:48 am rank1seeker@gmail.com wrote: > > > > Do you only see the "No " message? Do you see the '/boot.config: /loader' > > > > message? (Do you have RBX_QUIET enabled perhaps? (-q)) Do you get the actual > > > > boot2 prompt at all? > > > > > > I don't have RBX_QUIET enabled nor any other flags > > > > > > Let the pic tell a story: > > > http://www.starforce.biz/stage2boot.jpg > > > > Ahh, this is helpful. You do see the '/boot.config: /loader' message. > > I've already explained that, numerous times (RE-typing ...) It was not as obvious before, and you are seeing a failure that no one else has reported, so you need to be patient. > > > Patch eliminates possible error, of manual "intervention" > > > That is, a perfectly valid patch being classified as invalid. > > > > I have no idea what you mean here. However, it seems you don't have junk in > > your 'opts' variable anyway. > > What I meant was that I won't manually(edit file) apply patch, but via 'patch' tool/bin. Ok. > > Hmm, you could try adding some more debugging to boot2.c to see exactly what > > is failing. For example, does the first call to 'parse()' fail and clear > > autoboot? > > I don't do nor understand c code. Ok. That will take a bit longer to fix, but that is ok. I've attached a new patch with some debugging output. It shouldn't fix the problem yet, but I want to see if any of the new messages are output, and when they are output. > How could it silently loose documented functionality? Several changes were made to boot2 to make it smaller so it could be compiled with clang, and it seems that at least one of those changes must have had a bug. -- John Baldwin --Boundary-00=_UHlTP57llgl4TNw Content-Type: text/x-patch; charset="ISO-8859-1"; name="boot2_test.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="boot2_test.patch" Index: boot/i386/boot2/boot2.c =================================================================== --- boot/i386/boot2/boot2.c (revision 232297) +++ boot/i386/boot2/boot2.c (working copy) @@ -225,6 +225,7 @@ { uint8_t autoboot; ino_t ino; + size_t nbyte; kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -241,13 +242,17 @@ autoboot = 1; - if ((ino = lookup(PATH_CONFIG))) - fsread(ino, cmd, sizeof(cmd)); + if ((ino = lookup(PATH_CONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) + if (parse()) { autoboot = 0; + printf("parse() failed\n"); + } if (!OPT_CHECK(RBX_QUIET)) printf("%s: %s", PATH_CONFIG, cmddup); /* Do not process this command twice */ @@ -260,6 +265,7 @@ */ if (autoboot && !kname) { + printf("default loader\n"); kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); --Boundary-00=_UHlTP57llgl4TNw--