Text-Terminal-HOWTO

David S. Lawyer

v0.05, June 1998



--------------------------------------------------

Translated by Ilgiz Kalmetev (2:5011/36.6@fidonet)

--------------------------------------------------



  ,    ,   ,  

          . 

   ,        .



         Linux,   

     /  Unix- .



______________________________________________________________________









1. 



  1.1  ,    

    1.1.1  

    1.1.2 

    1.1.3   

  1.2   ?

  1.3 Dumb 

  1.4  

    1.4.1  

    1.4.2  

    1.4.3    

    1.4.4    (    )

    1.4.5 - (= -)

    1.4.6  

  1.5 



2.  



3.   ?



  3.1 

  3.2    

  3.3   

  3.4  

  3.5   

  3.6   

  3.7     ?



4.   ,    ( Linux)



  4.1  

  4.2 / / 

  4.3 /- 

  4.4  

  4.5  

  4.6  ,    terminfo

  4.7 

  4.8 

  4.9 



5.   : /dev/tty ...  ..



  5.1   

  5.2 

  5.3   /dev/tty

  5.4 "" /dev/ttyI? 

  5.5 : /dev/tty?

  5.6     mknod



6.     



  6.1  

  6.2  

  6.3    escape-

    6.3.1  

    6.3.2 Escape-



7.    



  7.1 

  7.2  

  7.3  Printer/Auxiliary

  7.4  

  7.5 

  7.6    

  7.7  Linux

    7.7.1    



8.    



  8.1 CIT

  8.2 IBM

  8.3 

  8.4 VT (DEC)



9.    EIA-232 (RS-232)



  9.1 

  9.2 

    9.2.1   

    9.2.2    

  9.3  , 

  9.4   ()

  9.5  EIA-232

    9.5.1     

    9.5.2  EIA-232

    9.5.3  

  9.6   

    9.6.1   "" 

    9.6.2  -    

    9.6.3  

  9.7  

    9.7.1 

    9.7.2   , 

    9.7.3 

  9.8   EIA-232 (RS-232)



10.    ( )



  10.1     ?

  10.2   

  10.3   

  10.4  

  10.5     (RTS/CTS  ..)

    10.5.1    RTS/CTS  DTR

    10.5.2     DTR     RTS/CTS

    10.5.3      RTS/CTS

    10.5.4  

  10.6      ?

  10.7     ETX/ACK



11.  



  11.1   .

    11.1.1   - ()

    11.1.2   

    11.1.3  



    11.1.4 A Kludge using Twisted-Pair Cable

    11.1.4 ,   



    11.1.5  



  11.2  

    11.2.1    

    11.2.2     

    11.2.3  

  11.3    

  11.4    

    11.4.1   ?

    11.4.2   



12.  ()  ,  



  12.1 

  12.2  

  12.3  

    12.3.1 inittab

    12.3.2 stty  setserial

    12.3.3 setserial

    12.3.4   setserial?

    12.3.5 stty

    12.3.6    stty?

    12.3.7 terminfo  termcap ()

  12.4    

    12.4.1 

    12.4.2  

    12.4.3 /

    12.4.4     ?

  12.5    /etc/ttytype

  12.6    



  12.7      ,  TERM=my_term_type



13. terminfo  termcap ()



  13.1 

  13.2   terminfo

    13.2.1  terminfo (tic)

    13.2.2   terminfo

    13.2.3.   

  13.3 

  13.4  TERM

  13.5  termcap



14.  



  14.1 

  14.2  

  14.3   

  14.4   

    14.4.1 

    14.4.2  ,  

    14.4.3    

  14.5  () 

    14.5.1    

    14.5.2  (& Quit, Suspend, EOF, Flush)

    14.5.3 

    14.5.4.    

  14.6  

  14.7   

    14.7.1 setterm

    14.7.2 tput

    14.7.3 echo

    14.7.4  



15.   ( )



  15.1   

  15.2   

  15.3   ?

  15.4  

  15.5 getty   

    15.5.1    



    15.5.2  

  15.6      

  15.7    

  15.8       (login prompt)

  15.9        

    15.9.1    

    15.9.2  

  15.10     

    15.10.1 Breakout ,  ..

    15.10.2  

    15.10.3    



16.   



  16.1     -

    16.1.1 

    16.1.2 

  16.2 

  16.3  

  16.4 

    16.4.1   

    16.4.2    

  16.5 

  16.6 

    16.6.1 

    16.6.2   

    16.6.3     2  

    16.6.4    

    16.6.5    

    16.6.6   b  bb,  .. ( )

    16.6.7   

    16.6.8 ,   

    16.6.9   

      16.6.9.1   

      16.6.9.2    



17. 



  17.1    Linux

    17.1.1    

    17.1.2    

    17.1.3 Terminfo

    17.1.4 

  17.2   

    17.2.1     

    17.2.2   

    17.2.3    

    17.2.4     





______________________________________________________________________



1. 



      ,  . `` 

".





1.1.  ,    



1.1.1.  



   David S. Lawyer (1998). ,  

    .    (   

    )   ,      . 

   -   ,     

  .  "MS WINDOWS NT" ,  "Windows NT" 

 Microsoft (MS). Mac -   Apple.





1.1.2. 



    HOWTO        

 (       ).



           ,    

    . ,    .  

 ,         .





1.1.3.   



 email  1998 - bf347@lafn.org. ,       

, , ,  , ,  , 

,  ..  ,       

,           

. ,    ,    ,  

    .





1.2.   ?



     ,   ,  

    ().   ,   - 

 ,       (  

       ).    

 ,      . 

   -   (    

,   ).



       , 

   (,   ).



      1970-   1980-   

 ,    .    

,  ,  ,    

 ..       ( ).

   ,        

  ( ).



     Linux (  X-Window)  

  ,       ,    

  (  " ").  (  

)  ,     .



    ,     

 .       

    .  ,    , 

     ,     

    .     

,    .    

     ,      

,   ,   ""  . 

      .



  ,  ,   -  ,   

 -  .    ,   "" 

     ,      

 ,      .



 -         . , ,  

    Linux ( Alt-F2,  ..).  

    ,    ,   

   .      

  ,        

       .





1.3. Dumb 



  ,     "dumb 

",    ,      

 dumb.        

,      .



     "Dumb-Terminal-HOWTO",     

  ,    , 

     (GUI),  

dumb.    "dumb",      "dumb"  

 (   ,     

   "" ). -  

 "dumb "      .





1.4.  



1.4.1.  



    ,    ,  

  .     ASCII,   

   . ,      

,         . 

  (  )    

,   ,  ,     

 /  /    ..



     ,      

 .



   (),     

    .   128   256 

    ASCII.   unix-  

     ,   

   ( RS-232-C = EIA-232-D)  

  .        

  ..



     - " ", 

"   ", "ASCII ", "ANSI ", 

" ", " ", " "  "

" (VDT).



       " " (VDU), 

  ,    .



   IBM  " ". ,   

,      (    

   ). ,     ( 

-   ),   (   )  

 .       Linux.  

    (  ). .  

`` ".





1.4.2.  



    ASCII      

 .   : < ---     

 _  |.



    ,   .  

       .   

" "      ,   

 -   .



     :    ( 

).         

,    (,      

 ).      

,       ,   

   .      

  ,     .    

  .  PC   , 

    ,     

     (   ).





1.4.3.    



       .      

   . Protocalls    

: Tektronix Vector Graphics, ReGIS (DEC), Sixel (DEC)  NAPLPS (North 

American Presentation Level Protocall Syntax).   ??





1.4.4.    (    )



        . ,   

 , -   ,   

     ,   PC.    

 .



,       (  ). 

       ,  

    .  X-Window     

.



  MS-Windows GUI       

