Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Feb 2012 11:26:59 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        rank1seeker@gmail.com
Cc:        Roman Divacky <rdivacky@freebsd.org>, hackers@freebsd.org
Subject:   Re: BUG: 9.0 stage 2 boot (/boot/boot)
Message-ID:  <201202291127.00209.jhb@freebsd.org>
In-Reply-To: <20120228.200906.958.1@DOMY-PC>
References:  <20120217.074355.853.1@DOMY-PC> <201202271123.59244.jhb@freebsd.org> <20120228.200906.958.1@DOMY-PC>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <jhb@freebsd.org>
> To: rank1seeker@gmail.com
> Cc: hackers@freebsd.org, "Roman Divacky" <rdivacky@freebsd.org>
> 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--



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