From owner-freebsd-current Fri Jun 4 13:48:58 1999 Delivered-To: freebsd-current@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 3EA6E14FA3 for ; Fri, 4 Jun 1999 13:48:51 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id GAA25745; Sat, 5 Jun 1999 06:48:49 +1000 Date: Sat, 5 Jun 1999 06:48:49 +1000 From: Bruce Evans Message-Id: <199906042048.GAA25745@godzilla.zeta.org.au> To: bde@zeta.org.au, julian@whistle.com Subject: Re: cdevsw_add Cc: current@FreeBSD.ORG, nick.hibma@jrc.it, phk@critter.freebsd.dk, roger@cs.strath.ac.uk Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> The isa drivers provide many bad examples. Most of them attached the >> devsw in a disgusting SYSINIT even if the device is disabled. I moved >> the devsw attach to the device attach function in some drivers that >> I worked on. This was necessary to support pcvt and syscons sharing a >> devsw entry. > >Firstly, the SYSINIT code was a stopgap. It will evolve with time.. The Like most stogaps, it was there too long (3.5 years). It is mostly gone now. >... >I therefore put it to the group that the right place to do devsw[] >manipulation is neither in xxx-probe, or xxxx_attach, but in xxx_init(), >which is only called once, and IS called at teh right time. >It should also be noted that teh devsw[] extraction code should be run >from the init() code when it is run with the 'shutdown' argument. (but >only when the driver arees to allow itself to be unlinked). You're forgetting that devsw[] is another stopgap. The kernel should probably use something like devfs, where dev_t's only exist for devices that actually exist. xxx_init() is far too early to decide which hardware devices exist. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message