From owner-freebsd-hackers Wed Apr 30 01:46:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA16384 for hackers-outgoing; Wed, 30 Apr 1997 01:46:13 -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 BAA16379 for ; Wed, 30 Apr 1997 01:46:11 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id SAA27891; Wed, 30 Apr 1997 18:16:06 +0930 (CST) From: Michael Smith Message-Id: <199704300846.SAA27891@genesis.atrad.adelaide.edu.au> Subject: Re: Unloading LKMs (was Re: A Desparate Plea for Help...) In-Reply-To: <199704300827.RAA27805@genesis.atrad.adelaide.edu.au> from Darren Reed at "Apr 30, 97 06:26:43 pm" To: avalon@coombs.anu.edu.au (Darren Reed) Date: Wed, 30 Apr 1997 18:16:06 +0930 (CST) Cc: msmith@atrad.adelaide.edu.au, avalon@coombs.anu.edu.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 Darren Reed stands accused of saying: > > > > I expect that you take care to release your hooks before you go though, > > correct? There is no way of removing a devsw entry, and often > > no check made to ensure that it's safe to go. > > Yes, I release the hooks before going. The LKM code currently in the kernel > will clean up the appropriate devsw for you (it saves a copy of the old one > and copies that back when unloading). Hmm, I didn't see that before. It doesn't look like it's used correctly though; eg. the qcam module hooks itself in rather than letting _lkm_dev() do it. Then when its load function returns happily, the bogus entries its made in the cdevsw are saved as the 'old' values, and thus when it's unloaded the saved values are restored and everything is spam. Am I close? Anyone? > Darren -- ]] 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 [[