configurable device (and other) tables in the kernel ?

Luigi Rizzo rizzo at icir.org
Wed Jan 31 19:51:50 UTC 2007


I think there was some discussion on the topic some time ago
but cannot remember if there was any outcome so let me ask.

We have several tables in our kernel and modules,
containing at least device-id tables (pci, usb),
quirks for certain devices, and maybe more (i am excluding
firmware because it is not something where you may want
to change a few lines manually).

Right now we compile them statically in the code.
However sometimes it is useful to update them 'on the fly'
without having to rebuild a kernel/module - e.g. because
an entry (e.g. a quirk for a specific device) cannot be
safely included in the distribution, etc.etc.

What are the options to implement a mechanism that lets
userland update such tables, and maybe in a way that
is accessible to the boot loader ?

The (obvious) requirements are:
 + support for multiple tables with variable (maybe defined
   at compile time) structure;
 + initial values should be compiled in;
 + the access mechanism should provide mechanism to read/modify/write/delete
   entries;
 + human-readable (i.e. textual) representation of entries in userland,
   with hooks to translate them in a machine-friendly format on writes,
   and back on reads;

sysctl is the first method that comes to my mind, but
perhaps there is some better way ?

	cheers
	luigi


More information about the freebsd-arch mailing list