next up previous index
Next: Restartability Up: Chapter 3: Modifications to Previous: Refnums and File Descriptors   Index

GNO/ME Character Devices

GNO/ME supports a new range of character device drivers. These drivers are not installed like normal GS/OS drivers, but they are accessed the same way. There are the following built-in drivers:

.TTYCO
This is the GNO/ME console driver. The driver supports the TextTools Pascal control codes, plus a few GNO/ME specific ones. These are documented in Chapter 4 TextTools Replacement. This driver is highly optimized both through the GS/OS and TextTools interfaces.
.TTYA[0-9,A-F]  
.PTYQ[0-9,A-F]
Pseudo-terminal devices; PTYs are used for interprocess communication and in network activities.
.NULL
This driver is a bit bucket. Any data written to it is ignored, and any attempt to read from it results in an end-of-file error ($4C).

Just as with GS/OS devices, these GNO/ME drivers are accessed with the same Open, Read, Write, and Close calls that are used on files. Unlike GS/OS character devices, the characteristics of GNO/ME drivers are controlled through the ioctl(2) system call. The GS/OS Device calls (like DInfo, DStatus) are not applicable to GNO/ME drivers. See the ioctl(2) and tty(4) man pages for details.

Some GS/OS calls will return an error when given a refNum referring to a GNO/ME character driver or pipe because the concepts simply do not apply. The error returned will be $58 (Not a Block Device), and the calls are as follows:

$2016 SetMark
$2017 GetMark
$2018 SetEOF
$2019 GetEOF
$2015 Flush
$201C GetDirEntry

GNO/ME loaded drivers (generally for serial communications, but other uses are possible) are configured in the /etc/tty.config file. Each line in /etc/tty.config describes one driver. The format of each line is:

    filename slot devname

devname is the name of the device as it will be accessed (for example, .ttya). slot is the slot in the device table from where the device will be accessed; it may refer to one of the physical expansion slots, as TextTools will use the specified driver when redirecting output to a slot. The modem and printer port drivers are configured for slots 2 and 1, respectively.

Pseudo-terminals are pre-configured into the kernel. PTYs are discussed further in Chapter 6 Psuedo-Terminals PTYs.

Since .ttyco and the pseudo-terminals are preconfigured in the GNO kernel, entries for these devices do not appear in /etc/tty.config.


next up previous index
Next: Restartability Up: Chapter 3: Modifications to Previous: Refnums and File Descriptors   Index
Feedback