Re: Module Ideas: Persistence, PnP, and more...

Alon Ziv (alonz@cs.Technion.AC.IL)
Sat, 5 Sep 1998 02:30:41 +0300 (IDT)


On 4 Sep 1998, Anthony Ginepro wrote:
> Alon Ziv <alonz@cs.Technion.AC.IL> writes:
> > 1. Persistence
> >
> > One of the major pitfalls with current module support is that user
> > settings are not saved between uses of a module. This includes both
> > `initialization' settings (set using `parm=xxx' at insmod time) and
> > runtime-tunable settings (such as sound volume).
> >
> > To get over this, I suggest a completely user-space approach.
>
> [Your method]
>
> I thought that was why "pre-install" & "post-install" commands
> were implemented for in modules.conf.
> Here's an example with my soundcard and alsa module :
> ---
> options snd-sb16 snd_index=1 snd_port=0x220 snd_irq=10 snd_dma8=1 snd_dma16=5
> post-install snd-sb16 cat /etc/mixer0 > /proc/sound/card1/mixer0
> pre-remove snd-sb16 cat /proc/sound/card1/mixer0 > /etc/mixer0
> ---
> I don't really think we need something else...but maybe I'm wrong.
>

There are (at least) three problems with the current approach:

1. When modules are unloaded automatically (automatic reaping by the
kernel), the pre-remove code isn't run (as modprobe isn't even
involved). This more-or-less requires that automatic reaping be moved
out of kernel space, and into userland, where it belongs. (I assume
your setup works by loading the snd-sb16 module explicitly at boot, and
unloading it at shutdown; but others may wish for sound to be loaded /
unloaded using kmod & friends).

2. Not every card exports all of its settings via a /proc interface, nor
can it get them back through it. And I'm not sure it's The Right Way,
as /proc-handling code bloats the kernel and is very error prone.

3. Sound settings, in particular, are a problem: we don't want to have the
driver reset mixer settings even for a short while after it's loaded,
as this may cause sound glitches or even damage hardware (too high
volume, for example). So we need these a method for these settings to
be set at module initialization time.

------------------------+---------------------------------------------
. __ | Phone: 03-5340753 (home), 03-9685882 (work)
_| / | email: alonz@usa.net
/ | /_ Alon Ziv | smail: 33 Ha-Rama St., Ganey Tiqwah 55900
------------------------+---------------------------------------------
<<<(((this place reserved for that ultra-wise oneliner I haven't found.)))>>>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html