|
& |
|
NetBSD-SoC: Hardware monitoring and HAL port
What is it?
Almost all operating systems provide a way to notify userland of
hardware changes. E.g. a new USB device was connected, a CD-ROM
was inserted in a drive, a PCI Express card has been removed, etc.
Unfortunately, there is no such functionality in NetBSD, which
means that it is not really usable on systems where automation
on hardware changes is desired. The most obvious example are
desktop systems where one wants hardware to be managed
transparently.
This project aims to bring NetBSD in sync with other operating
systems by implementing kernel event notification framework
and a userland deamon to observe events and dispatch actions as
configured. Events originate in the kernel (individual devices,
autoconf(9) framework) and flow towards userland via a character
device interface.
NetBSD port of Freedesktop's HAL package will be created and
provided in Pkgsrc, resulting in better integration between the
base system and existing desktop environments -- KDE and GNOME
are already available to NetBSD users. Kernel part of the project
includes enhancements to the autoconf(9) machinery that are
believed to be beneficial for other uses as well.
Status
2007-07-09
Ok, I've been somewhat greedy about public relations up till now, based
on the sentiment "don't waste time with documentation and better get stuff
to work first". Now that midterm has come, the pressure has diminished, and
I need to say *something* in order to pass the evaluation anyway :-). So
here goes; comments appreciated (see bottom of this page for my email address).
Converted enough drivers to plist locators so that GENERIC/i386 (except for
options LKM, USERCONF) builds and works without any apparent lossage. In more
detail, the changes are:
config(1)
- Change ioconf.c generation, kill struct cfiattrdata,
struct cfparent, struct cflocdesc and struct cfdata
and instead pack all configuration data into a proplib dictionary.
Locators simply become a sub-dictionary thereof. The exact schema of
the cfdata plist is described under Documentation below.
Originally, the intent was to only plistify locators themselves, but
on closer inspection it turned out this would make the autoconf(9)
code into more of a mess than it used to be.
- Don't emit locators.h as it's not needed anymore.
- Locator default values have only ever been used to decide whether the
locator in question has been defined -- due to previous implementation,
all locators were always set. This is not needed anymore since if we
don't set a locator, it will simply be missing in the resulting dictionary.
Hence, locator default values are mostly being ignored, but are kept
supported for now.
kernel
- Teach kern/subr_autoconf.c about the fact that configuration
data are now described by plists. This fact is however considered
an implementation detail, the cfdata_t type is opaque anywhere
outside autoconf(9) code itself and accessor routines are provided.
- Convert any remaining references to struct cfdata to
cfdata_t; use accessor routines for all legitimate accesses
to the structure.
- Pseudo-devices used to manually fabricate configuration data per
device instance so that autoconf(9) would properly attach the device.
Given desired configuration data opaqueness, the old
config_attach_pseudo(cfdata_t cf) function has been changed to
config_attach_pseudo(const char *driver, const char *attachment, int
unit). To cover both clonable and wired instances, there's a magic
WILDUNIT value for unit meaning "use the first free unit
number for this instance."
- Convert any users of locators relevant to GENERIC/i386 setup (for now)
to plist locators, which are first-class proplib dictionaries. Provide
utility routines for common use cases. Due to the huge amount of drivers
affected, care has been taken to perform only "1:1" changes at this phase.
Subject to future work, there are many cases where locators and/or
bus-specific attach_args are being abused in various ways (see usb(4)
and isa(4) busses and drivers hanging thereof for examples). Ideally,
many attach_args members can become locators and most direct-config
${driver}_match() routines can be reduced to simple dictionary
subset test. On related note, most of the existing ${bus}_submatch()
routines can be replaced by config_stdsubmatch() once their
attach_args/locators use is straightened.
- While in the general area of isa(4), remove support for "knowndevs" as
it has been observed the feature is not used anywhere. This reduced the
amount of work a tiny bit.
other stuff
- proplib: Provide prop_dictionary_subest(smalldict, bigdict)
function. Returns true if 'smalldict' is a subset of 'bigdict', false
otherwise. The test considers dictionary to be a set of (key, value)
pairs; string equality applies on the 'key' component,
prop_object_equals() applies on the 'value' component.
This is useful for the very rare cases where locators are being gotten
right, and also for config_stdsubmatch() which, umm, assumes
locators are being gotten right :-).
And the code itself. Not suitable for public consuption yet, placed here
primarily for my mentor's eyes:
Official dates
- May 28 2007: Students begin coding for their GSoC projects; Google begins issuing initial student payments
- July 9 2007: Students upload code to code.google.com/hosting; mentors begin mid-term evaluations
- July 16 2007: Mid-term evaluation deadline; Google begins issuing mid-term student payments
- August 20 2007: Students upload code to code.google.com/hosting; mentors begin final evaluations; students begin final program evaluations
- August 31 2007: Final evaluation deadline; Google begins issuing student and mentoring organization payments
Deliverables
[What exactly is intended to be provide by the project.
This list will be used to judge success of the project!]
Mandatory (must-have) components:
Optional (would-be-nice) components:
Documentation
cfdata dictionary layout
- driver [string, mandatory]
Base name of the driver.
- attachment [string, mandatory]
Name of attachment (as in struct cfattach) to use for this instance.
- clonable [boolean, mandatory]
Indicates whether this instance is clonable (True) or wired (False).
- unit [unsigned integer, mandatory]
Unit number for wired instances, first usable unit number for clonable
instances.
- locators [dictionary, mandatory]
Locator values discriminating instance's position on parent bus and
device's identity. Locator dictionary has bus-specific layout.
- flags [unsigned integer, optional]
Driver-specific flags for this instance, defaulting to zero.
- attribute [string, optional with specific meaning]
Parent interface attribute this instance wishes to attach at. If missing,
the instance is a pontential root of the device tree -- on the theory
that "if we don't attach at any particular parent attribute, than our
parent is in fact nonexistent and thus we're able to root the whole
tree ourselves".
- parent-driver [string, optional]
Name of a specific parent driver we wish to be a child of.
- parent-unit [unsigned integer, optional]
Specific parent instance we wish to be a child of.
Technical Details
Status reports above hopefully provide enough details for now. As soon as
things stabilise, manual pages should appear here.
|
Jachym Holecek <freza@NetBSD.org> |
$Id: index.html,v 1.3 2007/07/09 23:05:46 nbfreza Exp $ |
|