Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2001 22:02:36 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: now that DEVFS is standard.... 
Message-ID:  <Pine.LNX.4.21.0102132159120.21365-100000@zeppo.feral.com>
In-Reply-To: <55329.982130096@critter>

next in thread | previous in thread | raw e-mail | index | archive | help

> In message <Pine.LNX.4.21.0102131839460.21365-100000@zeppo.feral.com>, Matthew 
> Jacob writes:
> >
> >....Can we now have wildcarded major numbers for creating devices?
> >
> >I mean, now that we have the name just appear each time you boot, the actual
> >major number is not all that relevant now, is it?
> 
> Weeeeeeell, devfs is default, but not mandatory so we still support
> running !devfs systems, and unfortunately I suspect we will do so
> for some time still.

How about us having a 'range' of numbers, so we can do things like:

static struct cdevsw sa_cdevsw = {
        /* open */      saopen,
        /* close */     saclose,
        /* read */      physread,
        /* write */     physwrite,
        /* ioctl */     saioctl,
        /* poll */      nopoll,
        /* mmap */      nommap,
        /* strategy */  sastrategy,
        /* name */      "sa",
        /* maj */       SA_CDEV_ANY,
        /* dump */      nodump,
        /* psize */     nopsize,
        /* flags */     D_TAPE,
        /* bmaj */      -1
};

or

static struct cdevsw sa_cdevsw = {
        /* open */      saopen,
        /* close */     saclose,
        /* read */      physread,
        /* write */     physwrite,
        /* ioctl */     saioctl,
        /* poll */      nopoll,
        /* mmap */      nommap,
        /* strategy */  sastrategy,
        /* name */      "sa",
        /* maj */       SA_CDEV_MAJOR|SA_CDEV_ANY,
        /* dump */      nodump,
        /* psize */     nopsize,
        /* flags */     D_TAPE,
        /* bmaj */      -1
};

(make_dev gets SA_CDEV_MAJOR if !devfs, else any old number will do....)



We went round and round and round with this at Sun. We ended up with the
persistent file /etc/name_to_major which then binds a driver to a particular
major. I've *never* liked it- so prone to porking.

However, I like distributed, hemi-demi-asssigned, majors even less.

Just some thoughts.

-matt




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0102132159120.21365-100000>