Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2012 23:35:53 +0300
From:      Sergey Kandaurov <pluknet@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Devin Teske <devin.teske@fisglobal.com>
Subject:   Re: svn commit: r228985 - head/sys/boot/forth
Message-ID:  <CAE-mSOJS5a%2BxCTFmtUL3R%2B3VZJupgDo7eFbAc70wmtWRW6s-3Q@mail.gmail.com>
In-Reply-To: <4F08A518.8090207@FreeBSD.org>
References:  <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8 January 2012 00:03, Dimitry Andric <dim@freebsd.org> wrote:
> On 2011-12-30 07:24, Sergey Kandaurov wrote:
>>
>> Author: pluknet
>> Date: Fri Dec 30 06:24:59 2011
>> New Revision: 228985
>> URL: http://svn.freebsd.org/changeset/base/228985
>>
>> Log:
>> =A0 Unset the environment variables associated with individual menu item=
s
>> =A0 before invoking the kernel.
>
>
> When I did a single-user mode boot to install a new world, I saw the
> following warning on the (serial) console during boot:
>
> =A0/boot.config: -D -S115200
> =A0Consoles: internal video/keyboard =A0serial port
> =A0BIOS drive A: is disk0
> =A0BIOS drive C: is disk1
> =A0BIOS 638kB/3143616kB available memory
>
> =A0FreeBSD/x86 bootstrap loader, Revision 1.1
> =A0(dim@vm-freebsd10-amd64.home.andric.com, Sat Jan =A07 01:05:07 CET 201=
2)
> =A0Loading /boot/defaults/loader.conf
> =A0/boot/kernel/kernel data=3D0xb73530 data=3D0x11dbe0+0x2b4db8
> syms=3D[0x8+0xfd620+0x8+0xec6b6]
> =A0-
> =A0Hit [Enter] to boot immediately, or any other key for command prompt.
>
>
> =A0Type '?' for a list of commands, 'help' for more detailed help.
> =A0OK boot -s
> =A0menu-unset not found =A0 =A0 =A0 =A0 =A0 <<-- what's this?
> =A0GDB: no debug ports present
> =A0KDB: debugger backends: ddb
> =A0KDB: current backend: ddb
> =A0[...kernel boots...]
>
> E.g, it always gives a 'menu-unset not found' warning (or maybe it's an
> error, it's not clear). =A0This was not the case before r228985.
>
> I have almost no knowledge about forth, but it looks like this might be
> caused by the new try-menu-unset subroutine.
>
> My loader.conf is just this:
>
> =A0beastie_disable=3D"YES"
> =A0comconsole_speed=3D"115200"
> =A0console=3D"comconsole vidconsole"
> =A0kern.hz=3D"100"

So, the problem arise when beastie_disable is set.

In this case menu.rc is not evaluated and consequently menu-unset does
not have a body yet. This results in the ficl warning "not found" when
try-menu-unset calls menu-unset. The warning cannot be handled with catch
as seen with the code in head.
Otherwise, when beastie is enabled, all works as it should.

To "fix" the problem I replaced 'catch' with 'sfind', so that we can
conditionally call menu-unset only when the definition is present.

Please try the following patch. I tested it with enabled/disabled beastie
and loader_color over serial console. I would also like to get a review
from Devin Teske to see if this change is acceptable.

%%%
Index: sys/boot/forth/loader.4th
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- sys/boot/forth/loader.4th   (revision 229670)
+++ sys/boot/forth/loader.4th   (working copy)
@@ -45,8 +45,10 @@

 : try-menu-unset
   s" menu-unset"
-  ['] evaluate catch if
-    2drop
+  sfind if
+    execute
+  else
+    drop
   then
 ;

%%%

[ It could be simplified with one-liner:
s" menu-unset" sfind drop execute
but ficl doesn't like this in a freestanding environment.]

--=20
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAE-mSOJS5a%2BxCTFmtUL3R%2B3VZJupgDo7eFbAc70wmtWRW6s-3Q>