BSD 4_3_Reno release
[unix-history] / usr / src / share / man / man4 / bk.4
CommitLineData
a0556b07
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
95f51977 5.\" @(#)bk.4 6.1 (Berkeley) 5/15/85
a0556b07 6.\"
95f51977 7.TH BK 4 "May 15, 1985"
a0556b07
KM
8.UC 4
9.SH NAME
9b7cfcab 10bk \- line discipline for machine-machine communication (obsolete)
a0556b07 11.SH SYNOPSIS
9b7cfcab 12.B pseudo-device bk
a0556b07
KM
13.SH DESCRIPTION
14This line discipline provides a replacement for the old and new
15tty drivers described in
16.IR tty (4)
17when high speed output to
18and especially input from another machine is to be transmitted
19over a asynchronous communications line. The discipline
9b7cfcab 20was designed for use by the Berkeley network.
a0556b07
KM
21It may be suitable for uploading of data from microprocessors into
22the system. If you are going to send data over asynchronous
23communications lines at high speed into the system, you must
24use this discipline, as the system otherwise may detect high
25input data rates on terminal lines and disables the lines;
26in any case the processing of such data when normal terminal
27mechanisms are involved saturates the system.
28.PP
29The line discipline is enabled by a sequence:
30.PP
31.nf
32.ft B
33 #include <sgtty.h>
34 int ldisc = NETLDISC, fildes; ...
35 ioctl(fildes, TIOCSETD, &ldisc);
36.fi
37.ft R
38.PP
39A typical application program then reads a sequence of lines from
40the terminal port, checking header and sequencing information on each
41line and acknowledging receipt of each line to the sender, who then
42transmits another line of data. Typically several hundred bytes of
43data and a smaller amount of control information will be received on
44each handshake.
45.PP
46The old standard teletype discipline can be restored by doing:
47.PP
48.nf
49.ft B
50 ldisc = OTTYDISC;
51 ioctl(fildes, TIOCSETD, &ldisc);
52.fi
53.ft R
54.PP
55While in networked mode, normal teletype output functions take place.
56Thus, if an 8 bit output data path is desired, it is necessary
57to prepare the output line by putting it into RAW mode using
58.IR ioctl (2).
59This must be done
60.B before
61changing the discipline with TIOCSETD, as most
62.IR ioctl (2)
63calls are disabled while in network line-discipline mode.
64.PP
65When in network mode, input processing is very limited to reduce overhead.
66Currently the input path is only 7 bits wide, with newline the only
67recognized character, terminating an input record.
68Each input record must be read and acknowledged before the next input
69is read as the system refuses to accept any new data when there
70is a record in the buffer. The buffer is limited in length, but the
71system guarantees to always be willing to accept input resulting in
72512 data characters and then the terminating newline.
73.PP
74User level programs should provide sequencing and checksums on the
75information to guarantee accurate data transfer.
76.SH "SEE ALSO"
77tty(4)
78.SH DIAGNOSTICS
79None.
80.SH BUGS
81The Purdue uploading line discipline, which provides 8 bits and uses
82timeout's to terminate uploading should be incorporated into the standard
83system, as it is much more suitable for microprocessor connections.