Subject: Re: config(8) vs Brett Lymn :-)
To: John Kohl <>
From: Brett Lymn <>
List: tech-kern
Date: 03/06/1997 13:44:39
According to John Kohl:
>In fact, I have hacked on config to do this sort of thing--I have it
>spit out #define'ed locator indices for indexing into cf_loc[], a list
>of locator names { "foo", "bar" }, and a count of locators.  I haven't
>done any work to actually use this set of defines, though :)

Hmmmm can you send me the code?  I would like to have a look at it.

As Der Mouse said, I am at the moment just running dmesg and picking
out the locators from the devices that I recognise (i.e. ones that I
picked up surfing the kernel data).  This works ok on the machines I
have tested it on (i386 architecture) but I can see a couple of
problems with it:

1) the kernel message buffer is a fixed size and can, therefore, lose
the information I am surfing for if/when more kernel messages are

2) I am not 100% sure that the logging of a line is atomic - is the
whole line logged to the buffer without interruption?  If it is not
then information could be corrupted by an ill-timed message.

One thing I did notice with the locators array was that it appeared to
be updated during the probe, well in the driver I looked at (fdc) the
locators were updated.  Would this be a good place to pick the data
from?  What about config lines of the sort 

sd* at scsibus* target ? lun ?

I would imagine that the locators get overwritten on subsequent
probes?  The other problem I have with the locators array is that the
contents are very bus specific which means I would need to know what
bus the device is attached to to sensibly interpret them.  I think I
can pick up that information from the same files that config(8) uses.

I want to make this thing as architecture & bus neutral as I can and
where I cannot make it cope easily with new architectures & busses.

Finally, the prtconf is really only the start of another project -
automating the config file building itself, the data required to do
this is the same stuff that prtconf gets - along with a lot more.  I
have roughed out some design for this, if anyone is interested they
are welcome to have a look.

Brett Lymn, Computer Systems Administrator, AWA Defence Industries
  "Upgrading your memory gives you MORE RAM!" - ad in MacWAREHOUSE catalogue.