tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: power management and pseudo-devices

On Mon Jul 19 2010 at 01:28:42 +0000, Quentin Garnier wrote:
> On Sun, Jul 18, 2010 at 05:31:42PM -0700, Paul Goyette wrote:
> > On Mon, 19 Jul 2010, Quentin Garnier wrote:
> > 
> > >>>Include "ioconf.h" I think.
> > >>
> > >>Tried that.  It works for compiling the kernel.  Unfortunately,
> > >>swwdog is included in rump, and there doesn't seem to be an ioconf.h
> > >>available for the librump build.
> > >
> > >Well, whatever.  I don't think I want to look at that.
> > 
> > :)
> Actually, I still think this is wrong.  It might make librump compile
> and even link, that doesn't mean it will be usable if nothing ever
> creates that extern symbol.  You'll have to check with pooka or explore
> the code, but there have to be some components of rump that have partial
> configuration files.  After all, he created the "ioconf" directive for
> that purpose.

First of all, let's take a step up from the trenches and try to understand
the problem we're dealing with instead of trying to arbitrarily guess how
to fix the build.  We have two ways of building kernel code: monolithic
(./ kernel=CONF) and modular (kernel modules, rump components).
The latter ones currently always do config stuff on-demand, so changes
cause breakage.  Should a swwdog kernel module exist (why isn't there
one?), it would run into the same problem.

Now, the ioconf keyword for config(1) is meant to help build modular
kernel code by allowing to specify a partial config file.  Currently,
as the name implies, it takes care of creating ioconf.[hc], namely in
this case struct cfdriver swwdog_cd.

Adding a SYSMON.ioconf will solve the problem:
=== snip ===
ioconf sysmon

include "conf/files"

pseudo-device swwdog
=== snip ===

The good news is that if some day a sysmon kernel module is added,
the exact same ioconf can be used without having to once again run
into trouble.

Then let's view the broader scale.  I think acpibat is currently the
only kernel module using ioconf, and I haven't bothered converting others
since I have realized that the scope of ioconf was a little too narrow.
I'm planning to change the keyword to "module" and add support for source
files.  This way the default build for every modular kernel component
goes through config, and we can avoid issues due to config changes.
IIRC I have the config(1) part for this done already, but being able to
use an autogenerated SRCS list requires some style advanced
make hackery which I haven't been in the mood for.  Plus, there's of
course the mess with "file some.c foo | bar & (baz ^ xyzzy) & !!!frobnitz".

Finally, on the eternal "someone should" astral plane, someone should
fix the kernel build to consist of building a set of modules and linking
them together, so we don't have more than one way to skin a kernel.

Home | Main Index | Thread Index | Old Index