INTRO(4) — SPECIAL FILES
NAME
intro − introduction to special files and hardware support
DESCRIPTION
This section describes device interfaces (drivers) in the operating system for disks, tapes, serial communications, high-speed network communications, and other devices such as mice, frame buffers and windows. The section is divided into a few subsections:
•Sun-specific drivers are grouped in ‘4S’.
•Protocol families are grouped in ‘4F’.
•Protocols and raw interfaces are treated in ‘4P’.
•Network interfaces are grouped in ‘4N’.
The operating system can be built with or without many of the drivers listed here. For most of them, the SYNOPSIS section of the manual page gives the syntax of the line to include in a kernel configuration file if you wish to include the driver in a system. See config(8) for a description of this process.
Several manual pages will contain SYNOPSIS sections specific to the Sun-2 and Sun-3 architectures. Where a SYNOPSIS section appears without any specific architecture against it, it applies to both the Sun-2 and Sun-3 architectures. Where a SYNOPSIS section appears with only one specific architecture against it, it applies only to that specific architecture.
The pages for most drivers also include a DIAGNOSTICS section listing error messages the driver may produce. These messages appear on the system console, and also in the system error log file /usr/adm/messages.
DEVICES ALWAYS PRESENT
Drivers which are present in every kernel include a driver for the paging device, drum(4); drivers for accessing physical, virtual, and I/O space, mem(4S); and drivers for the data sink, null(4).
COMMUNICATIONS DEVICES
Communications lines are most often used with the terminal driver described in tty(4). The terminal driver runs on communications lines provided either by a communications driver such as mti(4S) or zs(4S) or by a virtual terminal. The virtual terminal may be provided either by the Sun console monitor, cons(4S), or by a true pseudo-terminal, pty(4), used in applications such as windowing or remote networking.
MAGNETIC TAPE DEVICES
Magnetic tapes all provide the interface described in mtio(4). Tape devices for the Sun include ar(4S), tm(4S), st(4S), and xt(4S).
DISK DEVICES
Disk controllers provide standard block and raw interfaces, as well as a set of ioctl’s defined in dkio(4S), which support getting and setting disk geometry and partition information. Drivers available for the Sun include xy(4S), ip(4S), and sd(4S).
PROTOCOL FAMILIES
The operating system supports one or more protocol families for local network communications. The only complete protocol family in this version of the system is the Internet protocol family; see inet(4F). Each protocol family provides basic services — packet fragmentation and reassembly, routing, addressing, and basic transport — to each protocol implementation. A protocol family is normally composed of a number of protocols, one per socket(2) type. A protocol family is not required to support all socket types.
The primary network support is for the Internet protocol family described in inet(4F). Major protocols in this family include the Internet Protocol, ip(4P), describing the universal datagram format, the stream Transmission Control Protocol tcp(4P), the User Datagram Protocol udp(4P), the Address Resolution Protocol arp(4P), the Internet Control Message Protocol icmp(4P), and the Network Interface Tap nit(4P). The primary network interface is for the 10 Megabit Ethernet; see ec(4S), ie(4S), and le(4S). A software loopback interface, lo(4) also exists. General properties of these (and all) network interfaces are described in if(4N).
The general support in the system for local network routing is described in routing(4N); these facilities apply to all protocol families.
MISCELLANEOUS DEVICES
Miscellaneous devices include color frame buffers cg∗(4S), monochrome frame buffers bw∗(4S), the console frame buffer fb(4S), the graphics processor interface gpone(4S), the console mouse mouse(4S), and the window devices win(4S).
GENERAL IOCTL CALLS
In general, ioctl calls relating to a specific device are mentioned with the description for that device. There are however a bunch of ioctl calls that apply to files in general. These are described here. The form of the ioctl call for file control is:
#include <sys/ioctl.h>
ioctl(fd, request, argp)
int fd, request;
int ∗argp;
FIOCLEX Set set close-on-exec flag for the file descriptor specified by fd. This flag is also manipulated by the F_SETFD command of fcntl(2). The argp argument is not used in this call.
FIONCLEX Remove close-on-exec flag for the file descriptor specified by fd. The argp argument is not used in this call.
FIONREAD Returns in the long integer whose address is argp the number of immediately readable characters from whatever the descriptor specified by fd. refers to. This works for files, pipes, and terminals.
FIONBIO Set or clear non-blocking I/O. If the value pointed to by argp is a 1 (one) the descriptor is set for non-blocking I/O. If the value pointed to by argp is a 0 (zero) the descriptor is cleared for non-blocking I/O.
FIOASYNC Set or clear asynchronous I/O. If the value pointed to by argp is a 1 (one) the descriptor is set for asynchronous I/O. If the value pointed to by argp is a 0 (zero) the descriptor is cleared for asynchronous I/O.
FIOSETOWN Set the process-group ID that will subsequently receive SIGIO or SIGURG signals for this descriptor.
FIOGETOWN Get the process-group ID that is receiving SIGIO or SIGURG signals for this descriptor.
SEE ALSO
Sun Release 3.2 — Last change: 25 July 1985