Commit | Line | Data |
---|---|---|
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 | 10 | bk \- line discipline for machine-machine communication (obsolete) |
a0556b07 | 11 | .SH SYNOPSIS |
9b7cfcab | 12 | .B pseudo-device bk |
a0556b07 KM |
13 | .SH DESCRIPTION |
14 | This line discipline provides a replacement for the old and new | |
15 | tty drivers described in | |
16 | .IR tty (4) | |
17 | when high speed output to | |
18 | and especially input from another machine is to be transmitted | |
19 | over a asynchronous communications line. The discipline | |
9b7cfcab | 20 | was designed for use by the Berkeley network. |
a0556b07 KM |
21 | It may be suitable for uploading of data from microprocessors into |
22 | the system. If you are going to send data over asynchronous | |
23 | communications lines at high speed into the system, you must | |
24 | use this discipline, as the system otherwise may detect high | |
25 | input data rates on terminal lines and disables the lines; | |
26 | in any case the processing of such data when normal terminal | |
27 | mechanisms are involved saturates the system. | |
28 | .PP | |
29 | The 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 | |
39 | A typical application program then reads a sequence of lines from | |
40 | the terminal port, checking header and sequencing information on each | |
41 | line and acknowledging receipt of each line to the sender, who then | |
42 | transmits another line of data. Typically several hundred bytes of | |
43 | data and a smaller amount of control information will be received on | |
44 | each handshake. | |
45 | .PP | |
46 | The 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 | |
55 | While in networked mode, normal teletype output functions take place. | |
56 | Thus, if an 8 bit output data path is desired, it is necessary | |
57 | to prepare the output line by putting it into RAW mode using | |
58 | .IR ioctl (2). | |
59 | This must be done | |
60 | .B before | |
61 | changing the discipline with TIOCSETD, as most | |
62 | .IR ioctl (2) | |
63 | calls are disabled while in network line-discipline mode. | |
64 | .PP | |
65 | When in network mode, input processing is very limited to reduce overhead. | |
66 | Currently the input path is only 7 bits wide, with newline the only | |
67 | recognized character, terminating an input record. | |
68 | Each input record must be read and acknowledged before the next input | |
69 | is read as the system refuses to accept any new data when there | |
70 | is a record in the buffer. The buffer is limited in length, but the | |
71 | system guarantees to always be willing to accept input resulting in | |
72 | 512 data characters and then the terminating newline. | |
73 | .PP | |
74 | User level programs should provide sequencing and checksums on the | |
75 | information to guarantee accurate data transfer. | |
76 | .SH "SEE ALSO" | |
77 | tty(4) | |
78 | .SH DIAGNOSTICS | |
79 | None. | |
80 | .SH BUGS | |
81 | The Purdue uploading line discipline, which provides 8 bits and uses | |
82 | timeout's to terminate uploading should be incorporated into the standard | |
83 | system, as it is much more suitable for microprocessor connections. |