Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 08:19:12 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Michael Smith <msmith@atrad.adelaide.edu.au>
Cc:        Bruce Evans <bde@zeta.org.au>, hackers@freebsd.org
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <Pine.BSF.3.95q.970430081033.13137F-100000@herring.nlsystems.com>
In-Reply-To: <199704300332.NAA25320@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 30 Apr 1997, Michael Smith wrote:

> Still, I take your point about the cdevsw not being updated.  I can't see
> a clean way of doing this, either.
> 
> Doug R., how do you approach this in your New Module Structure?  (No, I
> haven't had time to read it yet 8( 8( 8( )

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.

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.

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.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970430081033.13137F-100000>