Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 17:14:31 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        dfr@nlsystems.com (Doug Rabson)
Cc:        msmith@atrad.adelaide.edu.au, bde@zeta.org.au, hackers@freebsd.org
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <199704300744.RAA27463@genesis.atrad.adelaide.edu.au>
In-Reply-To: <Pine.BSF.3.95q.970430081033.13137F-100000@herring.nlsystems.com> from Doug Rabson at "Apr 30, 97 08:19:12 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Doug Rabson stands accused of saying:
> 
> I run all the sysinits in an object file which is loaded by the kernel
> linker.  This would sort out calling qcam_drvinit when the driver is
> loaded.  The probe and attach is handled by some new code in isa.c which
> understands drivers appearing and disappearing and which can create new
> isa_devices as requested by the user who is loading the driver.

Makes sense.

> For unloading, the driver registers itself as a module.  This involves
> supplying an event callback in a similar way to the LKM system.  When the
> user attempts to unload the driver, the module gets an UNLOAD event which
> it can use to clean up *devsw, devfs, interrupts etc.  If it can't for
> some reason, it can veto the unload by returning EBUSY.

Ok.  Do you have infrastructure for cleaning up devsw entries automagically?
eg. a hook the module can call to say "these *devsw entries are mine"
so that you can back the module out when you unload it?

> The important point is that there is *no difference* between the dynamic
> and statically loaded version of a driver.  I can go into a
> /sys/compile/FOO directory and construct loadable modules from the same
> object files.

Spiff!

> Doug Rabson				Mail:  dfr@nlsystems.com

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704300744.RAA27463>