Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cons1x7(7) — Motorola System V 88k Release 4 Version 4.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

dcon(1A)

mvmecpu(1M)

termios(2)

console(7)

iuart(7)

ldterm(7)

termio(7)

gencon(7)

cons1x7(7)  —  SPECIAL FILES AND DEVICES

NAME

cons1x7 − hardware specific console driver for the MVME1X7 family

DESCRIPTION

This STREAMS-based driver provides console I/O when the system is running on an MVME1X7 CPU board.  This driver is accessable only through the standard console device special files /dev/console (/dev/contty00), /dev/contty (/dev/contty01), /dev/contty02, /dev/contty03, and /dev/conctl. 

The device special files eventually access the STREAMS-based console driver which, when used in conjunction with the STREAMS line discipline module ldterm, supports the termios(2) and termio(7) processing. 

The configurable parameter C1X7_TXFIFO_MAX has a default of 8 and is located in the driver master.d file.  This parameter describes the maximum number of bytes which should be written to the CD2400 transmit FIFO each time the FIFO is filled.  Values 1 through 15 inclusive are valid.  Increasing this parameter decreases the number of interrupts taken as a result of any of the serial data lines on the MVME1X7.  The characters may be placed in the FIFO at an interrupt priority and may slow the response time of the system if large amounts of data are being sent through the onboard serial lines.  If an invalid value is chosen for this parameter, it is reset to the default value and a warning message is printed to the system console. 

In addition to the IOCTLs supported in termio(7), three other IOCTLs are supported.  See the USAGE section for IOCTL details. 

USAGE

STREAM Message Processing

In addition to the IOCTLs listed in termio(7), the following cons1x7-specific IOCTLs are supported.  The optional ioctl system calls specified by termiox(7) are not supported.  The definitions for the following IOCTLs are in the file /usr/include/sys/cd2400.h. 

M_IOCTL

MSETHWHAND causes the driver to enable out-of-band flow control using CTS(Clear to Send).  This causes character transmission to begin only after CTS is active(low).  If a console port is in aysnchronous mode, then when CTS goes inactive(high) after transmission has started, the channel stops transmitting after the current characters in the transmit hold register and shift register are transmitted.  When in synchronous mode and CTS goes inactive, then the channel stops transmission after the current frame.  Transmission restarts after CTS goes active.  Also, MSETHWHAND sets a receive FIFO threshold of 10 characters.  Automatic hardware flow control(DTR/DSR) activates when the FIFO threshold is reached. 

MCLEARWHAND causes the driver to clear the flow controls set by MSETHWHAND.  The hardware then returns to the no flow control state. 

MGETHWHAND causes the driver to return the current status of CTS and DTR/DSR hardware flow control.  The driver returns a data structure of type HWhandshake.  HWhandshake is defined in the file /usr/include/sys/cd2400.h.  HWhandshake.stat will equal HDFLOW_ENABLED if flow control is on and HDFLOW_DISABLED if it is off. 

An example of code to implement each IOCTL is listed below:


#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termio.h>
#include <termios.h>
#include <sys/cd2400.h>
#include <stropts.h>
 struct strioctl command ;
 int sethwhandshake(int fd)
{
int err=0 ;
 command.ic_cmd = MSETHWHAND ;
command.ic_len = 0 ;
command.ic_dp = NULL ;
  if ( ioctl(fd, I_STR, &command) < 0 ) {
   printf("ioctl error sending command to console driver") ;
   err = -1 ;
}
 return(err) ;
}
 int clearhwhandshake(int fd)
{
int err=0 ;
 command.ic_cmd = MCLEARHWHAND ;
command.ic_len = 0 ;
command.ic_dp = NULL ;
  if ( ioctl(fd, I_STR, &command) < 0 ) {
   printf("ioctl error sending command to console driver") ;
   err = -1 ;
}
 return(err) ;
}
  int gethwhandshake(int fd)
{
int err=0 ;
 HWhandshake shake;
 command.ic_cmd = MGETHWHAND ;
command.ic_len = sizeof(shake) ;
command.ic_dp = (char ∗) &shake ;
  if ( ioctl(fd, I_STR, &command) < 0 ) {
   printf("ioctl error sending command to driver") ;
   err = -1 ;
}
 if (shake.stat == HDFLOW_DISABLED )
   printf("Hardware handshake is DISABLED") ;
 
if (shake.stat == HDFLOW_ENABLED )
   printf("Hardware handshake is ENABLED") ;
 return(err) ;
}

FILES

/dev/console
/dev/contty
/dev/contty??
/dev/conctl
/usr/include/sys/cd2400.h
/usr/include/sys/cons1x7.h

SEE ALSO

dcon(1A), mvmecpu(1M), termios(2), console(7), iuart(7), ldterm(7), termio(7).  gencon(7). 

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