Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ DEV_DB(4) — svr4 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

MKDEV(1M)



DEVDB(4-SVR4)      RISC/os Reference Manual       DEVDB(4-SVR4)



NAME
     DEV_DB - device description database

DESCRIPTION
     The directory /dev/DEV_DB contains a set of files that make
     up the database used by MKDEV(1M) to create system device
     entries.  Note that MKDEV uses the subdirectory ./DEV_DB, so
     that if MKDEV is run in another directory, the database must
     be there.

     The database is the concatenation of the following files in
     the given order:


          common.system
          common.local
          common.hostname
          machine.system
          machine.local
          machine.hostname

     where hostname is found by executing the command hostname(1)
     (if it exists) and machine is found by executing uname(1)
     with the option -t.  Data definitions are overwritten, so
     data found in common.system can be overridden by data found
     in, for example, machine.system.

     The intent of this organization is to make network and
     host-specific administration simpler.  The .system files are
     supplied with the system.  The .local and .hostname files
     can be maintained on a single ``master'' system and then
     copied periodically to the other systems, thus centralizing
     the administration task.

     The database is a simple hierarchy of device ``classes'' and
     ``operations''.  A class is defined by the syntax


          class(name,alias...) {operations}

     (NOTE: Separators, such as parentheses and commas, may be
     surrounded by spaces and tabs, and the braces may be sur-
     rounded by spaces, tabs, and newlines.)  Class names and
     aliases may not contain spaces, tabs, newlines, parentheses,
     braces, or the comment character (#).  Comments are any
     string beginning with a # and ending with a newline.  There
     is no way to escape the # character.

     As stated previously, the same class may be defined multiple
     times, and each definition overrides the previous, thus
     allowing the machine-specific and local files to override
     the system defaults.



                        Printed 11/19/92                   Page 1





DEVDB(4-SVR4)      RISC/os Reference Manual       DEVDB(4-SVR4)



     The operations part of the class definition consists of
     listings for devices, ``iterative'' devices, links, ``itera-
     tive'' links, messages, and other classes.  Listings are
     separated by newlines or semi-colons, and trailing semi-
     colons are ignored.

     A device listing is of the form


          device(name,type,major,minor,mode,owner,group)

     This creates a device entry called name, with type type (`b'
     for block special or `c' for character special), the given
     major and minor device numbers, the given mode (number), and
     the named owner and group.

     An iterative device is a group of devices whose names and
     minor numbers are related and have values that increase by
     1.  An example of an iterative device is the set of standard
     terminals, /dev/tty[0-5], which have minor device numbers
     0-5.  The iterative device listing is of the form


          idevice(count,name,start,type,major,minor,mode,owner,group)

     This creates a set of count device entries.  The name of
     each entry is the concatenation of name and a counter begin-
     ning at start increasing by 1.  The minor device number
     starts with minor and increases by 1 for each entry.

     A link listing is of the form


          link(file,linkname)

     This creates a link called linkname to file, which must
     already exist.

     An iterative link is a group of links whose source and tar-
     get names both end with numbers, and each number is incre-
     mented by 1.  The iterative link listing is of the form


          ilink(count,file,start1,linkname,start2)

     This creates a set of count device entries.  The name of
     each entry is the concatenation of linkname and a counter
     beginning at start2.  The file to be linked in each case is
     the concatenation of file and a counter beginning at start1.

     A message listing causes a message to be printed on the
     standard output when MKDEV is executed.  It is of the form



 Page 2                 Printed 11/19/92





DEVDB(4-SVR4)      RISC/os Reference Manual       DEVDB(4-SVR4)




          message(text)

     The text field may contain any characters except for separa-
     tors (parentheses, commas, semi-colons, and braces), and is
     processed by echo(1). Leading and trailing spaces and tabs
     are removed, and intermediate whitespace may be compressed
     into single spaces.  It is therefore best to use \t for
     tabs.

     All other listings found in a class definition are con-
     sidered to be the names of classes, which are effectively
     included.  For example, if class ``foo'' is defined with a
     listing ``bar'', ``bar'' is considered to be a class, and
     its listings are included in ``foo''.

     It is a good idea to execute MKDEV with the -n option to
     check the syntax of the database files after any changes.

EXAMPLES
     The following defines the class of terminals, which consists
     of /dev/tty, /dev/ttyh0 through /dev/ttyh15, /dev/ttyi0
     through /dev/ttyi5, /dev/tty0 through /dev/tty5, /dev/ttym0
     through /dev/ttym5, and the special links to the console.


          class(tty,terminals) {
               device(tty, c, 2, 0, 622, root, bin)
               idevice(16, ttyh, 0, c, 16, 0, 622, root, bin)
               idevice(16, ttyi, 0, c, 16, 16, 622, root, bin)
               idevice(6, tty, 0, c, 0, 0, 622, root, bin)
               idevice(6, ttym, 0, c, 0, 64, 622, root, bin)
               console
          }

          class(console) {
               link(tty0, console)
               link(tty0, systty)
               link(tty0, syscon)
          }

     Executing the command ``MKDEV tty'' or ``MKDEV terminals''
     will create all of these files and links, while executing
     ``MKDEV console'' will only create links to /dev/tty0 if it
     exists.

FILES
     /dev/DEV_DB    Device database directory

     /dev/DEV_DB/*.system
                    Mips-defined device database entries




                        Printed 11/19/92                   Page 3





DEVDB(4-SVR4)      RISC/os Reference Manual       DEVDB(4-SVR4)



     /dev/DEV_DB/*.local
                    Locally-defined device database entries

     /dev/DEV_DB/*.hostname
                    Host-specific device database entries

SEE ALSO
     MKDEV(1M).

BUGS
     The syntax checking, especially with regard to commas, is
     not very thorough, and the syntax error messages are vague.











































 Page 4                 Printed 11/19/92



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026