:    Winterm,    WinFrame 

 Citrix.  (    Citrix) - Hydra ( )  

Microsoft,    "Windows Terminal Server",    

 MS WINDOWS NT 4  . Citrix   ICA,   

   Hydra,   pICAsso,  WinFrame (ICA) 

    Hydra. Hydra   

.   "  " 

 Unbounded Technologies  Tektronix   , 

    Hydra.  1997    , 

 Winterm "dumb ",       .

    " ",    

 -  ,   ,      

Java,  ,  ..





1.4.5. - (= -)



"" -    ( ).      

,  ,     .  

 (NC'S) -    ,    . 

       .   

  ,       

.     Java.     IP  

       Linux. Wintel  "NetPC" ,  

  NC,    PC.



,      ,      

      -.





1.4.6.  



 PC     (  ),      

  ,       

 ,    .  

          MS WINDOWS. 

     -   ( 

Minicom  Linux) ,    ()   

,       (   

 ).     VT100 ( ). 

  -  100%-,       .



   ,   .    , 

       ,      

   .     

   ,  -   

.





1.5. 



  ,   .      Linux 

  ( ),       

  .       

()    . ,  

    2  :??  , 

  ,     (  ).





2.  



      ,    

 ``"   ,    .  

     ,      

  .   -    ,    

         

  .



  ,    /etc/termcap  terminfo.src, 

     (. ``Terminfo  Termcap ()").  

"vt100",     - . ,   

      tty    (

ttyS1, . `` ".  root  /etc/inittab,   

 getty    getty.   getty   , 

  getty   (. Serial-HOWTO 4.1  7.2, / 

 "man getty").



  getty   terminfo ( termcap) ( vt100)  

 .      ,  

 .        , 

     (. ``  ").



         

- ,   .  ,   

       . 

,          

 ,     getty.      "init 

q",   ,      inittab.   

       .  ,   

 RETURN .    ,     , 

/ . `` ".





3.   ?



3.1. 



PC   ,        

   , ,      

   ,  ,  ..    

    ,         

   .     

 ,   Linux.   "  

",        ,   "" 

   -      .   

   "" .     

       ,    

  ,        

"" .



    PC,     ,

   (Windows, DOS,  Mac)     

1998 (  MS WINDOWS NT)     . , 

    Linux   

  PC,    PC   . 

   ,   ,   , 

     (GUI),   

    .





3.2.    



          ,  

    ,     

  .    -   

.          

   (,     ,   

         ).   - 

  .    PC   

         , 

,       .   

          ,  

    .



  .   ,   9  (8   

1 )  PC      3- 

   ( ,  , 

(),  ..),   PC,      

    (9- ).  

        

          .



,     (- , 

, ,  ..) -       

.          

     .



    PC,        

   PC.  ,     Linux 

(X-Window)    -      , 

           .  

     .





3.3.   



  ,   (   

 )        

  . ,    ,  

  ,   .  ,  

,   , -      

    .    

    (   

   )        

 .      -    

.





3.4.  



  ,      

    .     .



          

  ,   PC (       

 ,  PC),      

,    PC,   .





3.5.   



1.       ,   

2.           

       .     .





3.6.   



1.    ,      

    (   ),     

     ,     ..   

         .

2.    ,      

   (      ).





3.7.     ?



   ,      

     (    

).    ,  1980     

  .      ,    

        

  10%  20%.



,         :



       .



     Linux - X-Window ,  

      PC   Linux.



    -   ,   

        ( ) .





4.   ,    ( Linux)



.   ``   ,   "





4.1.  



        (  

PC).   : ttyS0, ttyS1, ttyS2  ..



     ,     

/dev. /dev/ttyS0  COM1  DOS  Windows. ttyS1 - COM2,  .. 

. `` "  .





4.2. / / 



    -    getty (. 

Serial-HOWTO 4.1  7.2)    ,    

 (    /etc/inittab).  getty  

 "login",     .    

 "login: ".       (  

 )      .    

 ,       . . 

``   "        

(      ).





4.3. / 



 -   ,      . 

    ,  ,   ,   

   ,     ( ). 

 ,    ,     

( ),         

  .    (    

 )       .





4.4.  



  -    ,    

        .   

,     ,    

      ,     

    ( 60   )   

. .  `` ".





4.5.  



  .    

      ,      

,   .   `` " 

()  ``escape-". ,   CR 

( )      .  

escape- ( ,    -   

"Escape")       ,  , 

  escape-.



`` "     ,   

,   .        

:  , , ,    

.     "",   -  

   ,   .   

    .    

.       .    

  .       

,    ,     , 

    .    ,     

    .





4.6.  ,    terminfo



    ,   ,    

    ASCII ( IBM-,  

 EBCDIC), ,  ,    

escape-.       

 ANSI,        .  

,         

.



   . ,     

escape-,        

 ,  ,     .



       ,  "termcap" 

( "terminfo").          

    (  )    

.    ( VT100)   , 

    escape-  .. . 

 ``termcap  terminfo ()"  .   

    ,     C-. 

     (  200)  "ncurses"  

  man-  ncurses.





4.7. 



  TERM  Linux,     . 

   ,      

  terminfo,    TERM    

.     ,     

 .



 ,     ,     

,         (  ),    

   .       19,200 , 

      9600 ,      

 (  ).



       (     

) -   ""  .    

      "".



       

,        .





4.8. 



         

().



      DEC (Digital Equipment 

Corporation)   VT (, VT100).   ,  

VT100,      VT100. Wyse -   

,         

DEC,   VT100  VT220.  ,   , , 

  VT320,      VT320  

"" ,    -  

,   VT320. ""    

 ,  ,    ,   

 "".



    -   PC    - .  

 ,    PC.  Linux (   

  X-Window)  PC ( )  . 

    X-Window  .



4.9. 



 PC    .     "Linux". 

      . . ``: /dev/tty?". 

         .  , 

    ,   ,    

 Linux. (., ``  ").





5.   : /dev/tty ...  ..



"tty" -   "".     ( 

   ). .  ``".





5.1.    



       .



         () 

/dev. /dev/ttyS0 -     ,   

COM1   DOS/Windows.    ,   

         

  .   "echo test> /dev/ttyS1" 

   "test"  ,   COM2 (, 

     /dev/ttyS1).     

"cat my_file > /dev/ttyS0"    my_file  COM1 (ttyS0).



   ttyS0 (/dev/ttyS0), ttyS1, ttyS2,  .. ("S"  

 )     "cua": cua0, cua1, cua2, 

 ..



ua0 -      ttyS0  .. "Cu" cua  CalloUt.  

 ttyS  Posix,       cua  

 ,      ,    . 

   ,   cua     ,  

      ttyS.





5.2. 



        .



     . ,  - 

  telnet     ,    

  /dev/ptyp2 ( ).  XWINDOWS,   

 xterm  .



     .   

      2   

,         

.



    ttyp3  ptyp3. pty... -    

 ,  tty... - . ttyq5 -  , 

 - ttysc ( -  ).



 ,   - /dev/pty[p-s]n,   

 - /dev/tty[p-s]n,  n -  .





5.3.   /dev/tty



/dev/tty    ( )    

(,   "/dev/tty"  ).  ,   

tty  ,   "ps -a"   . 

  "tty".  ,    , /dev/tty - 

 ,    .



 "tty"   ,     (. 

man tty(1)). /dev/tty -        

        C : 

. man tty(4).





5.4. "" /dev/ttyI?



?   .      Linux -    

ISDN: isdn4linux. ttyI?    ttyS? .   cui? , 

  -  cua?. ttyI  cui     

  .





5.5. : /dev/tty?



 Linux  PC        

,   : tty0, tty1, tty2  ..     

,    tty1.    tty2  Alt-F2. tty1, 

tty2,  .. - " " (  " 

").         

           

 .    ,   Alt-F?,  "?" 

   ,     .  

   /dev/tty0,         

    .    root    

/dev/tty0,     /dev/console.    

        

 ,   /dev/tty0.    

   . `` Linux".





5.6.    mknod



  /dev     .   

   ,        "mknod". . 

man- tty(4)    ,      

.   mknod,    major  minor  

.      ,    "ls -l"

  /dev.   major  minor    

.





6.     



     ,     : 

``",   ``   ".





6.1.  



     60     

 ,     .  PC   

    ,   ,   

  .       

   .  ,      

          , 

     .



,        ASCII , 

      .     2 ASCII 

.    ,      ()

    100   ASCII.     

, , 15 ,    1.5   

    ASCII ().   ASCII   

  ,      

    60   .    

,       "e",    "e" 

,     .     

        1980-,  

       ,   ( 

  ).





6.2.  



   -     , 

    "" (  )  , 

   .     ``". 

           , 

     ,    . -  

    ,  "dumb".   

  (  ,  "dumb")  

 ,         

  .





6.3.    escape-



   ,     ,  

     ( )    

.         

    ,     

,   .      :  

 ( )  escape-.





6.3.1.  



  (  )    32  

 ASCII.    :   (   

  ),   (     ), 

   ,  ESC,   .    

  .   ,      

,      .   - 

 "  ".    ,    

   ,   escape-, 

     escape,   . 

,       ,    

 . Escape- ,    

  ,     ,   

escape-.





6.3.2. Escape-



       ,   

,   escape-.    

  "Escape" (ESC),   

 .    ESC,    

  ,        

 ,   .    

 ,   ,   

 (         

escape-).  escape-   

 ( )    ,     

.    escape-.



 escape-       

  .      ,    

     .     ,  

  .  vt100,     .  

     ( ESC [5m)   

    .       

   ,   termcap (terminfo)     

. . ``Terminfo  Termcap ()"    / ``

 termcap"  .  , termcap (terminfo)     

  escape-,     

 ,  ,   -   .





7.    



7.1. 



       -  ,    

 "" ,       

.



    (   =  ).



            

,           

 .



,    ..   .



, - ()    ,    

,   .       

 ,         .



     ,   .



         .



     ,     

   (3 ).     

 ,       ,   

 .        

 ,         

 .      ,   

  .





7.2.  



      .     

    .    

    ,    

  ,  .   ,  

         

""  (  ).       

         

  ( " "  ).





7.3.   Printer/Auxiliary



    ,  ,      

  .        

,        .   

 ,          .  

 -  ,         

      . ,   

     ,        

   .



    " ",    

    .



     escape-  

  .    ,    

   .





7.4.  



     ( ,  ) 

    ,    .



      0  255 ( 00  FF  

  ).



 -,      " ".  

   ,     .     

    ,       .



ASCII -      ,    

.



 - 7- ,     8-,    ( 

 )    0.     

 (    ,     

 ASCII).      -   

 ASCII,    (     1) 

    .



  -   ISO .    

 -ASCII  ,      

       .



 ASCII,      ,  - 

8-.



CP    CodePage,  IBM: CP-437 (DOS ECS), 

CP-850 (  Latin 1 -- ,   ISO Latin-1), ISO-8859-1 

(Latin-1), ANSI (  Latin-1). MS Windows  ANSI,    

    Latin-1.   

  ISO-8859    Latin-1.    

(-7),   (-6),  (-2)   (-5).  

 . , KOI8-R    ,  IS0-8859-5. 

Unicode -    ,     2 

   .



   :



  <http://www.cc.columbia.edu/kermit/charsets.html>    

      .

  <http://www.pku.edu.cn/on_line/w3html/International/Overview.html>  

        .

  <http://www.w3.org/International/O-charset-lang.html>

  <http://vancouver-webpages.com/multilingual/>



        ( ),  

        .





7.5. 



 ,    1980-   

 .  ,       

 ,       .   

     ,     

 .       BitFontEdit 

(   )      

<http://www.cs.utk.edu/~shuford/terminal_index.html>





7.6.    



     ,     PC. 

      ,      

 ,   .    

    ,    

.      ,   , 

      ,     

  ( shift  control).



 BREAK  0  (+ 12 V)     300  700 

     .        

  ,  stty  brkint,   ,  ignbrk 

  .



 NO SCROLL   ,    ^S. 

    .      

   .



 REPEAT,     ,     

    ,     .



 LINE FEED     ^J   .

   .



 SET-UP      .

          , 

      .



 LOCAL     .    ,  

      .   .



 RETURN  - ,   ""  PC.     

     ,        

     .       

     - .



 F1, F2, ...  PF1, PF2, ... -  ,    

  ,     ().





7.7.  Linux



   PC Linux -  .    

 "Linux".      ,   vt100,

  .



          

 ( ,    ,    

     ).    

      ,    

  ,        . 

   (. Keyboard-and-Console-HOWTO,  Keyboard-HOWTO), 

    .  ,   

  -,   VGA,  ,    

  .   Linux,   

  ,      (., `` 

 ").





7.7.1.   



      .



   , ,     ,   

  dmesg.    ,    

    ,    .



       Linux.



   ,     .  

     ,       

 ,      .



Linux    1997     .   

 Linux   #defines  

src/linux/drivers/char/console.c:



______________________________________________________________________



#define CONFIG_SERIAL_ECHO

#define SERIAL_ECHO_PORT 0x2f8  /* Serial port address  */

______________________________________________________________________





      ,  ,  

   ( LILO),       

,       /etc/lilo.conf . . man  

lilo.conf   "serial=".





8.    



        ,   

  (      ).   

    ,     

  .    ,     

,          . , 

           

 terminfo ( termcap)   /etc/termcap  terminfo.src.





8.1.   CIT



CIT       1980-  CIE erminals.



     1980-. , CIE,   

  CITOH ( 1997),       . 

Ernie  (714) 453-9555  Irvine CA  ( 1997)    

 224, 326,  ..      80  101. (,  

  ,      101e.)



   Setup  ^S   . 



cit80: :     , 

cit101e: :    /   .





8.2.  IBM



  IBM   IBM PC.   IBM   ASCII,  

 8-  EBCDIC.   EBCDIC    

 ,      .   

IBM -       (   ). 

   - "BISYNC"  "SNA" (   

).        (RG62A/U), 

    ,   "BNC"   -   

 ethernet (   ).



      IBM     ,   

  Linux,    IBM       

 Linux. ,  IBM  -  ASCII   

   Linux  PC.    31xx   ASCII 

 317x  319x.



  IBM , ,   termcap 

(terminfo)  .   ,       Linux. 

   terminfo,    . ,  termcap 

 327x,  3270 -   EBCDIC.



 3270  3278 (  1970-), 3279    ,  

  3274 (  3174).



  ,   BISYNC,   SNA. 3290   

 (  ).



 IBM       IBM,   

  " " (  " 

"  " ").      

     ,     

       unix-  

   .       - 

 . .  `` ".





8.3. 



       .   

   ,    .   

1920- Teletype Corp.      30   

.        

  .  Baudot    5     

  7- ASCII. .  "    

" Sol Libes, Hayden Books, 1978: pp. 138-141 ("Teletypes").





8.4.   VT (DEC)



Digital Equipment Corporation     VT,  

  VT100.  1995       

SunRiver,    Boundless Technologies.  

   Shuford's Website.



      website Boundless Technologies. . 

``    ".



VT220:   BNC     (  ).





9.    EIA-232 (RS-232)



9.1. 



   Unix-  (  PC)    

 232   .  -  RS-232-C, 

EIA-232-D,  EIA-232-E.         .  

 RS  EIA (  )   EIA/TIA 

  EIA  TIA (   ). 

EIA-232      (sync) ,  

    sync  PC   . RS 

 ,    .     

  EIA.



   7-  ASCII  ,   

,   1990     , 

  8-  (256  ).   

  ,       

Serial-HOWTO      ASCII.



  -  ,       

  .   ,    

,    EIA-232.   

 25 ,     .  

   9 .   ,   

 ,  ,    .   -  

.  ""       

      "off"   

   "on".



 UART (  )  

  .      

    .





9.2. 



9.2.1.   



   EIA-232,   (  

  )       12 

 ( - 5  10 ).      

+12  -  0 (  "")  -12  -  1 

(  "").     ,  

 0  false  ,       true  

.      -  , 

  (  ) -     

,  true ( "on",  ""),   

,  false ( "off",  "").  

     (  ,   ).



  .  ,   

     5  15 ,     

 25 V.    3 V -    

 (        

).   ,    5  (

 3 ),    10-12 .     EIA-422

  Mac  EIA-232 (  )  EIA-423,  

    5 V.     

12 V.        ,    

   ,    -  1,  

,  EIA-232      .



 ,       - 5 

 (  ),        

,      5  

(-)  12-  ,     

 .





9.2.2.    



   ( 2)     -12 V ().   

,    +12 V ()       

  +12 V     .     

  .    0,   ,     

+12 V     .    ,  

..            -12 V 

() -   .



   -12 V ()    .  , 

  0 V        (  

 ) ,       

,  2      (  

  ).



2-     -12 V,     .    

,       ,   , 

 2-   - ,       

-12 V  .       2-  

       .    

 ,       ,    

 2  ,  ,     

 .     1 1/2   .  

,     -12 V  1  1/2  ( 

 ,      ).





9.3.  , 



    7,  8  ().



     (  )    

,       7, 8  9 .   

       9 .



      ,     

 (        ). 

         ,   

  ,    ,  .    

,       ,     

   ,   .   ,  

    ,     .   

        (  

  )      .  , 

           

 (7   ASCII  8     ISO).



"" -   1,  "" -   0.    

    .      - 

 .          

  ,  . "   "  , 

     .  ,     

9- ,    "  "   

8   ,         

.





9.4.   ()



     EIA-232 ,   

   .    PC   

 ,       ,   

  .   ,     

().          

 9, 10  11 ,  10  -    

 . 8-N-1  8  ,    

, 1  .      10 ,  

  .      .



  110 / (  300 /)  2  , 

  2-         

(  ,    -    ).





9.5.  EIA-232



9.5.1.     



   EIA-232      

  .   " ",      

         , 

    .      , 

    (   )   

    .   

      . . `` EIA-

232".



  ,   RS-232 1969      

,        .   

     1800-.  1888 (  110  )

" "      (  )

   .   ,  80 , RS-232   

 .   RS-232      

    ,  ,  

          

 .





9.5.2.  EIA-232



          EIA, 

 ()   .   

      ,   EIA-232.  

   (  )   

       .   PC  "" EIA-232, 

      ,      

,      .



  -  Mac  Apple  EIA-232/EIA-422 GeoPort,  

   ()    .   

  "-DIN" .     EIA-232, 

   5  (     EIA-232). , 

 ,  Macs    PC,     

   .      

EIA-423,     ,   EIA-232,    

  EIA-232 .  EIA-423   5 ,   

   ,  EIA-232 (    

    ,   - ,   

).



EIA-530-A (,      

)  2/ ()     

EIA-232,      .     

   25    EIA-232.   

 (HSSI = EIA-612/613)    50     

 50 /,      . 

   (USB)   PCI .  - 12 

/       4  (2  - ),   

  .





9.5.3.  



  ,   EIA-232  ,  

     .  

    .      

     ,   2@    

 ,     

 ( ).



     ,   .





9.6.   



9.6.1.   "" 



  EIA-232      ( ) 

: "" (-12 V)  "" (+12 V).  0 V ,   

       -12 V 

 -   .     , 

    ,      

.     ""   ( 

)  .



  ,       

     (  ).  

 ,    ,     , 

  .        

  7, 8  9 . (       

,       ,    

   .)    , 

  ,      

 .        

   ,       .





9.6.2.   -    



 (async)  " ". ,   - 

         , 

    .  (Sync) -  

  .      .



,   ,      

    ( ,     

).



          

 ( ,     ).



  ,       

,   .     

   ,      ,   

     /  (-      

 ),    .   - 

   ( / )      

    .    

,          .





9.6.3.  



 -  ,        

    25 ?     

   ,     PC.   

   ,      . 

 EIA-232   sync,  async,    PC  

UART (  )  16450, 16550A  16650 

    sync.  sync   USART   , 

 "S" -  "".     sync   , sync 

 , ,   .



 sync  EIA-232,      EIA.  

EIA-232, 3       ( 

).        , 

         

(  ,  "  eliminator",  

  ).



    - sync,    

      ,   

  V.42 .   /       

,        .





9.7.  



9.7.1. 



     Linux.   ,  - 

  ,         

  .       

.      (  

), ,      ,   

.  Linux  vi  emacs,     

 ,    ,      

 ,        .   

        

 .    IBM   

,    IBM -        

 (.  ``  ").





9.7.2.   , 



        "" ( 

 )  "" (  ).   ,   

 ,          

  .  ,     -  

HP2622A, VT130, VT131, VT330, VT340  Visual500.



      ,    

 .        , 

        .   

( )      ,     

 .





9.7.3. 



     , ,   

       (     

 IBM).         

        . , 

  ,         

 .   UART,       

    ,       

 .



          

  .       

  ,       

     14 ,     16- 

 .        

        ,  

        .



     ,     

  .   ,    () 

  ,     (40  TCP/IP 

).   ,       

 .





9.8.   EIA-232 (RS-232)



( :      ,   EIA-232.)



  Black, Uyless D.:     , IEEE Computer 

   Society Press, Los Alamitos, CA, 1996.



  Campbell, Joe:  RS-232, 2nd ed., Sybex, 1982.



  Putnam,  .: RS-232 , Prentice , 1987.



  Seyer,  .:   RS-232, 2- , Prentice, 

   1991





10.    ( )



      "  

".        

  ,   "" , ,   

 . "" -       

         / 

   .      

   ,   ()       

.         

,    ,   . 

        ,   .



 2    :    (Xon/Xoff).



       ,  

       ,   

  Xon  Xoff    .   

  ,     .



      2     

  2  :



  1.      

  2.       .





10.1.     ?



   : "     ,  

         

   ?".  ,    

,        .  

  - ,        

  14,500.      . 

    ,   ,  

       .  

  ,   ,      ( 

  )    ,   .  

escape-  ,    ,  

     .     

  ,  ,   ,    

 .   ,       

  .





10.2.   



  ,     ,  

   ,      , 

  ( /)  19,200.



  ,        

    , / , 

       ,   

     .



    -       

.          

 (  UART).          

 ()   ,     

,    ( ). 

   UART,   16550A,  16-  (  

    )     . 

      ,     

  1, 4, 8  14 .     ( 

   )      

      (    

).



        

 (    UART'S)  .  

 ,        

 .     ,     ( 

)    .    ()    

   (   ),    

  .



        .



         ,    

      ,     

  .



,       (),   

  .



 ,    : 1.    

  ( ). 2.      

 ( )   .





10.3.   



 ,      ,  

    .    

 ,          

 ,    (        

).        (^S = DC3 = Xoff), 

        ("" 

),         

 rts-cts ( )  ( 



 Xoff  "   ",  

       ( 

)  "   ".



     ,  "" 

.   ,     , ,  

   ,   . ,   

   , .  "" 

 ,       . 

    , ,   ,   . 

      -  , ,   

,       ,   

 .





10.4.  



         ,  

   .       

    ^Q = DC1 = Xon,    

  .        

     ()   

 ().



  ,    ,  , 

     .





10.5.     (RTS/CTS  ..)



        ,   

           

 .  , ,  DTR.





10.5.1.    RTS/CTS  DTR



Linux PC  RTS/CTS,       DTR 

(  )    (  ,  

 ). RTS/CTS   RTS  CTS   

 (EIA-232). RTS  "  (Request To Send)".



          

:     .  RTS  ( 

),  " " ,  :    

" ( ).      ,  

  RTS   ,    .  

   ( -   DTE)  RTS   

  ,   CTS (   - Clear To Send) 

 .    RTS        CTS 

  .



  (DCE ) -  ;   RTS  , 

  CTS - .         , 

     ,      

.  DTR      DTR   

,    RTS.





10.5.2.     DTR  RTS/CTS   



   DTR   .   

        

.      -,    

 .      Linux,   

   RTS/CTS?



   DTR     RTS,     

  DTR,     RTS,    CTS  

.         ( 

 ).     DTR   

      RTS/CTS     

  .       "stty local" 

    DTR        

 ,   .





10.5.3.      RTS/CTS



     , - ,   

  RTS,    

.   :      

  (Request To Send).        

 ( )  , ,    , 

    CTS   CTS   CTS : 

     (Cleared to Send).  ,    

  RTS/CTS    ,   

     :   ( )  

.



  , RTS         

,      .   

-       ,     

  ,   CTS (  CTS  ),  

  .





10.5.4.  



        (  19), 

     RTS  RTS/CTS   .  

    ,      . 

       CTS  .



  dip-    .





10.6.       ?



 ,        

,  (        

  )     

   .  UART    

          . 

      ,   

 ,        

 . ,     ,   

 .        

   ,    ,  

  ,   ,     

 .



   (   ),  

 ( ) .     

   UART,  ,     .



   ,      

    ( ) . ,    

 ,       , 

     ,   

 ( ,        

     ).



   ( 16),        

   ??



         

,   -    ,    

     .





10.7.     ETX/ACK



         , 

   .     ( async 

 ),      ETX (End 

of Text -  ) .



   ETX,  ,     

    ACK (Acknowledge - ).   

 ACK,    .   .     

Linux ??





11.  



          

,     .





11.1.   .



           - 

       .   

PC    ,       .



  EIA-232    ,    

  .  2       3   

.        ,   

 ,      ,  

     .   Serial-

HOWTO 7.1        ,  

 RTS       .   

 ??





11.1.1.   - ()



    ,    

 ,  " " (. Serial-HOWTO 2.3 

 2.4).



  ,      - ByteRunner 

<http://www.byterunner.com/cgi-bin/goto.cgi?file=iocards.html>.   

  . Computer ESP 

<http://www.computer.esp.com/INPUT_DEVICES/PARALLEL___SERIAL_ADAPTERS/>





11.1.2.   



  50           

.       , ,  

 , /  -    / 

   .     9600 ,

1000    .      

   ,   2     

 ,     

 ( )     .





11.1.3.  



        

( ),         

 (  ).    ,   

       . . `` 

  ".       

  .



       ,   

   (     ).  

       "null modem" in fine print.   

    "" (= ,  , 

. ,  2       3   , 

   "".      

 RTS  CTS ( 4  5),      

     .



 ""    ,     

          

  ( ),    

. ,        

  .     

 centronics   ,      

.     . , 

     .



11.1.4.  A Kludge using Twisted-Pair Cable



     EIA-232     ,   

    .     

,    .   ,  ""  

      2 . Only part of the signal ground 

current flows in the desired wire but it may help.  Due to the lower inductance 

of the twisted pair circuit, more return (ground) current will confine itself 

to the desired path than one would expect from only resistance calculations.  

     ,    

  .       

 .





11.1.5.  



 1    ( ),     ,

       -.   -  7,  

    .  ,       

  ""   ().  ,  

,       ,    

   ,       ,    ??





11.2.   



   - ( )    

BBS.  BBS ( )       

 lynx,      .



            

.     ,    ,  

    (  )   . 

     ,  ,  

   minicom.





11.2.1.   



 ,    ( ,  ) 

   ,  ,     

  (  )      . 

 ( )         

.



       PC  ,    

BBS  ISP,  PC     .   

    ,   ,    

            

.   ,       

     ,    

""          .



      .    

   .    

 "mgetty" (getty    )   

  ,     .





11.2.2.    



   -     .    

     ,     ,   

-  .   ,       

    (   S0   2,  

   2- ).      , ,   

,      ,   

     .



 ,     ,   ,   

 Linux "callback" (   ),   

"cb".   -         B,  B 

      .  - ,   ,   

    .      

    ,       

 ""   callback.    callback  

     . callback     

 mgetty       . Mgetty    ( 

 1998 .)     ,     

            

 .       , mgetty    

,    .





11.2.3.  



  1997           

 .  Hayes <http://www.hayes.com/support/techref/> 

       .  init 

 -      ,     

   ,    ,    

     ??





11.3.    



  -    ,   

   ( )     .  

  ,         

 ,    .



   ,     ( ) 

  ,     .  

        , 

    ,       . 

       ,  

 ,  ..        

 .



PC     ,     

       ,   

      . PC  

           , 

         .  

  ,     ,  

   .



       .   

 PC,   ,       

,    .    

  ,           

 .        

,    PPP , ,     

.





11.4.    



11.4.1.   ?



    ,   ,    ? 

     , ,    

  () 4 .     - 

 ,  ,   ,      -

,        ,    (  ). 

  -    .



   .     , 

    ,      

.



      - ,  ,  

 ,     ( )    

    .





11.4.2.   



 ,          

    .   ,    

  .        , 

     .   :   .



         

  "/".      

      ,    . 

 ,      .   

    .    

  .  One tool tip requires spreading a little to 

get it over the wire but for this tip the pin should be easier to remove.  

      .   ,

          

 .          

-, .



  ,   ,   ,   ,   

.





12.    



12.1. 



         

   .  ,   ,   

  escape-    ,  

       .   ,   

,       ,  

   .



         

       .   TERM 

            

 terminfo. . ``Terminfo  Termcap ()''.



,  "stty"  "setserial",    

 (     ).  

 ( )      , 

      .



   ,    .    

       .



:        ? (   , 

  .)    (   )  

?    ,        

?



 " "       ,   

:  ,   , /   

 .    ,    

    (        

 ).



      (    

    ).     

       ,    

   (     ).



      ,     

  .  `` "     

 .          

,       .





12.2.  



    ,    

         . 

    ,       ( ) 

 shell,     .   (  ) 

 ,     ,     

    ,      

 .



       ,     

  .



     ,   "tput"  

"setterm". . ``  ".       

     terminfo,     

 .       

         , 

           

.



  ,        , 

 "" ( ).  ,       

 .         (  ) 

  .        

 .   ,    ,   

    .        

"".      .   

     .     DIP 

,       .



     ,      

     ,    

   .      ,   

     .



,       , ,   

,   .    ,   

 ,   .





12.3.  



(        ,   

.)





12.3.1. Inittab



        

 .



 ,       : /etc/inittab. 

  () getty       () 

getty. getty        

()            

   TERM (. Serial-HOWTO 4.1 & 7.2 /  "man 

getty").



       (,    

   3 : ,   ),   

    getty,   "local".



     getty,   .





12.3.2. Stty  Setserial



       "stty",   

"setserial".  ( )  stty     

 getty    setserial   ,   

      .    (stty  setserial) 

    . stty  ,  

   setserial          

.  "" ,       

 ( shell),      .  

    stty  setserial   ,   

     .





12.3.3.  Setserial



Setserial      (IRQ),   .   

 ,      UART.    

     (        

   ).      1200  . 

 setserial ,     serial (  Linux). 

     2  ,    

setserial,     IRQ.





12.3.4.   setserial?



  ( )  setserial,   , 

  setserial.   ,    . 

    /etc/rc.d   "rc.local"  "rc.serial".  Debian 

    0setserial  /etc/rc.boot,      

     /etc/init.d .





12.3.5. Stty



Stty     .  , 

    ( ),    : 

stty -a.    ( ttyS1) : stty -a </dev/ttyS1. 

    stty:  ( /),   , 

/,   ,  8- ?,   , 

  ,  ,   ,  

 , ,      , 

ECHO,      ?,   

()  (,       

). .    (: man stty).  

    . `` () 

"



   getty, ,        

stty,     getty: /etc/gettydefs.     

,    getty   ,   

,       stty.



   C,    stty,  ..



         

  stty (    ).  

 Serial-Programming-HOWTO. man termios     

C ( termios),    stty   .  

       C -     (    

 ),     stty.





12.3.6.    stty?



 stty       ,    

  stty  ,       

( Linux).         getty.  

  .     ,   ,    

( )     ,   .    

  (    ),   .



      -    ,   

setserial,   . . ``  setserial?". 

        setserial ,  

    .   Debian  

 /etc/init.d/bootmisc.sh,         

0setserial.  : stty crtscts < /dev/ttyS1.





12.3.7. terminfo  termcap ()



. ``terminfo  termcap ()"     termcap. 

  ,       

terminfo ( termcap).         ( 

vt100)   ,    ,     

  ,     ,  

 .



    ( PC )       

 "" ,      terminfo, 

      .     

 .   getty     terminfo 

(  ),    (  vt100).



terminfo -  ,    ,    

     ,    - .  

 ,     "" ,  ,  

  ,       ..   PC 

  "".     ,  

  ( init  ).      

   ,    (  

)  terminfo ( termcap).





12.4.   



 :



 ``(/)"

 `` "

 ``  "

 ``  "



        ,   

.      ,   

  getty   /etc/inittab.        

  "stty",      .   

     .      

stty   ,     . . `` 

  stty?"



12.4.1. 



       ,   .  

-    (/    ).  9,600 -  

 ,           

 ,  .



     :   ,  

 T  R.     .



  - 300, 600, 1200, 2400, 4800, 9600, 19200, ...   

    2,      1920-

,        

.





12.4.2.  



  . ``  , ".    

   .     ,   

  ,        . ,

    .      

   ,   .       

,   stty       -.



      ?    

    ,    .   

  ,        

,     ,     .

     . -,    

,          

. -,     ,   

   ,         . 

,    .



,       

 .        

   ,     

  . -       

     .      

.



         . , 

     ,    .  

       ,   

 ,    .     , 

  (    ).   , 

      .     

  (     ),   

 :     /   

/   /.



       ,   , 

 .



        

. ,      (   )

  (   , ,    ),  

   .





12.4.3. /



 -   (    ).



 ASCII  - 7 ,  ISO  8 .   

    ASCII,   7-,    

 7 ,  8.      

7- .





12.4.4     ?



   "" ( rts/cts + dtr/dsr)  

"" (Xon/Xoff)   .   

    (       

        ),   

 Xon/Xoff    .   ,   

 - ,     ,  

        

(   ).



    (Xon/Xoff)    

  ,     ,     

 Xoff      .   ,

     ,  . ,  

  Xon   , ,     

  ,    . 

      . . `` 

 "      .





12.5    /etc/ttytype



  /etc/ttytype     

/dev/ttySn     terminfo. tset  ,   

  TERM   ,     .  

 Linux getty  TERM   tty,       

.   Unix-   FreeBSD,  /etc/ttys  

tty   ,    getty   

 (  "dialup").   Linux ttytype: vt220 ttyS1





12.6.    



 , root       .    

,    ( )  /etc/securetty  man- 

"securetty".        / 

   ..  /etc/login.access (   

/etc/usertty ??). /etc/login.def ,    

/etc/securetty     ,  /etc/securetty  

 (  ). /etc/porttime   ,  

  tty     .  

         - 

,            

.  man- "faillog"      

.





12.7.      ,  TERM=my_term_type



        .  

   stty ,       

 < ,  ,     .    

    ?       

 ls,           

   .      

       (    ),  

     .     

,       ?



      "if"   /etc/profile,  

       .   "if" 

    ..    ,    

 .     dircolors :



______________________________________________________________________



if [ $TERM = linux ]; 

  then eval `dircolors`; 

  elif [ $TERM = vt220 ];

    then ls () { command ls -F $* } declare -xf ls

    else echo "From /etc/profile: Unknown terminal type $TERM" 

fi

______________________________________________________________________







13.  terminfo  termcap ()



13.1. 



terminfo ( termcap) -       . 

  (, )      ,  

  .   ,  escape- ( 

 )  ,      

   ,   ,  ,  

,    (, , , , 

   ..).  1980     

    .





13.2.   terminfo 



  terminfo         

 .    termcap    , 

         terminfo,   

  .  ,     (, 

vt100)    terminfo,  "locate vt100 ".    

 /usr/lib/terminfo/v/vt100  /usr/share/terminfo/v/vt100,  

     terminfo.  

   ,       

/etc/terminfo.



 ,   ,     

/etc/termcap /  terminfo.src. . man-: terminfo (5)  termcap 

(5),    ,    ( )  

.  terminfo.src      ,    

      linux.    , 

  locate.      (  termtypes.ti) 

 <locke.ccil.org/~esr/terminfo>





13.2.1.   terminfo(tic)



      "tic",    

  termcap /  terminfo.



        terminfo   

  termcap.



 ,     Linux,  

      ,      

 -,    /etc/termcap ( terminfo.src).



"tic"         

 terminfo,     .





13.2.2.   terminfo



   -    termcap/terminfo (  

)   .       

-   "infocmp".         

  ,     ,      

  terminfo.





13.2.3.   



   ,     ,  

 ,    .     Linux termcap  

xterm,    X-Window.   "dumb"   

        .   

   terminfo   ,   

,        termcap    

     ,       

  .





13.3. 



  terminfo    ,     

   .     ,  ,  

   /     . 

     ,  

 .



  ,    ,     

(   ) : "tset", "tput init"  "setterm -initialize". 

   init-,       

 ,   ( /,   

      ).





13.4.  TERM



  TERM      ,   

.     terminal_type,  

 getty (    /etc/inittab



       terminfo.   "set"   

,  ,    TERM ( : tset -q). 

  () TERM   "linux",    PC, 

       "linux".   "linux"  

   vt100,       ,  

 "linux"        .



             

(/dev/tty ...) (,   ,   

          ,  

    ,        

),  TERM    ,  - 

   .   escape- 

 ,        .  

   ,     ( ) 

  .



       tset   

 shell.



      ,   "tset" (. man).

Tset    ,   .    

  terminfo     init .



    TERM. ,   

   .      .profile, 

     : eval `tset -s? Vt100`.  

  :  ,   () vt100. 

         

.  tset  init    TERM    ()

.





13.5. Termcap 



 The Termcap Manual <http://www.delorie.com/gnu/docs/termcap/termcap_toc.html> 

   Richard M. Stallman --   GNU.



 man terminfo (5) / termcap (5).



 /etc/termcap ()  terminfo.src     

   termcap ,       

  ,  u6-u9



 "Termcap and Terminfo " -- ,  O'Reilly  1988.





14.  



14.1. 



     - /  

    .   ( 

  )       

      ,  

 .   ,     

,    Linux .  ,  

  :



  clear (  )

  reset (  )





14.2.  



   ,   "" ( "")  

     .       

     .    , , 

  .   ,  ,     

     ,    ,  

       ,   

   "" .     ,  

 , . ``   ".





14.3.   



    ,  ( bash)  ,   

    . ,       

    .     

  (   "",  

 ""   " ").     

 ,        ^C,  

  .     ,   

    .



     ``stty".





14.4.   



14.4.1. 



       ,   ,  

 ,      .   

    ,   ,   , 

,  .    ,    

 ,         -

 .      :   

        .





14.4.2.     



    ,      escape-

   .      

  ,      , 

            

  .



   ,       

,     .    

    ,     

.      ,  ,   

    .   "cat ...."  "cp .... 

/dev/tty .."  .... -  ,     .



       ,   

       .    

,    .   ASCII   

   .



     .   ,  

     (   ),   

    "reset",  "setterm -reset" (    

 ,   ).     reset   

terminfo  .





14.4.3.    



   ( )    stty 

( )   ,     stty,   

  .       "" 

 ,   ,       

 .   ,   ,   

  ,     .   

   ( ^C)      .



     ,    

   stty  ,      

 .       (  

, ,         ),    

      " ".



         stty 

 "stty sane". ,        

 ""     "".    

""   ,    ""   

   ,   .   "" 

^J (  ). "sane"        

,    . "stty sane"      

  ,    .





14.5.  ()  



  ,      , 

""      .   

  , : stty -a    2-4.  - 

  man stty.        

  s,  stty.     

     ,   .



     , , ,  

    .





14.5.1.   



           

 ,       ( 

"readline"   bash).   -    ,  

     -,   .   ,   

     ,      

     .     - 

^C (), ^D  .



  Delete- (stty    ^?)   

  ^U  

  ^W   

  ^R  .      

        ??





14.5.2.  ( , ,  , Flush)



  ^C .          

      .

  ^/ .      ^C,   .   

       ""  (    )    

      .

  ^Z .       .

       fg,   .

  ^D  .      ,   

          ,      

      .

  ^O flush.    Linux.    /dev/null.





14.5.3. 



,        ,      

  "" (^S  Xoff)   (,   

 " Xon-Xoff ).  " " (^Q  Xon)

 .     "No Scroll",  

  Xoff  Xon.       

   

  ^S   (Xoff)

  ^Q     (Xon)



     ,  ,  ^C.    

 ,   - ,      

,        ,   ^Z  

.



   -     pager,  

 more, less  most. ,        

 ,      ,  pager  

.   ,     "2>&1", 

 pager  .     ^S  ^Q,   

     .



  PC ( )      ,  

 Shift-PageUp.   ,      

,   ^S.      ,  Shift-

PageDown    .





14.5.4.    



^V     (  ) 

      , ..  -  

    .



     ASCII  ^C.





14.6.  



       :



 gitkeys: ,  ()     .

 tty: ,    tty  .

 set:    TERM (  terminfo)

 stty -a:    stty.

 setserial -g /dev/tty?? (    ??)   

    UART,     IRQ.

 infocmp:    terminfo (  )





14.7.   



     ,   

,      . , 

    ,   .   

   "stty" "setserial",   ,  , 

,   . ,  ,   

      ,    

  ,    .    

   ,       

   .



        ,   

         - , 

  .       .



 3 ,   ,  escape-  

  .  3      

 :



1. setterm -reverse

2. tput -rev

3. echo ^[[7m





14.7.1.  setterm



 -     .     (  

   -- )      terminfo,  

,   .    , ,  , 

 ,  ,  ..





14.7.2.  tput



 "tput"  "setterm",   ,    

  ,    ,  terminfo. 

        .





14.7.3.  echo



  "echo ^[[7m",    , ^[ - 

 ESC.   ,  ^V^ [( ^V,   

escape).



    "echo",       

   ,   terminfo  termcap.   

setterm  tput,  echo   .      

 echo ...   ,        

.





14.7.4.   



   ,     (   

     ,     

).      ,  ,   

,    ,     .  

 ,    .     

   ,     ,   

        .





15.   ( )



  ,   - , .  "  

".



   :



 ``  ?" ,   .

 `` "   ,      

     

 ``Getty Respawning Too Rapidly'' (console error message)

 ``Getty    " (   )

 ``    "

 ``   ,      .

 ``    "

 ``    "



  ,   .  -      

   .     .   - 

  ,    .    

 .





15.1.   



         . 

       ,    

 .   ,   . . ``  

". ,   ,      , 

      .



    ,      

      ?





15.2.   



         ,    

,    -  .  ,    

,   ,  . ``  ''.



  ,       

  ,       

  ,   MS DOS.



  ,   ,    ,  

     (cp my_file /dev/ttyS?)   

 .         

 ,       (,  

     ).   

 ,   ,  .,       ..,  

..      ,    , 

 ,       . ,  

 (  )         

    ,    

     .   

    .     

  ,       .   

    ,     .





15.3.   ?



         .



       ,   .  

    (     ..)  

     . ,   

    (  ).    ,  

   .



,          

.



 ( )       

   ,      . 

    ,   ,   

.       , . ``  " 

    .





15.4.  



      ,    

  (    ..),     

,         . 

     ,   ,  .   

,       .  , 

      -  ,  

-    (   ). . 

``  "



   ,    - 

   .    .



    1200 ( ,    

   )    ,   

    . . Printing HOWTO  

" "    ,   .





15.5 getty   



15.5.1    



 getty    /   -  

       ,  getty  

.    inittab, getty    

 ,    ..,  ..   

 "local"  getty /      .





15.5.2.  



    getty -   , 

    ,    .  

,       ""  . 

    (   2   

 ).





15.6.      



     ,     ,  

      () ,  

-     ,  ,     

.   - /etc/profile  /.bashrc.  ,   

"stty"  "setserial",  ,   .    

     ,     

     ,    .  

    ,      

 .





15.7.    



       ,    

(   )      ,  

 ,         

.       "local"  getty,  , 

    .      

    (stty -crtscts),   .  

  ,         ,

   .     

  ( )    ,    

 ,   - .



   ,  -  "login failed", ,   

       ,     

    . . ``   "





15.8.     



   -    , 

 -   ,    

   .       

,       ,    

  .



     ,    

.          

  " ",     , 

     -      

 .



   agetty (  getty),   agetty 

     ,   - . 

   ,  ,      

  .



15.9.      



     ,    .   

 ,     ,    

     .   :

   ,      

 getty.



       (   

 ).



    

   





15.9.1.    



  (   )  "top"  "ps -al",  

   getty  .      getty, 

       .    

   ,  getty  .   ,   

  ,        .



  getty,  /etc/inittab,   

getty  #   ,       ,

   .    getty,   k

  "top".



 c     (    

  ,       getty) 

  cp Linux: cp file_name /dev/ttyS1.



   ,  stty,     

 ,     (   

 : -crtscts;   ,    : 

clocal). ,    / - .    

,    (.  ).





15.9.2.  

                            

     ,   -12 V ( -5  -15) 

 3 ( )    - . 

       ( 

     ).   

 ,      2  .    ,

    3  ,    ( ,  

,    -    2    3). 

  ,       .

       .



   ,        ( 

   )  ,   

-  .    ,    

  -12 V,   .     ( 

 getty).   ,     0  

  0,       .   

     AC,     ,  

   DC,    AC.   , 

 DC -12 V     AC.  ,    

   (     ) 

  ,      .





15.10.      



15.10.1. Breakout ,  ..



 ,    ,     

 (  ),     

      . 

  "breakout ... ",  breakout  - break out

 .       

  .      

.    ,  ,  

      .



            

.   . Radio Shack  "RS-232 

troubleshooter"  "RS-232 serial jumper box".





15.10.2.  



   ,   ,    $10, 

  .       

 .   ,      

. 470 ohm    20 ma  (   

 - 20 ma).       

  ,      +  - .  

      ??   

 ,        , 

  -,     -  5 .  

 12-  -     .   

    -     UART, 

,    .



     ,    

  .     ,   ,  

   .





15.10.3.   



   ,       

       (   

),       .  

      ,  ,  

,       .   

 ()   ,       . 

,     ,  ,      

.      ,      

 .



  12 V        . 



      .      

,     .    

    r,        .





16.   



        / 

.         

  .  ,         

:  ,  - ,   

.      ,      

 ,       .





16.1.     



16.1.1. 



Bigelow, Stephen J.: Troubleshooting & Repairing Computer Monitors,



2nd edition, McGraw-Hill, 1997.       

  .



16.1.2. 



FAQ <http://www.repairfaq.org>  newsgroup: sci.electronics.repair   

,       . .  "  

".       ,   

: " ", " "  .. 

  , ""     HOWTO    

     FAQ (   ).





16.2. 



-      30,000   

  (      ).  

,      ,      

.     ,      .

   ,   ..    

    ,        

  .        

  ,     . ,  

,        ,  

  .    ,    

   (  ).



   ( )     , 

,             

,    .       

,    .      

     ,      ( 

   ),     .





16.3.  



   ,   / ,

     (  ).  , 

   ,       

.         ( 

 )   .



    ,   ,   

 .        ,  

       .  

     .     

 ( Phillips-head),     

   TV  (plastic hex wrenches ). 

        

 . ,   :



  V-Size       

  H-Size       .    

  V-Pos        

  H-Pos        

  V-Lin        (,   

                     )

  V-Hold       (,   

              )

  Bright      (    )

 Sub-Bright      ( 

              :  ,     

             ). 



     ,    . 

,      ,    

   ,    .    

,    ,   ,  





16.4. 



16.4.1.   



     ,    (   

  ),    ,  .    

   /  ,   ,  

   .      

    .      

 ,         , 

   .     

 (   ,  ),    

  .     

  ,   10,000 .



   (),   ,  

      .     

,       ,  ,   

 .    ,     

   (   )  , 

  .     ,    , 

      (   ,    

).



   -    .     

 .       ,

        . ,  

 -       . 

      .  

       .  

    ,  ,  

 .      .



            

,       .   

 ""   .





16.4.2.    



    -,  -      

   .  ,    , - 

  .    ,   

  ,  ,      .



  ,         

,    .    . 

    ,    .  

,   ,        

    ,  ..



   ,  ,   ,  

    (        

  ).       ,  

      (  )  

 UART  .



       .  , 

  ..        

.       -  .

  .     (  

)   ,    ,   .



    ,       

 ,          

    ,   .



     ,  ( 

 )     .   

     ( ),   copy  

   Minicom.      

RETURN  ,   .      

    ..   .    

  .





16.5. 



        

  ,         

.         

  .   ,     

       .



16.6. 



16.6.1. 



     ,     PC.



     ,     , 

  .        

      .  

"" ,     .  

 ASCII   ,      

      .





16.6.2.   



      ,   

.          , 

    .  ,    

 ( )      ,  

  .   1-10  A-J. :  

3    ),   B    ,   

     3  B,   .   

,   3  B.     

,    .      

 (   ,   ).  

  .





16.6.3     2  



 -   3  4 ,    3-B

  4  B,    ,      

3-B  4-B.      2  ,   

    .





16.6.4.    



          ,  

   .      

          

  .     

  ()   .    

        ,  

  (  .    ,  

""      ,  , 

     .



16.6.5.    



     ,     ( 

  ),  ,     .  

  -    ,     

.



    -   .



 wigging     ,  , 

   .        

     .



   ,    .   

 ,   caulk.





16.6.6.  b  bb,  .. ( )



      ,     

.  , ,       

  ( ECHO ON)   ,   ,  

        ,   

  .    -  ,    

   . . ``    2 

 "





16.6.7.   



  ,         

  ,   .   ,   

,       

.         getty, 

           . . 

`` ".   o , .  `` 

 ".





16.6.8. ,   



         (   

 ,      ),     

 .      (  

  ),    ,     

  ,   .    

    ( ) ,     

 -    .    

,        

/ .           

  (  ).   ,    

     ,    .





16.6.9.   



16.6.9.1.   



   ,   ()   

     .       

,       .   

  IBM       ,    

  ,       

.      , , / 

 ,   .





16.6.9.2.    



     ,     

    .      

       

       .   

  , ,       

,   .



 ""    ,   ,  

         . 

(:      .) "" 

     ,      . 

        .      

  o :     

    ,    

  o .     -   

    .



        

    -    ,     

,     .    (  

 ,   )  ,  

       . 

  ,     .   

CIT101E   Alps,      . 

  -    ,   

      (  ).  

    ,     

.     ,   ,   

 ,    ,    ,   

  ,    .   

 ,     ,    

 ..  ,       .



Some switches have the contacts nearly sealed inside so little if any contact 

cleaner reaches the contacts.



   ,       

,       ,  ,

    (   ).  , 

   ,  .    

,     ,   

    ,  .



,      .



     (),   ,

 ,      .    

   ,     . 

    ( )    

)    ,   .  

  ,       .    

  , , ,      

,     (  ).   

  ,     ,  

    ( ).       ,  

       .  

   ,    , 

      .



   ,  .    

  .      

 ,       

   .





17. 



17.1.    Linux 



17.1.1.    



  ``setterm'':  

  ``tput":  

  tset:   

  clear:  

  reset:   





17.1.2.    



  ``setserial''

  ``stty''





17.1.3.  Terminfo



  ``tic'' terminfo   

  toe:   ,      terminfo 

  (termcaps)

 ``infocmp"     terminfo 





17.1.4. 



 gitkeys:  ,       .

 tty:    tty  

 set ( tset -q):   TERM,   terminfo 

 ``tset":  TERM     





17.2.   



17.2.1.     



 Website   <http://www.cs.utk.edu/~shuford/terminal_index.html> 

           

   .

 Boundless <http://www.boundless.com/textterm/>  VT    

   Dorio  DEC.

 Wyse <http://www.wyse.com/terminal -   .

 comp.terminals - newsgroup  





17.2.2. ,   



   EIA-232 . `` EIA-232 (RS-232)".

  . ``    ".

   terminfo . ``  termcap"





17.2.3.    



  ,       (  

    1970-).



      Duane E. Sharp; ; Reston 

  Publishing Co. 1977. ( )

  Communicating with Display Terminals by Roger K. deBry; McGraw-Hill 1985. ( 

       IBM )



" ... "       100  

  ,    1970-   60  

.   ,    ,   

   - ,   

    (p. 36).   

   (  1970-).     

  ()  " "  

"  ".



 "COMMUNICATING ... "    " ... "   

   .    ,  

  (      ,     

    ). ,     

 IBM (  3270)      .  

    ANSI ,    Unix-

 .



    ,      , 

      .





17.2.4.     



           

.  ,      ,   

 (  ),    .



-  Unix- ,        

Linux.



 Unix Power Tools.  Jerry Peck. Al. O'Reilly 1998. Ch. 5   

  , Ch. 41:     , Ch. 42: 

    



 Advanced Programming in the Unix Environment. W.  Stevens Addison-

  Wesley, 1993. Ch. 11: - , Ch. 19: 



 Essential System Administration by Aleen Frisch, 2nd ed.  O'Reilly, 1998. Ch. 

  11:   .



 "UNIX POWER TOOLS"   3     .



  ,   HOWTO,     ,  

 .



"ADVANCED PROGRAMMING ... "  11      

(  )  ( ,    

     ).   ,  

  stty,   .



"ESSENTIAL SYSTEM ... "      ,   

.    .



