From owner-freebsd-hackers Wed Apr 30 00:44:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA12427 for hackers-outgoing; Wed, 30 Apr 1997 00:44:52 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id AAA12409 for ; Wed, 30 Apr 1997 00:44:48 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id RAA27463; Wed, 30 Apr 1997 17:14:31 +0930 (CST) From: Michael Smith Message-Id: <199704300744.RAA27463@genesis.atrad.adelaide.edu.au> Subject: Re: Unloading LKMs (was Re: A Desparate Plea for Help...) In-Reply-To: from Doug Rabson at "Apr 30, 97 08:19:12 am" To: dfr@nlsystems.com (Doug Rabson) Date: Wed, 30 Apr 1997 17:14:31 +0930 (CST) Cc: msmith@atrad.adelaide.edu.au, bde@zeta.org.au, hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 [[