Subject: Re: mounting non-BSD partitions.
To: None <current-users@NetBSD.ORG>
From: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
List: current-users
Date: 06/23/1997 15:14:15
-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "Perry" == Perry E Metzger <perry@piermont.com> writes:

    Perry> John Kohl writes:
    >> >>>>> "MR" == "Michael C Richardson"
    >> <mcr@sandelman.ottawa.on.ca> writes:
    >> 
    MR> I'd also like to suggest that 16 bits for the major number is
    MR> over doing it. I can understand 8 getting a bit tight in
    MR> exceptional conditions, but 12 ought to it. I suggest major
    MR> numbers are 8 or 12 bits in size, and the rest is minor
    MR> numbers.
    >>  Solaris and IRIX use a 10-bit major number with 22-bit minor
    >> numbers.  That seems to work just fine, so I'd suggest we use
    >> this existing practice.
    >> 
    >> They also use a makedevice() macro instead of makedev().
    >> (makedev() makes the old compatibility-sized device numbers,
    >> makedevice() creates full-sized device numbers)

    Perry> How does BSDI do all this?

NAME
     mknod - build special file

SYNOPSIS
     mknod name [c | b] major minor
     mknod name [c | b] major unit subunit

DESCRIPTION
     The mknod command creates device special files.  Normally the shell
     script /dev/MAKEDEV is used to create special files for commonly known
     devices; it executes mknod with the appropriate arguments and can make
     all the files required for the device.

     To make nodes manually, the required arguments are:

     name    Device name, for example ``sd'' for a SCSI disk or ``pty'' for
             pseudo-tty devices.

     b | c   Type of device. If the device is a block type device such as a
             tape or disk drive which needs both cooked and raw special files,
             the type is b. All other devices are character type devices, such
             as terminal and pseudo devices, and are type c.

     major   The major device number is an integer number which tells the ker-
             nel which device driver entry point to use.  To learn what major
             device number to use for a particular device, check the file
             /dev/MAKEDEV to see if the device is known, or check the system
             dependent device configuration file:

                   ``/usr/src/sys/architecture/conf/ioconf.c.architecture''

             (for example /usr/src/sys/i386/conf/ioconf.c.i386).

     minor   The minor device number tells the kernel which unit and/or sub-
             unit the node corresponds to on the device.  It may be further
             subdivided into a unit and subunit. For example, there might be a
             single minor value specifying a tty line, or the unit might spec-
             ify a disk unit number (a single drive) with the subunit being a
             partition on that drive.
...

HISTORY
     A mknod command appeared in Version 6 AT&T UNIX.  The separate unit and
     subunit appeared in BSD/OS 2.0.
 
>ls -l /dev/console
crw-------  1 root  tty   0,0,0 Jun 23 11:29 /dev/console

>grep makedev /usr/include/sys/types.h
#define        makedev(x,y)    ((dev_t)(((x) << 20) | (y)))    /* create dev_t */ 
#define        dv_makedev(x,y,z)       ((dev_t)(((x)<<20) | ((y) << 10) | (z))) 


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQB1AwUBM67K7qZpLyXYhL+BAQFZlAMAwGYVlySNRhzDHJco41kxBJuBGoA6mD3i
C913zexBdoRtw5lsvDfNMlQr915r5Lq8w4YA04RDyfWya6eyaJRdigTzUk0nqzTx
cJsR7m4zkp/GAI+PD8n8TJ6hf6/iONyG
=Bbi9
-----END PGP SIGNATURE-----