Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 1997 16:44:21 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        config@freebsd.org
Subject:   Startup userconfig parsing
Message-ID:  <199704280714.QAA16178@genesis.atrad.adelaide.edu.au>

next in thread | raw e-mail | index | archive | help

Jordan, other config-interested people.

I've been re-studying userconfig(), and a number of things have come to
light : 

 - Visual and commandline mode don't tread on each others' toes.  You
   should be able to swap between the two with impunity.  In
   particular, changes made in commandline mode should be reflected in
   visual mode just fine.   If this isn't true, please give me a 
   sequence that demonstrates it not working and I'll fix it asap.

 - It should be quite straightforward to load a text file with the
   bootstrap eg. after the symbols and have it parsed by the
   commandline parser at kernel startup.  Regenerating this
   information at a later stage would be easy, as unlike with the dset
   method, you know everything that's changed from the compile-time
   config.

The latter actually leads me around to something I proposed a while
back.  Now that Bruce has made it feasible with the bootstrap
readfile() code, I'd like to reincarnate the 'kernel rc file(s)'
concept.

The plan goes something like this :

Put all our stuff in /boot on the boot filesystem.  If /boot/kernel.rc
exists, it's loaded unconditionally.  If /boot/kernel.rc.<kernelname>
exists, load that too.  If there's room in the bootloader after all
this drama, it might be nice to have a couple of extra flags :

 -f <rcfile>	Load additional kernel.rc file
 -F <rcfile>	Load this rcfile, don't load kernel.rc.

If the commandline supports it, perhaps allow multiple -fF instances.

An alternative would be /boot/rc/default, <kernelname>, etc.

Now, assuming that the space just after the kernel is available, I
propose a header, something like :

0xmagicnumber, 0xlength,
"rcfile 1 name"
"line 1"
"line ..."
0xmagicnumber, 0xlength,
"rcfile 2 name"
...

The idea here being that this may well not be the only sort of data we
want to stuff in like this.  Putting the filenames in is intended as
fluff for debugging purposes.  

A suitable API for modules to extract this information can be devised.
It shouldn't be too hard to upgrade this if/when the kernel side of the
parameter registry happens.

For userconfig stuff, entries would probably be plain userconfig commands
prefixed appropriately, eg. :

userconfig port ed0 0x300

Comments?  And yes, I'll volunteering for asbestos duty 8)

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



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