Date: Tue, 21 Jan 1997 00:51:29 -0800 (PST) From: Julian Elischer <julian@current1.whistle.com> To: Darren Reed <avalon@coombs.anu.edu.au> Cc: proff@suburbia.net, julian@freebsd.org, kuku@gilberto.physik.rwth-aachen.de, hackers@freebsd.org Subject: Re: FreeBSD 3.0-current port Message-ID: <Pine.BSF.3.95.970121004256.9650A-100000@current1.whistle.com> In-Reply-To: <199701210731.XAA04210@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 21 Jan 1997, Darren Reed wrote: > In some mail from proff@suburbia.net, sie said: > [...] > > FreeBSD uses dynamically allocated cdevsw's. imho ipfilter should > > not be manipulating the cdevsw directly at all (there are macros/ > > functions in the kernel to do this). Darren's rational (correct me > > if I'm wrong) behind scanning through cdevsw directly was to ensure > > free major/minor number pairs. > > It manipuates cdevsw so that it knows the major/minor # and can create > the entry in /dev itself (rather than rely on some script or human to > do it correctly). Solaris2 has an interface for doing all this, and now > I think FreeBSD does too (other OSes don't). Note thet FreeBSD has an array of POINTERS to cdevsw entries.. so an array can be sparse and not waste too much room. the cdevsw struct is in the source file with the functions it references, so those functions can be 'static'. (e.g. two functions can have the name "fdopen" and not clash if one is in teh 'fd' driver and the other is in the floppy disk driver. the major number is written into the cdevsw structure when it is assigned by the function, and it also has a spot for the driver name e.g. "fd". there is also a spot for a link to an associated bdevsw entry. sorry if that all looks too differnt to other OS's but I wanted to clean up a lot of cruft in teh kernel.. we have a way to go but this was the distance we could easily do without TOTALLY breaking too much.. the functions are: cdevsw_add() and bdevsw_add() and they are in (I think) kern/kern_conf.c (they can probably do with some cleanups by now :) julian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970121004256.9650A-100000>