[Top] [Prev] [Next]

Inferno Devices


The Inferno devices described in this chapter include:
audio - interface to audio devices

cmd - interface to host operating system commands

cons - console device

draw - graphics device

ip - TCP, UDP network protocols over IP

prog - interface to running programs

root - the root file system

ssl - secure sockets layer device

Hardware devices are controlled in Inferno by a file system. This is an extension of a Unix concept in which devices such as disks are part of the file system. In Inferno, each device driver is a kernel-resident file system.

Simple device drivers serve a single-level directory that can contain only a few files. For example, each UART can be represented by a data file and control file. A more complex device driver such as an Ethernet driver can be represented by a two-level file tree (Figure 2-1) to provide the following:

Example Ethernet file tree

The top directory contains a clone file and a directory for each connection numbered 1 to n. Each connection directory corresponds to an Ethernet packet type. Opening the clone file finds an unused connection directory and opens the ctl file. Reading the control file returns the ASCII connection number, which can be used to construct the name of the proper connection directory.

A kernel device driver is a server in the sense of the Inferno file protocol, Styx, with the messages implemented by local rather than remote procedure calls. (See Inferno Communications Protocol, Styx in Chapter 3.)

Advantages of Devices as File System

The representation of a device as a set of files using strings for communication has several advantages:

Pathname Resolution

Each Inferno device implements a file tree that can be attached to a name space for access by applications. The interface to all devices is via the Inferno file system interface. Each device is represented by a set of files that is implemented by a device driver.

An Inferno device implements a file tree for client processes. A file name beginning with a pound sign, such as #c, names the root of a file tree implemented by a particular kernel device driver identified by the character after the pound sign. Such names are usually bound to conventional locations in the name space. For example, after

   sys->bind("#c", "/dev", sys->MREPL)

an ls of /dev will show that the files provided by the console device were added to the list of devices in /dev.

When a system call is passed a file name beginning with #, it looks at the next character, and if that is a valid device character, it performs an attach operation on the corresponding device to get a connection representing the root of that device's file tree. If there are any characters after the device character but before the next slash character ( / ) or end of string, those characters are passed as parameter aname to the attach. (See attach, nop - messages to initiate activity in Chapter 3.)

Each kernel device has a conventional place at which a device is bound to the name space. The device synopses in the following pages include an Inferno shell bind command to put the device in the conventional place. Most of these binds are done automatically by the system when it initializes.

File names beginning with #, specify the root of a file tree that is implemented by a kernel device driver. The character following the pound sign identifies the particular device driver. Table 2-1 lists some of the standard Inferno device characters.

Kernel Device Drivers
/

Root file system, used to construct bootstrap name space

s

Limbo file channel server

F

Key file system, used for storing private keys, etc.

M

Mount driver, used to import remote file systems

C

Command execution

r

Real-time clock device, controls real-time clock and NVRAM access

I

Internet protocol device, used to implement IP communications

V

Television, provides control for ITV applications

U

Host Operating System file system

D

Secure sockets layer, provides encryption support

d

Draw device, implements raster graphics on a remote display

c

Console device, controls console I/O, keyboard and mouse processing

p

Prog device, provides query and control of status of Inferno processes

t

Serial communications device, used to implement serial communications

l

Ethernet device, used to implement Ethernet communications

E

MPEG device, controls streaming for MPEG devices

A

Digital audio input /output, provides access to stereo audio ports


NOTE:

Note: This table provides a summary of the most common characters. Other standard device characters are being added.


The kernel maintains a table that maps these device characters to device-specific operations for each type of device supported by the kernel. A kernel device driver is a server in the sense of the Styx protocol, with the messages implemented as local rather than remote procedure calls.

Convention for Numeric Data

Unless otherwise noted, numeric data returned from status and other types of files, are returned in the following standard 12-character decimal format: right-adjusted numerals with leading blanks to fill the field to 11 characters, followed by a blank. There is no trailing newline.

See Also
Introduction to Limbo Modules in Chapter 7

Inferno Communications Protocol, Styx in Chapter 3



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.