\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{Linux Serial HOWTO ¤¤Ä¶ª©}
\author{§@ªÌ: Greg Hankins {\ttfamily \onlynameurl{greg.hankins@cc.gatech.edu}}\\ 
Ä¶ªÌ: \onlynameurl{Asd L. Chen} \&
      \onlynameurl{C.W.Huang}}
\date{v1.11, 15 November 1997
Â½Ä¶¤é´Á: 18 November 1997}
\abstract{³o¥÷¤å¥ó±Ô­z¦p¦ó¦b Linux ¾÷¾¹¤W³]©w¦ê¦C³q°T³]³Æ¡D}


\begin{document}
\maketitle
\tableofcontents

\section{Â²¤¶}

³o¬O Linux Serial HOWTO¡D¥]§tÃö©ó¦p¦ó¦b Linux ¤U³]©w¼Æ¾Ú¾÷¥H¤Î²×ºÝ¾÷ªº©Ò¦³²Ó¸`¡AÁÙ¦³¤@¨Ç¨Ï¥Î¦ê¦Cªº³ZÂ¬¡A¥H¤Î¬G»Ù±Æ°£ªº¸ê®Æ¡D
³o¥÷¤å¥óµÛ­«¦b Intel x86 µwÅé¤W°õ¦æªº Linux¡AÁöµM¦b¨ä¥¦¥­¥x¤W¤]³\¤]¯à¹B§@¡D  




\subsection{ª©ÅvÁn©ú}

¥»¤åª©Åv¬OÄÝ©ó Greg Hankins(copyright (C) 1993 - 1997)¡D¥»¤å¥ó¥i¥H¦b LDP ªºª©Åv³\¥i¤U´²§G: 
{\ttfamily \onlynameurl{http://sunsite.unc.edu/LDP/COPYRIGHT.html}}.
¥»¤å¦b¥¼¸g§@ªÌ³\¥i¤U¤£±o¥H­×§ïªº§Î¦¡´²§G¡D



{\bfseries ­ì¤å}

Copyright (c) 1993 - 1997 by Greg Hankins.  This document may be
distributed under the terms set forth in the LDP license at
{\ttfamily \onlynameurl{http://sunsite.unc.edu/LDP/COPYRIGHT.html}}.
This document may not be distibuted in modified form without
consent of the author.




\subsection{³o¥÷¤å¥óªº³Ì·sª©¥»}

·sª©ªº Serial HOWTO ·|©ñ¨ì\\ 
{\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Serial-HOWTO}}
¥H¤Î¬M®g¸`ÂI¡D¦³¤@¨Ç¨ä¥¦¹³¬O  Postscript  ¥H¤Î DVI ®æ¦¡ªºª©¥»©ñ¦b {\ttfamily other-formats} ¥Ø¿ý¸Ì¡D
³o¤@¥÷ Serial HOWTO ¤]¥i¦b
{\ttfamily \onlynameurl{http://sunsite.unc.edu/LDP/HOWTO/Serial-HOWTO.html}}
¨ú±o¡D¥¦¤]·|¨C¤ë©w´Áªº¶K¨ì {\ttfamily \onlynameurl{comp.os.linux.answers}}¡D




\subsection{¦^õX}

½Ð±N¥ô¦óªº°ÝÃD¡Aµû½×¡A«ØÄ³©Î¸É¥R¤º®e±H°eµ¹§Ú¡D§Ú¥Ã»·´÷±æÅ¥¨ì§A¹ï³o¥÷ HOWTO  ªº·Qªk¡D
§Ú¤]Á`¬O¤p¤ß¦aª`·N§ï¶i! ½T¹ê¦a§i¶D§Ú§A¦³¤°»ò¤£À´ªº¦a¤è¡A©ÎªÌ¬O¦³¤°»ò¦a¤è¥i¥H¼g±o§ó²M·¡¡D
§A¥i¥H¸g¥Ñ³o­Ó¹q¤l¶l¥ó¦ì§} {\ttfamily \onlynameurl{greg.hankins@cc.gatech.edu}} »P§Ú³sÃ´¡D
©Ò¦³ªº¶l¥ó§Ú³£·|¦^ÂÐ¡A¤£¹L¥i¯à­nªá¤@­Ó¬P´Á©Î§óªøªº®É¶¡¡A¬Ý§Ú¦h¦£¦Ó©w¡D
§Ú¦¬¨ì¤@¤j°ï¨Ó¦Û {\ttfamily root} ¤Î¿ù»~³]©wªº¯¸¥x¡D
½Ð¥H¯u¹ê¨­¥÷±H«Hµ¹§Ú¡A¨Ã¥B½T©w§Aªº¹q¤l¶l¥ó¨t²Î¬O¥¿±`¹B§@¨Ï±o§Ú¯à°÷¦^«Hµ¹§A¡D
¦pªG¨â­Ó¬P´Á¤§¤º§AÁÙ¨S¦¬¨ì§Úªº¦^­µ¡A½Ð¹Á¸Õ¦A±H¤@¦¸¡D

¤]¥i¥HÂÇ¥Ñ¤U­±ªº¦a§}¥H¿ð½wªº¶Ç²Î«H¥óÁpµ¸§Ú:\\ 
Greg Hankins\\ 
College of Computing\\ 
801 Atlantic Drive\\ 
Atlanta, GA 30332-0280\\ 
¥H¤Î¸g¥Ñ¥þ²y¸ê°Tºô¨ì§Úªººô­¶\\ 
{\ttfamily \onlynameurl{http://www.cc.gatech.edu/staff/h/Greg.Hankins/}}.

¼¶¼g®É½Ð±N Serial HOWTO ¤å¥óªºª©¥»½s¸¹§t¤J¡A³o¥÷¬O 1.11 ª©¡D




\subsection{§K³dÁn©ú}

§Aªºª¬ªp¥i¯à«Ü¤£¤@¼Ë¡D³o¸Ìªº¦^µª¥i¯àµLªk¦b©Ò¦³ªº¨t²Î¤Î¦UºØ³]©wªº²Õ¦X¤U¹B§@¡D




\section{¤w¸g¤ä´©ªº¦ê¦CµwÅé}

¥Hª¾ Linux ¥i¥H»P¤U¦Cªº¦ê¦CµwÅé°t¦X¹B§@¡D




\subsection{¼Ð·Ç PC ¦ê¦C°ð}

\begin{itemize}
\item ¼Ð·Ç PC ¦ê¦C°ð (COM1 - COM4)¡A¯à°÷Åý¥~±µªº¦ê¦C¸Ë¸m(¼Æ¾Ú¾÷¡A¦ê¦C·Æ¹«µ¥)³s±µªº
\item ¼Ð·Ç PC ¤º±µ¦¡¼Æ¾Ú¾÷ (COM1 - COM4)
\item Quickpath Systems Port-Folio 550e (¥i¥Îªº IRQ ¬°
3, 4, 5, 9, 10, 11, 12, ¤Î 15)
\end{itemize}




ª`·N: ¥Ñ©ó¦ì§}½Ä¬ð¡A§A¤£¯à¦P®É¨Ï¥Î COM4 ¤Î IBM8514 µø°T¥d¡D³o¬O IBM8514 µø°T¥dªº¤@­Ó bug¡D




\subsection{§Y´¡§Y¥Î«¬(PnP)¼Æ¾Ú¾÷}

§Y´¡§Y¥Î«¬¼Æ¾Ú¾÷¯à°÷¦b Linux ¤W¹B§@¡DµM¦Ó¡A§Ú¤£«ØÄ³¨Ï¥Î¥¦­Ì¡A¦]¬°¦³§xÃø¡D
§A¦³¦n¦h¨Æ±¡­n¸Õ:
\begin{itemize}
\item ¸ÕµÛÃö±¼§A¹q¸£ BIOS ¤Î¼Æ¾Ú¾÷¤Wªº PnP ¥\¯à¡D
\item ±Ò°Ê Windows 95¡A³]©w¼Æ¾Ú¾÷¡AµM«á¬Ý¬Ý¦b§A±Ò°Ê Linux «á³o¨Ç³]©w¯à§_«O¯d¤U¨Ó¡D
¦pªG¤£¦æªº¸Ü¡A¦A¨Ó:
\item ±Ò°Ê Windows 95¡A³]©w¼Æ¾Ú¾÷¡AµM«á¨Ï¥Î{\itshape ·x¶}¾÷\/}±Ò°Ê Linux ¥H«KÅý³]©w¯à«O¯d¤U¨Ó¡D
§A¥i¥H¨Ï¥Î {\ttfamily loadlin} ¸ü¤J¾¹¨Ó±Ò°Ê¡D
\item ±q {\ttfamily \onlynameurl{http://www.redhat.com/linux-info/pnp}} ¨ú¦^ PnP ¤u¨ã¡D
\item µM«á§A´N¦³­Ó¥i¥Îªº¼Æ¾Ú¾÷¡D
\end{itemize}





\subsection{¤@¯ë¦h°ð¦ê¦C¥d(ªþ 8250/16450/16550A UART ´¹¤ù)}

\begin{itemize}
\item AST FourPort and clones (4 ports)
\item Accent Async-4 (4 ports)
\item Arnet Multiport-8 (8 ports)
\item Bell Technologies HUB6 (6 ports)
\item Boca BB-1004 (4 ports), BB-1008 (8 ports), BB-2016 (16 ports)
\item Boca IOAT66 (6 ports)
\item Boca 2by4 (4 serial ports, 2 parallel ports)
\item Computone ValuePort V4-ISA (AST FourPort compatible)
\item Digi PC/8 (8 ports)
\item GTEK BBS-550 (8 ports)
\item Longshine LCS-8880, Longshine LCS-8880+ (AST FourPort compatible)
\item Moxa C104, Moxa C104+ (AST FourPort compatible)
\item PC-COMM (4 ports)
\item \onlynameurl{Sealevel Systems} COMM-2 (2 ports), COMM-4 (4 ports) and COMM-8 (8 ports)
\item SIIG I/O Expander 2S IO1812 (4 ports)
\item STB-4COM (4 ports)
\item Twincom ACI/550
\item Usenet Serial Board II (4 ports)
\end{itemize}


¤@¯ë¨Ó»¡¡A Linux ¯à°÷¤ä´©©Ò¦³¨Ï¥Î 8250, 16450, 16550, 16550A¡]©Î»P¨ä¬Û®e¡^UART ´¹¤ùªº¦ê¦C¥d¡A
©ÎªÌ¬O¯à°÷ºNÀÀ¤W¦C UARTs ¤§¤@ªº¤º±µ¦¡¼Æ¾Ú¾÷¡D

ª`·N: BB-1004 ¥H¤Î BB-1008¡A¥¦­Ì¨Ã¤£¤ä´© DCD ¤Î RI ½u¸ô¡A¦]¦ÓµLªkÅý±µ¨ü¼·±µªº¼Æ¾Ú¾÷¨Ï¥Î¡D
¥¦­Ì¦b¨ä¥¦¥Î³~¤W«hªí²{¥¿±`¡D




\subsection{´¼¼z«¬¦h°ð¦ê¦C¥d}

\begin{itemize}
\item Comtrol RocketPort (36MHz ASIC; 4, 8, 16 or 32 ports)\\ 
contact: {\ttfamily \onlynameurl{info@comtrol.com}} or
{\ttfamily \onlynameurl{http://www.comtrol.com}}\\  
driver status: supported by Comtrol\\ 
driver location: {\ttfamily \onlynameurl{ftp://tsx-11.mit.edu/pub/linux/packages/comtrol}}
\item Computone IntelliPort II (16MHz 80186; 4, 8, or 16 ports),\\ 
IntelliPort II EXpandable (20MHz 80186; 16 - 64 ports)\\ 
contact: Michael H. Warfield, {\ttfamily \onlynameurl{mhw@wittsend.atl.ga.us}}\\ 
driver status: pre-ALPHA
\item Cyclades Cyclom-Y (Cirrus Logic CD1400 UARTs; 8 - 32 ports),\\ 
Cyclom-Z (25MHz MIPS R3000; 8 - 128 ports)\\ 
contact: {\ttfamily \onlynameurl{sales@cyclades.com}} or
{\ttfamily \onlynameurl{http://www.cyclades.com}}\\ 
driver status: supported by Cyclades\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.cyclades.com/pub/cyclades}} and included in Linux 
kernel since version 1.1.75
\item Decision PCCOM8 (8 ports)\\ 
contact: {\ttfamily \onlynameurl{pccom8@signum.se}}\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.signum.se/pub/pccom8}}
\item Digi PC/Xi (12.5MHz 80186; 4, 8, or 16 ports),\\ 
PC/Xe (12.5/16MHz 80186; 2, 4, or 8 ports),\\ 
PC/Xr (16MHz IDT3041; 4 or 8 ports),\\ 
PC/Xem (20MHz IDT3051; 8 - 64 ports)\\ 
contact: {\ttfamily \onlynameurl{mailto:sales@dgii.com}} or {\ttfamily \onlynameurl{http://www.dgii.com}}\\ 
driver status: supported by Digi\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.dgii.com/drivers/linux}} and 
included in Linux kernel since version 2.0
\item Digi COM/Xi (10MHz 80188; 4 or 8 ports)\\ 
contact: Simon Park, {\ttfamily \onlynameurl{si@wimpol.demon.co.uk}}\\ 
driver status: ALPHA\\ 
note: Simon is often away from email for months at a time due to
his job.  Mark Hatle, {\ttfamily \onlynameurl{fray@krypton.mankato.msus.edu}} has graciously 
volunteered to make the driver available if you need it.  Mark
is not maintaining or supporting the driver.
\item Equinox SuperSerial Technology (30MHz ASIC; 2 - 128 ports)\\ 
contact: {\ttfamily \onlynameurl{sales@equinox.com}} or {\ttfamily \onlynameurl{http://www.equinox.com}}\\ 
driver status: supported by Equinox\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.equinox.com/library/sst}}
\item GTEK Cyclone (16C654 UARTs; 6, 16 and 32 ports),\\ 
SmartCard (24MHz Dallas DS80C320; 8 ports),\\ 
BlackBoard-8A (16C654 UARTs; 8 ports),\\ 
PCSS (15/24MHz 8032; 8 ports)\\ 
contact: {\ttfamily \onlynameurl{spot@gtek.com}} or {\ttfamily \onlynameurl{http://www.gtek.com}}\\ 
driver status: supported by GTEK\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.gtek.com/pub}}
\item Hayes ESP (COM-bic; 1 - 8 ports)\\  
contact: Andrew J. Robinson, {\ttfamily \onlynameurl{arobinso@nyx.net}} or
{\ttfamily \onlynameurl{http://www.nyx.net/\~{}arobinso}}\\ 
driver status: supported by author\\ 
driver location: {\ttfamily \onlynameurl{http://www.nyx.net/\~{}arobinso}} and included in Linux 
kernel since version 2.1.15
\item Maxpeed SS (Toshiba; 4, 8 and 16 ports)\\ 
contact: {\ttfamily \onlynameurl{info@maxpeed.com}} or
{\ttfamily \onlynameurl{http://www.maxpeed.com}}\\ 
driver status: supported by Maxpeed\\ 
driver location: {\ttfamily \onlynameurl{ftp://maxpeed.com/pub/ss}}
\item Moxa C218 (12MHz 80286; 8 ports),\\  
Moxa C320 (40MHz TMS320; 8 - 32 ports)\\ 
contact: {\ttfamily \onlynameurl{info@moxa.com.tw}} or
{\ttfamily \onlynameurl{http://www.moxa.com.tw}}\\ 
driver status: supported by Moxa\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.moxa.com.tw/drivers/c218-320/linux}}
\item SDL RISCom/8 (Cirrus Logic CD180; 8 ports)\\ 
contact: {\ttfamily \onlynameurl{sales@sdlcomm.com}} or {\ttfamily \onlynameurl{http://www.sdlcomm.com}}\\ 
driver status: supported by SDL\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.sdlcomm.com/pub/drivers}}
\item Specialix SIO (20MHz Zilog Z280; 4 - 32 ports),\\ 
XIO (25MHz Zilog Z280; 4 - 32 ports)\\ 
contact: Simon Allen, {\ttfamily \onlynameurl{simonallen@cix.compulink.co.uk}}\\ 
driver status: BETA\\ 
driver location: {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/kernel/patches/serial}}
\item Stallion EasyIO-4 (4 ports), EasyIO-8 (8 ports), and\\ 
EasyConnection (8 - 32 ports) - each with 
Cirrus Logic CD1400 UARTs,\\ 
Stallion (8MHz 80186 CPU; 8 or 16 ports),\\ 
Brumby (10/12 MHz 80186 CPU; 4, 8 or 16 ports),\\ 
ONboard (16MHz 80186 CPU; 4, 8, 12, 16 or 32 ports),\\ 
EasyConnection 8/64 (25MHz 80186 CPU; 8 - 64 ports)\\ 
contact: {\ttfamily \onlynameurl{sales@stallion.com}} or
{\ttfamily \onlynameurl{http://www.stallion.com}}\\ 
driver status: supported by Stallion\\ 
driver location: {\ttfamily \onlynameurl{ftp://ftp.stallion.com/drivers/ata5/Linux}} and
included in linux kernel since 1.3.27
\end{itemize}
                 

¨ä¤¤ Comtrol, Cyclades, Digi, ¤Î Stallion ªº²£«~¦b 1995 ¦~¤»¤ë¥÷ªº {\itshape Linux Journal\/} ¤W¦³½g¦^ÅU¤å³¹¡D
³o½g¤å³¹¥i¦b {\ttfamily \onlynameurl{http://www.ssc.com/lj/issue14}} §ä¨ì¡D




\subsection{¤£¤ä´©ªº¦ê¦CµwÅé}

«ÅºÙ``Winmodems''ªº¼Æ¾Ú¾÷¡A¨Ò¦p USR Sportster Winmodem ¤Î IBM Aptiva MWAVE¡A
{\itshape µLªk\/}¦b Linux ¤W¨Ï¥Î¡D³o¨Ç¼Æ¾Ú¾÷¨ã¦³±Mªùªº³]­p»Ý­n¯S§Oªº Windows ÅX°Êµ{¦¡¡D
Á×§K¨Ï¥Î³o¼Ëªº¼Æ¾Ú¾÷¡D°£¦¹¤§¥~¡A°ò©ó¬Û¦P²z¥Ñ¤]§O¨Ï¥Î»Ý­n Rockwell RPI ÅX°Êµ{¦¡ªº¼Æ¾Ú¾÷¡D 

¨S¦³ Linux ©Ò»ÝÅX°Êµ{¦¡ªº´¼¼z«¬¦ê¦C°ð¤]¤£¯à¨Ï¥Î¡D




\section{¦ê¦C°ðªº¦WºÙ¬O¤°»ò?}

¤@­Ó¿é¥X/¤J(I/O)°ð¬O¥Î¨Ó±N¸ê®Æ°e¤J¹q¸£¤Î±q¹q¸£¨ú¥Xªº³q¸ô¡D
¦³³\¦hºØÃþªº¿é¥X/¤J°ð¡A¨Ò¦p¦ê¦C°ð¡A¥­¦æ°ð¡AºÏºÐ±±¨î¾¹¡A¤A¤Óºô¸ô¥dµ¥µ¥¡D
§Ú­Ì­n³B²zªº¬O¦ê¦C°ð¡A¦]¬°¼Æ¾Ú¾÷¤Î²×ºÝ¾÷¬O¦ê¦C¸Ë¸m¡D
¨C¤@­Ó¦ê¦C°ð¥²¶·¦³¤@­Ó¿é¥X/¤J¦ì§}¡A¥H¤Î¤@­Ó´¡Â_¸¹½X(IRQ)¡D
¦³¥|­Ó¦ê¦C³]³Æ¹ïÀ³¨ì COM1 - COM4:
\begin{tscreen}
\begin{verbatim}
ttyS0 (COM1) address 0x3f8 IRQ 4
ttyS1 (COM2) address 0x2f8 IRQ 3
ttyS2 (COM3) address 0x3e8 IRQ 4
ttyS3 (COM4) address 0x2e8 IRQ 3
\end{verbatim}
\end{tscreen}

¦pªG Linux ±Ò°Ê®É¨S¦³°»´ú¨ì¥ô¦ó¦ê¦C¸Ë¸m¡A½Ð½T©w¦b½sÄ¶®Ö¤ß®É¦³¥[¤J¦ê¦C¤ä´©¡D
¦b³o¥÷¤å¥ó¤¤¡A§Ú¬O¥H {\ttfamily ttyS0} °Ñ·Ó COM1¡A{\ttfamily ttyS1} °Ñ·Ó COM2¡A¥H {\ttfamily ttyS2} °Ñ·Ó COM3 ¡A¦Ó¥H {\ttfamily ttyS3} °Ñ·Ó COM4¡D
ª`·N³o¨Ç¸Ë¸m¹w³]ªº IRQ ¬O­«Å|ªº¡D§AµLªk¥Ñ³o¨Ç¹w³]­È¨Ï¥Î©Ò¦³ªº¦ê¦C°ð¡A§A¥²¶·­«·s«ü©w¤£¦Pªº IRQ¡D
°Ñ¨£ \ref{irqaddr} {(§Ú¯à¨Ï¥Î¶W¹L¨â­Óªº¦ê¦C¸Ë¸m¶Ü?)} ¤@¸`»¡©ú¦p¦ó³]©w IRQ¡D

¬Y¨Ç¦w¸Ë¤è¦¡·|«Ø¥ß¨â­ÓÃB¥~ªº³]³Æ¡Aµ¹§A¼Æ¾Ú¾÷¨Ï¥Îªº {\ttfamily /dev/modem} ¥H¤Îµ¹§A·Æ¹«¨Ï¥Îªº {\ttfamily /dev/mouse}¡D
¥¦­Ì³£¬OÃìµ²¨ì§A¦b¦w¸Ë®É©Ò«ü©w¾A·í {\ttfamily /dev} ¸Ìªº³]³Æªº²Å¸¹Ãìµ²¡]°£«D§A¥Îªº¬O¶×¬y±Æ·Æ¹«(bus mouse) ¡A¨º»ò {\ttfamily /dev/mouse} ±N·|«ü¨ì¶×¬y±Æ·Æ¹«³o­Ó³]³Æ¡^¡D

¤w¸g¦³¨ÇÃö©ó¨Ï¥Î {\ttfamily /dev/mouse} ¥H¤Î {\ttfamily /dev/modem} Àu¯ÊÂIªº°Q½×¡D
§Ú{\itshape ±j¯P¦a\/}¤Ï¹ï¨Ï¥Î³o¨ÇÃìµ²¡A¦pªG§A¥´ºâ¥Î§Aªº¼Æ¾Ú¾÷±µ¨ü¼·±µªº¸Ü¡A­n¬O§A¨Ï¥Î¤F {\ttfamily /dev/modem} ¨º»ò§A±N·|¦]¬°Âê©wÀÉ®×(lock files)µLªk¥¿½T¹B§@¦Ó¾D¹J¨ì§xÃø¡D
¦pªG§A³ßÅw¥¦­Ìªº¸Ü´N¥Î§a¡A¦ý¬O{\itshape ­n½T©w¥¦­Ì«ü¦V¥¿½Tªº³]³Æ\/}¡D
µM¦Ó¡A¦pªG§A§ïÅÜ©Î°£¥h³o­Ó³sµ²¡A¬Y¨ÇÀ³¥Îµ{¦¡(¨Ò¦p {\ttfamily minicom})¥i¯à­n­«·s³]©w¡D




\subsection{¦b {\ttfamily /dev} ¸Ìªº¦ê¦C³]³Æ¤Î¥D­n©M¦¸­n¸¹½X}

\begin{tscreen}
\begin{verbatim}
/dev/ttyS0 major 4, minor 64    /dev/cua0 major 5, minor 64
/dev/ttyS1 major 4, minor 65    /dev/cua1 major 5, minor 65
/dev/ttyS2 major 4, minor 66    /dev/cua2 major 5, minor 66
/dev/ttyS3 major 4, minor 67    /dev/cua3 major 5, minor 67
\end{verbatim}
\end{tscreen}

­nª`·N¨ì©Ò¦³ªºµo¦æ®M¥ó³£À³¸Ó¤w¸g¥¿½T¦a«Ø¥ß¤F³o¨Ç³]³Æ¡D
§A¥i¥H¥Î¤UªkÀË¬d:
\begin{tscreen}
\begin{verbatim}
linux% ls -l /dev/cua*
linux% ls -l /dev/ttyS*
\end{verbatim}
\end{tscreen}





\subsubsection{¦b {\ttfamily /dev} ¤¤«Ø¥ß³]³Æ\label{dev}}

¦pªG§A¨S¦³¨ä¤¤ªº¤@­Ó³]³Æ¡A§A¥²¶·¦Û¤v¥Î {\ttfamily mknod} «ü¥O«Ø¥ß¥¦¡D
¨Ò¦p¡A°²©w§A»Ý­n«Ø¥ß {\ttfamily ttyS0} ³]³Æ¡G
\begin{tscreen}
\begin{verbatim}
linux# mknod -m 666 /dev/cua0 c 5 64
linux# mknod -m 666 /dev/ttyS0 c 4 64
\end{verbatim}
\end{tscreen}

§A¤]¥i¥H¨Ï¥Î {\ttfamily MAKEDEV} ³o­Ó«ü¥O½Z¡A¦b {\ttfamily /dev} ¤UÀ³¸Ó·|¦³¡D
³oÂ²¤Æ¤F³]³Æªº«Ø¥ß¡D¨Ò¦p¡A¦pªG§A»Ý­n«Ø¥ß {\ttfamily ttyS0} ³]³Æ«hÀ³¸Ó¿é¤J¡G
\begin{tscreen}
\begin{verbatim}
linux# cd /dev
linux# ./MAKEDEV ttyS0
\end{verbatim}
\end{tscreen}

³o±N·|³B²zÃö©ó³s½u¶i¨Ó¥H¤Î³s½u¥X¥hªº³]³Æ¤§«Ø¥ß¡A¨Ã³]©w¥¿½TªºÅv­­¡D




\subsection{¤@¯ë¦h°ðªOªºª`·N¨Æ¶µ}

§Aªº¦h°ðªO©Ò¨Ï¥Îªº³]³Æµø§A¨Ï¥Î¨º¤@ºØ¦h°ðªO¦Ó©w¡D
³o¨Ç²Ó¸`¸Ô²Ó¦C¦bÀHªþ©ó {\ttfamily setserial} µ{¦¡ªº {\ttfamily rc.serial} ¸Ì­±¡D
¦pªG§A¹Á¸Õ¨Ï¥Î¦h°ðªOªº¸Ü§Ú±j¯P«ØÄ³§A¨ú±o³Ì·sª©¥»ªº {\ttfamily setserial}¡D
§A¥i¯à·|»Ý­n«Ø¥ß³o¨Ç³]³Æ¡DµL½×¬O¥Î {\ttfamily mknod} «ü¥O©Î¬O {\ttfamily MAKEDEV} «ü¥O½Z³£¥i¥H¡D
¦h°ðªO©Ò¥Î³]³Æ¬O¥H¥[¤W ``64 + °ð¸¹'' ¨Ó«Ø¥ßªº¡D©Ò¥H¡A¦pªG§A·Q¬° {\ttfamily ttyS17} «Ø¥ß³]³Æ¡A§AÀ³¸Ó¿é¤J¡G
\begin{tscreen}
\begin{verbatim}
linux# mknod -m 666 /dev/cua17 c 5 81
linux# mknod -m 666 /dev/ttyS17 c 4 81
\end{verbatim}
\end{tscreen}

­nª`·N¨ì ''64 + 17 = 81''¡D¨Ï¥Î {\ttfamily MAKEDEV} «ü¥O½Zªº¸Ü¡A§AÀ³¸Ó¿é¤J¡G
\begin{tscreen}
\begin{verbatim}
linux# cd /dev
linux# ./MAKEDEV ttyS17
\end{verbatim}
\end{tscreen}


ª`·N: SIIG ªº IO1812 ¤â¥U¤W¦C¥Xªº COM5-COM8 ¬O¿ùªº¡D¥¦­ÌÀ³¸Ó¬O COM5=0x250, COM6=0x258, COM7=0x260, ¥H¤Î     COM8=0x268¡D

ª`·N: Digi PC/8 Interrupt Status Register ¬O 0x140¡D

ª`·N: ¹ï©ó AST Fourport¡A§A¥²¶·¦b {\ttfamily rc.serial} ¤¤«ü©w {\ttfamily skip\_test}¡D




\subsection{´¼¼z«¬¦h°ðªOªºª`·N¨Æ¶µ}

¾\ÅªÀHªþÅX°Êµ{¦¡¦Ó¨Óªº¸ê°T¡D
³o¨ÇªO¨Ï¥Î¤F¯S®íªº¸Ë¸m¡A¦Ó«D¼Ð·Çªº¡D³o¨Ç¸ê°Tµø§AªºµwÅé¦Ó©w¡D




\section{§AÀ³ª¾¹Dªº¦³½ìµ{¦¡}


\subsection{¤°»ò¬O {\ttfamily getty}?}

{\ttfamily getty} ¬O¦b§AÃ±¤J Unix ¾÷¾¹ªº®É­Ô³B²zÃ±¤Jµ{§Çªº¤@¤äµ{¦¡¡D
¦pªG§A§Æ±æ§Aªº Linux ¾÷¾¹¯à°÷¨Ï¥Î¼Æ¾Ú¾÷¼·¤Jªº¸Ü§A·|»Ý­n {\ttfamily getty}¡D
¦pªG§A¥u»Ý­n¥Î¼Æ¾Ú¾÷¼·¥Xªº¸Ü§A¤£»Ý­n¥Î {\ttfamily getty}¡D
¦³¤TºØ¸g±`°t¦X Linux ¨Ï¥Îªºª©¥»: {\ttfamily getty\_ps}, {\ttfamily mgetty} ¥H¤Î {\ttfamily agetty}¡D
³o¨Çµ{¦¡ªº»yªk¬O¤£¦Pªº¡A©Ò¥H¤£½×§A¥Î¤°»ò {\ttfamily getty} ½Ð½T©w§A¨Ï¥Î¤F¥¿½Tªº»yªk¡D




\subsubsection{Ãö©ó {\ttfamily getty\_ps}}

        
¤j³¡¤À Linux  ¦w¸Ë®M¥ó³£¦w¸Ë¤F {\ttfamily getty\_ps} ®M¥ó¡D¥¦¥]§t¤F¨â­Óµ{¦¡:
{\ttfamily getty} ¬O¥Ñ¥D±±¥x¡A¥H¤Î²×ºÝ¾÷³]³Æ©Ò¨Ï¥Î¡A¦Ó {\ttfamily uugetty} «h¬O¥Ñ¼Æ¾Ú¾÷©Ò¨Ï¥Îªº¡D
¦]¬°§Ú¥»¨­¬O¨Ï¥Î³o­Óª©¥»ªº {\ttfamily getty}¡A©Ò¥H¦b³o¥÷¤å¥ó¤¤§Ú±N·|µÛ­«©ó¦¹®M¥ó¡D




\subsubsection{Ãö©ó {\ttfamily mgetty}}

{\ttfamily mgetty} ¬O¤@­Ó¦b¼Æ¾Ú¾÷¤W¨Ï¥Îªº {\ttfamily getty} ª©¥»¡D
°£¤F¯à°÷¤¹³\Ã±¤J¤§¥~¡A {\ttfamily mgetty} ¤]´£¨Ñ¶Ç¯u(FAX)¤ä´©¤Î¦Û°Ê PPP °»´ú¡D
³o®M {\ttfamily mgetty} ªº¤å¥ó¼g±o¬Û·í¦a¦n¡A¦]¦Ó¤£»Ý­n¦A¸É¥R¤°»ò¡D½Ð°Ñ¦Ò¥¦ªº¦w¸Ë»¡©ú¡D
§A¤]¥i¥H¦b {\ttfamily \onlynameurl{http://www.leo.org/\~{}doering/mgetty/}} §ä¨ì {\ttfamily mgetty} ªº³Ì·s¸ê°T¡D




\subsubsection{Ãö©ó {\ttfamily agetty}}

{\ttfamily agetty} ¬O²Ä¤TºØ {\ttfamily getty} ÅÜ«¬¡D
¥¦¬O {\ttfamily getty} ¤@­ÓÂ²³æªº¡A§¹¾ãªº¥\¯à¹ê§@¡A¾A¦X¥Î¦bµêÀÀ¥D±±¥x©Î²×ºÝ¾÷¦Ó«D¼Æ¾Ú¾÷¤W¡D




\subsection{¤°»ò¬O {\ttfamily setserial}?}

{\ttfamily setserial} ¬O¤@¤ä¥i¥HÅý§A¬d¬Ý¨Ã­×§ï¦ê¦C³]³Æ¦UºØÄÝ©Êªºµ{¦¡¡A¥]¬A¥¦­Ì©Ò¨Ï¥Îªº°ð¦ì§}¡A¤¤Â_¡A¥H¤Î¨ä¥¦¦ê¦C°ð¿ï¶µ¡D
§A¥i¥HÂÇ¥Ñ°õ¦æ¤£¥[°Ñ¼Æªº {\ttfamily setserial} ¨ÓÀò¨úª©¥»°T®§¡D

¦b§Aªº  Linux ¨t²Î±Ò°Ê®É¡A¥u¦³ {\ttfamily ttyS$\{$0-3$\}$} ·|¥H¹w³]ªº IRQ 4 ¥H¤Î 3 ¨Ó¶i¦æ°t¸m¡D
©Ò¥H¡A¦pªG§A¦³¥ô¦ó¥Ñ¨ä¥¦¬É­±¥d´£¨Ñªº¦ê¦C°ð©Î¬O {\ttfamily ttyS$\{$0-3$\}$} ¨Ï¥Î«D¼Ð·ÇªºµwÅé¤¤Â_(IRQ)ªº¸Ü¡A
§A{\itshape ¥²¶·\/}¥Î³o¤äµ{¦¡¨Ó°t¸m³o¨Ç¦ê¦C°ð¡D­nª¾¹D©Ò¦³ªº¿ï¶µ½Ð°Ñ¦Ò½u¤W¤â¥U¡D




\section{§Ú«ç»ò¥Î¼Æ¾Ú¾÷¼·¸¹¥X¥h?\label{dialout}}


\subsection{µwÅé»Ý¨D}

­º¥ý¡A­n½T©w§A¾Ö¦³¥¿½Tªº³s±µ½u¡D§Aªº¼Æ¾Ú¾÷»Ý­n¤@±øª½±µªº (straight through) ³s±µ½u¡A¨S¦³¥ô¦ó¸õ½u (no pins crossed)¡D
¥ô¦ó¤@®a¹q¸£°Ó©±³£¦³¡D­n½T©w±µÀYªº§Î¦¡¬O¹ïªº¡D¦pªG§A¨Ï¥Îªº¬O DB25 ¦ê¦C°ð¡A¥¦À³¸Ó¬O¤½ªº DB25 ±µÀY¡D
§â§Aªº¼Æ¾Ú¾÷±µ¨ì¨ä¤¤¤@­Ó¦ê¦C°ð¤W¡D¦pªG§A»Ý­nÃö©ó³o­Ó°Ê§@ªº»²§U»¡©ú½Ð°Ñ¦Ò§Aªº¼Æ¾Ú¾÷¤â¥U¡D




\subsubsection{¤º±µ¦¡¼Æ¾Ú¾÷ª`·N¨Æ¶µ}

¹ï©ó¤º±µ¦¡¼Æ¾Ú¾÷¦Ó¨¥¡A§A¤£»Ý­n³s±µ½u¡D¤º±µ¦¡¼Æ¾Ú¾÷¤£»Ý­n¦ê¦C°ð¡A¥¦¦Û¤v¦³¤º«Ø¤@­Ó¡D
§A¥u­n°t¸m¤@­Ó¨S¦³³Q¨Ï¥ÎªºµwÅé¤¤Â_µ¹¥¦¡A¨Ã¥B°t¸m¸Ó°ðªº¿é¥X¤J¦ì§}¡D¦pªG§A¥d¦b¬Y­Ó°ÝÃD¤W½Ð°Ñ¦Ò§Aªº¼Æ¾Ú¾÷¤â¥U¡D
¦P¼Ë¡A¦pªG§A»Ý­nÃö©ó¿ï¾Ü¤¤Â_¥H¤Î¦ì§}¤WªºÀ°§U¡A°Ñ¾\ \ref{irqaddr} {(§Ú¯à¨Ï¥Î¶W¹L¨â­Óªº¦ê¦C¸Ë¸m¶Ü?)} ¤@¸`ªº»¡©ú¡D

¦b¬Y¨Ç¥D¾÷ªO¤W§A¥²¶·Ãö±¼³Q¼Æ¾Ú¾÷¨ú¥Nªº¦ê¦C°ð¥HÁ×§K½Ä¬ð¡D
³o¥i¸g¥Ñ¸õ½u©Î BIOS ªº³]©w¨Ó¿ì¨ì¡Aµø§Aªº¥D¾÷ªO¦Ó©w¡D¬d¾\§Aªº¥D¾÷ªO¤â¥U¡D

¥Ñ©ó IBM8514 µø°T¥dªº¤@­Ó¿ù»~¡A¦pªG§A·Q­n±N§Aªº¤º±µ¦¡¼Æ¾Ú¾÷³]¦b {\ttfamily ttyS3} ªº¸Ü¥i¯à·|¾D¹J¤@¨Ç°ÝÃD¡D
¦pªG Linux ¨S¦³°»´ú¨ì§A³]¦b {\ttfamily ttyS3} ¤Wªº¤º±µ¦¡¼Æ¾Ú¾÷¡A§A¥i¥H¨Ï¥Î {\ttfamily setserial} µ{¦¡¨Ó³]©wµM«á¼Æ¾Ú¾÷±N·|¥¿±`¹B§@¡D
³]¦b {\ttfamily ttyS$\{$0-2$\}$} ¤Wªº¤º±µ¦¡¼Æ¾Ú¾÷¦b°»´ú¤WÀ³¸Ó¤£·|¦³¥ô¦ó°ÝÃD¡D
¥Ñ©ó¦¹µø°T¥dªº¿ù»~ Linux ¦b {\ttfamily ttyS3} ¨S¦³¥ô¦ó¦Û°Ê°»´úªº°Ê§@¡D




\subsection{»P§Aªº¼Æ¾Ú¾÷¥æ½Í}

¦b§A¨Ï¥Î½ÆÂøªº³q°Tµ{¦¡¦p SLIP ©Î PPP ¤§«e¥ý¥H {\ttfamily kermit} ©Î¨ä¥¦Â²³æªº³q°Tµ{¦¡¨Ó´ú¸Õ³o¨Ç³]©w¡D
§A¥i¥H±q {\ttfamily \onlynameurl{http://www.columbia.edu/kermit/}} ¥H¤Î¬M®g¸`ÂI¤W§ä¨ì³Ì·sªº {\ttfamily kermit} ª©¥»¡D
¨Ò¦p¡A­n¬O§Aªº¼Æ¾Ú¾÷³]¦b {\ttfamily ttyS3} ¤W¡A¦Ó¥B¥i¥H±µ¨ü 115200 bps ªº¸Ü¡A§A¥i¥H³o¼Ë°µ:
\begin{tscreen}
\begin{verbatim}
linux# kermit
C-Kermit 6.0.192, 6 Sep 96, for Linux
 Copyright (C) 1985, 1996,
  Trustees of Columbia University in the City of New York.
Default file-transfer mode is BINARY
Type ? or HELP for help.
C-Kermit>set line /dev/ttyS3
C-Kermit>set carrier-watch off
C-Kermit>set speed 115200
/dev/ttyS3, 115200 bps
C-Kermit>c
Connecting to /dev/ttyS3, speed 115200.
The escape character is Ctrl-\ (ASCII 28, FS)
Type the escape character followed by C to get back,
or followed by ? to see other options.
ATE1Q0V1                           ; ³o¬O§AÁä¤Jªº¨Ã«ö¤U Enter Áä
OK                                 ; ¼Æ¾Ú¾÷À³¸Ó¦^À³³o­Ó
\end{verbatim}
\end{tscreen}


¦pªG§Aªº¼Æ¾Ú¾÷¹ï {\ttfamily AT} «ü¥O¸s¦³¦^À³¡A¨º»ò§A¥i¥H°²©w§Aªº¼Æ¾Ú¾÷¦b Linux ³o¤@ºÝ¯à¥¿½T¹B§@¡D
²{¦b¸ÕµÛ¼·µ¹¥t¤@¥x¼Æ¾Ú¾÷:
\begin{tscreen}
\begin{verbatim}
ATDT7654321
\end{verbatim}
\end{tscreen}

¨ä¤¤ 7654321 ¬O¤@­Ó¹q¸Ü¸¹½X¡D¦pªG§Aªº¬O¯ß½Ä½u¸ô(pulse line)ªº¸Ü¥Î ATDP ¦Ó¤£¬O ATDT¡D
¦pªG¥i¥H¼·±o¥X¥h¡A§Aªº¼Æ¾Ú¾÷´N¥i¥¿±`¹B§@¡D



¦^¨ì {\ttfamily kermit} ªº´£¥Ü²Å¸¹¤U¡A«ö¦í Ctrl Áä¡A«ö¤U $\backslash$ (backslash) ¿ý¡AµM«á©ñ¶} Ctrl ¿ý¡A¦A«ö¤U C Áä:
\begin{tscreen}
\begin{verbatim}
Ctrl-\-C
(Back at linux)
C-Kermit>quit
linux#
\end{verbatim}
\end{tscreen}


³o­Ó¤£¹L¬O¥Î"¤â°Ê"¤è¦¡ªº¼·¸¹´ú¸Õ¡D¥¿±`ªº¤èªk¬OÅý {\ttfamily kermit} ¥Î¥¦¤º«Øªº¼Æ¾Ú¾÷¸ê®Æ®w¦Û°Ê¬°§A¼·¸¹¡A¨Ò¦p¡A¨Ï¥Î US Robotics (USR) modem:

\begin{tscreen}
\begin{verbatim}
linux# kermit
C-Kermit 6.0.192, 6 Sep 1997, for Linux
 Copyright (C) 1985, 1996,
  Trustees of Columbia University in the City of New York.
Default file-transfer mode is BINARY
Type ? or HELP for help
C-Kermit>set modem type usr        ; ¿ï¾Ü¼Æ¾Ú¾÷«¬¦¡
C-Kermit>set line /dev/ttyS3       ; ¿ï¾Ü³q°T¸Ë¸m
C-Kermit>set speed 115200          ; ³]©w³q°T³t«×
C-Kermit>dial 7654321              ; ¼·¸¹
 Number: 7654321
 Device=/dev/ttyS3, modem=usr, speed=115200
 Call completed.<BEEP>
Connecting to /dev/ttyS3, speed 115200
The escape character is Ctrl-\ (ASCII 28, FS).
Type the escape character followed by C to get back,
or followed by ? to see other options.

Welcome to ...

login:
\end{verbatim}
\end{tscreen}


¦pªG§A»Ý­n¤@¨Ç«ü¤Þ¡A¬d¾\¦³Ãö \ref{comms} {(³q°T³nÅé)} ¤@¸`»¡©ú¡D



·í§A¥Î§Aªº¼Æ¾Ú¾÷¼·¸¹¥X¥h®É¡A±N§Aªº¼Æ¾Ú¾÷³]¨ì¥¦©Ò¯à¤ä´©ªº³Ì°ª³t«×¡D
Linux ªº {\ttfamily libc} 5.x ª©¥H¤W¤w¸g¤ä´©¨ì 115200 bps¡D
{\ttfamily libc} ³q±`©ñ¦b {\ttfamily /lib}¡A¦]¦¹¨ì¨º¸Ì¬Ý¤@¤U§A¥Î¤°»òª©¥»¡D
¦pªG Linux µLªk»{±o 57600 ©Î 115200 bps¡A¨º»ò§A¥²¶·¥Î {\ttfamily setserial} µ{¦¡¨Ó±N§Aªº¦ê¦C°ð³]¨ì§ó°ªªº³t«×¡D
Ãö©ó­n«ç»ò³]©w°Ñ¾\ \ref{spdhi} {(¦p¦ó±N§Úªº¦ê¦C°ð³]©w¬°§ó°ª³t«×?)} ¸Ó¸`»¡©ú¡D
µM«á¦b³q°Tµ{¦¡¸Ì±N³t«×³]¨ì 38400 bps¡D




\subsection{¼·¥X¥Îªº¼Æ¾Ú¾÷°t¸m}

¥u­n¼·¸¹¥X¥hªº¸Ü¡A§A¥i¥H¥ô·N¥H§A·Q­nªº¤è¦¡°t¸m§Aªº¼Æ¾Ú¾÷¡D
¦pªG§A­pµe¥Î§Aªº¼Æ¾Ú¾÷¨Ó±µ¨ü¼·±µ¡A¨º»ò§A{\itshape ¥²¶·\/}±N§Aªº¼Æ¾Ú¾÷°t¸m¦¨»P§A·Q­n°õ¦æªº {\ttfamily getty} ¦b¬Û¦P³t«×³]©w¤U¡D
©Ò¥H¡A¦pªG§A·Q­n¦b 38400 bps ªº³t«×¤U°õ¦æ {\ttfamily getty} ªº¸Ü¡A¦b°t¸m§A¼Æ¾Ú¾÷ªº®É­Ô±N³t«×³]¦¨ 38400 bps¡D
³o¼Ë°µ¬O¬°¤FÁ×§K§Aªº¹q¸£»P¼Æ¾Ú¾÷¤§¶¡ªº³t«×µLªk°t¦X¡D
¤@¯ë¨Ó»¡¡A¶}±Ò¿ù»~®Õ¥¿¤ÎµwÅé¬y¶q±±¨îªº¥X¼t³]©w­È¬O³Ì¾A¦X¼·¥X¥Îªº¼Æ¾Ú¾÷¡A³o¨Ç³]©w­È¥i¬d¾\§Aªº¼Æ¾Ú¾÷¤â¥U¡D




\subsection{µwÅé¬y¶q±±¨î}

¦pªG§Aªº¼Æ¾Ú¾÷¤ä´©µwÅé¬y¶q±±¨î(RTS/CTS)ªº¸Ü¡A §Ú±j¯P¦a«ØÄ³§A¥h¨Ï¥Î¥¦¡D
³o¹ï©ó¤ä´©¸ê®ÆÀ£ÁYªº¼Æ¾Ú¾÷±N®æ¥~­«­n¡D­º¥ý¡A§A¥²¶·¦b¦ê¦C°ð¥»¨­¤W­±±Ò°Ê RTS/CTS ¬y¶q±±¨î¥\¯à¡D
³o³Ì¦n¬O¦b±Ò°Ê¨t²Îªº®É­Ô°µ¡A¹³¬O©ñ¦b {\ttfamily /etc/rc.d/rc.local} ©Î¬O {\ttfamily /etc/rc.d/rc.serial} ¸Ì­±¡D
­n½T©w³o¨ÇÀÉ®×·|³Q¥D­nªº {\ttfamily rc.sysinit} ÀÉ®×°õ¦æ¡I§A»Ý­n¹ï¨C¤@­Ó§A·Q­n±Ò°ÊµwÅé¬y¶q±±¨îªº¦ê¦C°ð°õ¦æ¤U¦C¾Þ§@¡G
\begin{tscreen}
\begin{verbatim}
stty crtscts < /dev/ttyS3
\end{verbatim}
\end{tscreen}
 
§A¤]¥²¶·¦b§Aªº¼Æ¾Ú¾÷¤W±Ò°Ê RTC/CTS  ¬y¶q±±¨î¡D­n«ç»ò°µ½Ð°Ñ¦Ò§Aªº¼Æ¾Ú¾÷¤â¥U¡A¦]¬°³o¦b¤£¦Pªº¼Æ¾Ú¾÷»s³y°Ó¤§¶¡¬O¤£¦Pªº¡D
¦pªG§Aªº¼Æ¾Ú¾÷¤ä´©³]©wÀx¦sªº¸Ü«h­n½T©w±N°t¸m¦s¤J§Aªº¼Æ¾Ú¾÷¡D




\section{§Ú­n«ç»ò¼Ë¥Î¼Æ¾Ú¾÷¥H {\ttfamily getty\_ps} ¼·¤J¤Î¼·¥X?}

Åý§Aªº¼Æ¾Ú¾÷¯à°÷¥¿½T¦a¼·¸¹¥X¥h¡D¦pªG§AÁÙ¨S¦³Åª¹L \ref{dialout} {(§Ú«ç»ò¥Î¼Æ¾Ú¾÷¼·¸¹¥X¥h)} ¤@¸`ªº¸Ü{\itshape ²{¦b¥hÅª\/}¡I
¥¦¥]§t¦³{\itshape «D±`\/}­«­nªº³]©w¸ê°T¡D¦pªG§A¥u·Q¥Î¼Æ¾Ú¾÷¨Ó{\itshape ¼·¥X\/}ªº¸Ü§A{\itshape ¤£»Ý­n\/}Åª¦¹¸`¡D




\subsection{¼·¤J¤Î¼·¥Xªº¼Æ¾Ú¾÷°t¸m}

­n¥Î¨Ó±µ¨ü¼·±µ¥H¤Î¼·¸¹¥X¥hªº¸Ü¡A¨º»ò§A{\itshape ¥²¶·\/}½T¹ê¦a³]©w§Aªº¼Æ¾Ú¾÷¡]¦A¤@¦¸¹ï§Aªº¼Æ¾Ú¾÷¨Ï¥Î {\ttfamily AT} «ü¥O¸s¡^¡G
\begin{tscreen}
\begin{verbatim}
E1       ¥»¦a¦^À³«ü¥O
Q0       ¦^³øµ²ªG¦^À³
V1       ¶}±Ò¤¾ªø¼Ò¦¡
S0=0     ¤£­n±µÅ¥ (uugetty ¥H WAITFOR ¿ï¶µ¨Ó³B²z)
\end{verbatim}
\end{tscreen}

¦pªG§A¨S¦³¥¿½T¦a³]©w¡A©ñ¦b§A°t¸mÀÉ¸Ìªº°_©l({\ttfamily INIT})¦r¦ê¥i¯à·|¥¢±Ñ¡A¦]¦Ó°±¦í¾ã­Óµ{§Ç¡D
¦ý¬O¡A¤U­±¦³§ó¦h°t¸mÀÉªº¿ï¶µ...
\begin{tscreen}
\begin{verbatim}
&C1     DCD ¥u¦³¦b³s½u¥H«á¤~¶}±Ò
&S0     DSR ¥Ã»·¬°¶}±Ò
        DTR ¶}±Ò/Ãö³¬ ­«¸m¼Æ¾Ú¾÷¡]¬O¼Æ¾Ú¾÷»s³y°Ó¦Ó©w - RTFM)
\end{verbatim}
\end{tscreen}

³o¨Ç·|¼vÅT§A¼Æ¾Ú¾÷¦³Ãö¶}©l¥H¤Îµ²§ô¼·¸¹ªº°Ê§@¡D

¦pªG§Aªº¼Æ¾Ú¾÷¤£¤ä´©Àx¦s³]©w¡A§A¥i¥H³z¹L¦b§A°t¸mÀÉ¸Ìªº°_©l¦r¦ê¨Ó³]©w³o¨ÇªF¦è¡D
°Ñ¾\¤U­±©Ò­z¡D¦³¤@¨Ç¼Æ¾Ú¾÷¬O¥H DIP ¶}Ãö¨Ó¼vÅT¼È¦s¾¹ªº³]©w¡A¤]­n½T©w³o¨Ç³]©w¬O¥¿½Tªº¡D

§Ú¤w¸g¶}©lµÛ¤â¦¬¶°¤£¦PºØÃþ¼Æ¾Ú¾÷ªº³]©w¡D
¨ì¥Ø«e¬°¤î¡A§ÚÁÙ¥u¦³¥¦­Ìªº¤@¤p³¡¤À¡A¦pªG§A·Q­n±H°eµ¹§Ú§A¥Ø«e©Ò¥Î°t¸m¡A«D±`Åwªï!
§A¥i¥H±q³o¨Ç¨ú±o³]¨Ç³]©w: {\ttfamily \onlynameurl{ftp://ftp.cc.gatech.edu/pub/people/gregh/modem-configs}}¡D

ª`·N: ¬°¤FÅý§Úªº USR Courier V.34 ¼Æ¾Ú¾÷¦b DTR °T¸¹±¼¤U¥h«á¥¿±`¦a­«¸m¡A§Ú¥²¶·³]©w {\ttfamily \&D2} ¤Î {\ttfamily S13=1}(³o¬O³]©w¼È¦s¾¹ S13 ªº bit 0)¡D³o½T©w¯à¦b USR Sportster V.34 ¤W¹B§@¥¿±`¡D

ª`·N: ¬Y¨Ç Supra ¼Æ¾Ú¾÷³B²z DCD °T¸¹ªº¤è¦¡²§©ó¨ä¥¦ªº¼Æ¾Ú¾÷¡D
¦pªG§A¦b¥Î Supra ¼Æ¾Ú¾÷¡A¸ÕµÛ³]©w¬° {\ttfamily \&C0} ¦Ó{\itshape ¤£¬O\/} {\ttfamily \&C1}¡D
§A¤]¥²¶·³]©w {\ttfamily \&D2} ¨Ï¤§¥¿±`¦a³B²z DTR °T¸¹¡D




\subsection{¦w¸Ë {\ttfamily getty\_ps}}

±q {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/system/serial}} ³Ì·sªºª©¥»¡D
¯S§O¦a¡A¦pªG§A·Q¨Ï¥Î°ª³t³q°T(57600 ©Î 115200 bps)¡A§A¥²¶·¨ú±o 2.0.7j ©Î¥H«áªºª©¥»¡D
§A¤]¥²¶·¦³ libc 5.x ©Î¤§«áªºª©¥»¡D

¨Ì·Ó¹w³]­È¡A{\ttfamily getty\_ps} ±N·|·Ó Linux ªºÀÉ®×¨t²Î¼Ð·Ç(FSSTND, File System Standard)¨Ó°t¸m¡A³o­Ó·N«ä¬O¤G¶i¦ì½X±N·|©ñ¦b {\ttfamily /sbin} ¤U¡A¦Ó°t¸mÀÉ±N·|¥H {\ttfamily /etc/conf.$\{$uu$\}$getty.ttyS}{\itshape N\/} ¨Ó©R¦W¡D
³oÂI¨Ã¤£¯à±q¤å¥ó±Ô­z¤¤§ä¨ì¡I¥¦¤]·|°²©w lock files ±N±o­n©ñ¨ì {\ttfamily /var/lock} ¥Ø¿ý¸Ì¡D­n½T©w§A¦³ {\ttfamily /var/lock} ³o­Ó¥Ø¿ý¡D

¦pªG§A¤£·Q¨Ì·Ó FSSTND ªº¸Ü¡A¤G¶i¦ì½X±N·|©ñ¨ì {\ttfamily /etc} ¸Ì­±¡A¦Ó°t¸mÀÉ±N·|©ñ¨ì {\ttfamily /etc/default/$\{$uu$\}$getty.ttyS}{\itshape N\/} ¸Ì­±¡A¦Ó lock files «h±N·|©ñ¨ì {\ttfamily /usr/spool/uucp} ¸Ì­±¡D
¦pªG§A¦³¨Ï¥Î UUCP ªº¸Ü¨º»ò§Ú«ØÄ³³o¼Ë°µ¡A¦]¬°¦pªG§A§â lock files ·h¨ì UUCP µLªk§ä¨ìªº¦a¤è¥h¨º»ò¥¦±N·|¥X°ÝÃDªº¡D

{\ttfamily getty\_ps} ¤]¥i¨Ï¥Î {\ttfamily syslogd} ¨Ó°O¿ý°T®§¡D¦pªG§A¥Ø«e¨S¦³°õ¦æ¥¦ªº¸Ü¡A°Ñ¾\ {\ttfamily syslogd(1)} ¥H¤Î {\ttfamily syslog.conf(5)} ªº½u¤W¤â¥U¨Ó³]©w {\ttfamily syslogd}¡D
°T®§·|Àu¥ý¥H LOG\_AUTH °O¿ý¡A¿ù»~¨Ï¥Î LOG\_ERR °O¿ý¡A¦Ó°£¿ù¨Ï¥Î LOG\_DEBUG¡D
¦pªG§A¤£·Q¨Ï¥Î syslogd ªº¸Ü¨º»ò§A¥i¥H½s¿è¦b {\ttfamily getty\_ps} ­ì©lÀÉ®×¸Ìªº {\ttfamily tune.h} ¥Î¤@­Ó°O¿ýÀÉ¨Ó¨ú¥N¡A¹w³]ÀÉ¦W¬° {\ttfamily /var/adm/getty.log}¡D

        
¨M©w¦n¬O§_­n¨Ì·Ó FSSTND ¥H¤Î¨Ï¥Î syslog¡D§A¤]¥i¥H¿ï¾Ü¨âªÌªº²Õ¦X¡D
½s¿è {\ttfamily Makefile}¡A{\ttfamily tune.h} ¥H¤Î {\ttfamily config.h} ¨Ó¤ÏÀ³§A©Ò§@ªº¨M©w¡D
µM«á¡A®Ú¾Ú®M¥ó¸Ìªº»¡©ú½sÄ¶¤Î¦w¸Ë¡D

        

±q²{¦b°_¡A©Ò¦³½Í¨ì {\ttfamily getty} ªº¦a¤è³£¬O«ü {\ttfamily getty\_ps} ¦Ó¨¥¡D
½Í¨ì {\ttfamily uugetty} «h¬O«ü {\ttfamily getty\_ps} ®M¥ó¸Ìªº {\ttfamily uugetty} ¦Ó¨¥¡D
³o¨Ç«ü¥O¦b {\ttfamily mgetty} ©Î {\ttfamily agetty} ¤W±N¤£¯à¹B§@¡D




\subsection{³]©w {\ttfamily uugetty}}

¬°¤F­n¯à±q§Aªº¼Æ¾Ú¾÷¼·¤J¤Î¼·¥X¡A§Ú­Ì·Q­n¥Î {\ttfamily uugetty}¡Duugetty °õ¦æ«Ü­«­nªº lock file ÀË¬d¡D
¦pªG¨S¦³ªº¸Ü§ó·s {\ttfamily /etc/gettydefs} ¥H«K¬°¼Æ¾Ú¾÷¼W¥[¶µ¥Ø(ª`·N¨ì³o¸Ìªº¶µ¥Ø¤¬¬Û°Ñ¦Ò¡A¥¦­Ì¨Ã«D©T©w³t«× - ¨C­Ó¶µ¥Ø¤§¶¡ªºªÅ¥Õ¦æ¬O¥²­nªº):
\begin{tscreen}
\begin{verbatim}
# Modem entries
115200# B115200 CS8 # B115200 SANE -ISTRIP HUPCL #@S @L @B login: #57600

57600# B57600 CS8 # B57600 SANE -ISTRIP HUPCL #@S @L @B login: #38400

38400# B38400 CS8 # B38400 SANE -ISTRIP HUPCL #@S @L @B login: #19200

19200# B19200 CS8 # B19200 SANE -ISTRIP HUPCL #@S @L @B login: #9600

9600# B9600 CS8 # B9600 SANE -ISTRIP HUPCL #@S @L @B login: #2400

2400# B2400 CS8 # B2400 SANE -ISTRIP HUPCL #@S @L @B login: #115200
\end{verbatim}
\end{tscreen}


¦pªG§A¦³ 9600 bps ©Î§ó§Ö¥B¨ã¸ê®ÆÀ£ÁY¥\¯àªº¼Æ¾Ú¾÷¡A§A¥i¥HÂê©w§Aªº¦ê¦C°ð³t«×¦ÓÅý¼Æ¾Ú¾÷¥h³B²z¶Ç¿éªº¨ä¥¦³t«×¡D
µM«á¡A¤£¹³¤W­±¦b {\ttfamily /etc/gettydefs} ¸Ìªº¤@³s¦ê¦Cªí¡A¥u»Ý¬°¼Æ¾Ú¾÷¥[¤W¤@¦æ¡A¨Ò¦p:
\begin{tscreen}
\begin{verbatim}
# 115200 fixed speed
F115200# B115200 CS8 # B115200 SANE -ISTRIP HUPCL #@S @L @B login: #F115200
\end{verbatim}
\end{tscreen}


        
¦pªG§A±N§Aªº¼Æ¾Ú¾÷³]¦¨ RTS/CTS °õ¦æµwÅé¬y¶q±±¨îªº¸Ü¡A¨º»ò§A¥i¥H±N {\ttfamily CRTSCTS} ¥[¨ì³o¨Ç¶µ¥Ø¸Ì¡G
\begin{tscreen}
\begin{verbatim}
# 115200 fixed speed with hardware flow control
F115200# B115200 CS8 CRTSCTS # B115200 SANE -ISTRIP HUPCL CRTSCTS #@S @L @B login: #F115200
\end{verbatim}
\end{tscreen}


¦pªG§A­nªº¸Ü¡A§A¥i¥HÅý {\ttfamily uugetty} ¦bÃ±¤J®Éªº¼ÐÃD¤W¦L¥X¨Ç¦³½ìªºªF¦è¡D
¦b§Úªº¨Ò¤l¸Ì¡A§Ú¦L¥X¨t²Î¦WºÙ¡A¦ê¦C½u¸ô¡A¥H¤Î¥Ø«eªº¨C¬í¦ì¤¸¶Ç¿é²v¡D
§A¥i¥H¥[¤J¨ä¥¦ªºªF¦è¡G
\begin{tscreen}
\begin{verbatim}
       @B    ¥Ø«eªº¨C¬í¦ì¤¸¶Ç¿é²v(bps, ¦b¬Ý¨ì @B ®É¦ô­pªº)¡D
       @D    ²{¦b¤é´Á, ®æ¦¡ MM/DD/YY¡D
       @L    getty ©Ò³s±µªº¦ê¦C½u¸ô¡D
       @S    ¨t²Î¦WºÙ¡D
       @T    ²{¦b®É¶¡¡A®æ¦¡ HH:MM:SS (24 ¤p®É¨î)¡D
       @U    ¥Ø«eÃ±¤Jªº¨Ï¥ÎªÌ¡D³o¬O¦b /etc/utmp ÀÉ¤¤«DªÅ ut_name Äæ¦ì¶µ¥Øªº­p¼Æ­È¡D
       @V    ª©¥»­È¡A¦b¹w³]ÀÉ¤¤µ¹©wªº¡D
       ¦pªG­nÅã¥Ü '@' ²Å¸¹ªº¸Ü¡A¥Î '\@' ©Î '@@'¡D
\end{verbatim}
\end{tscreen}


±µ¤U¨Ó¡A½T©w§A¼Æ¾Ú¾÷©Ò±µªº¦ê¦C°ð¦³¿é¥X¤Î¿é¤Jªº³]³Æ¡D
¦pªG§Aªº¼Æ¾Ú¾÷³]¦b {\ttfamily ttyS3} ªº¸Ü§A±N·|»Ý­n {\ttfamily /dev/cua3}¡A¥H¤Î {\ttfamily /dev/ttyS3} ³o¨â­Ó³]³Æ¡D
¦pªG§A¨S¦³¥¿½Tªº³]³Æ¡A°Ñ¾\ \ref{dev} {(¦b /dev ¤¤«Ø¥ß³]³Æ)} ¸Ó¸`»¡©ú¦p¦ó«Ø¥ß³]³Æ¡A¨Ã¥B«Ø¥ß³o¨Ç³]³Æ¡D
¦pªG§A§Æ±æ¦b§Aªº {\ttfamily uugetty} ¥¿¦bºÊµø³o­Ó¦ê¦C°ð¬O§_¦³¤HÃ±¤J®ÉÁÙ¯à°÷¥Î¼Æ¾Ú¾÷¼·¥Xªº¸Ü¡A¥Î {\ttfamily /dev/cua}{\itshape N\/} ³]³Æ¦Ó¤£­n¥Î {\ttfamily /dev/ttyS}{\itshape N\/}¡D

·í§A¥¿¦b½s¿è {\ttfamily /etc/gettydefs} ®É¡A§A¥i¥H³o¼Ë¨ÓÀË¬d¥¦ªº»yªk¬O§_¥¿½T:   
\begin{tscreen}
\begin{verbatim}
linux# getty -c /etc/gettydefs
\end{verbatim}
\end{tscreen}





\subsection{¦Û­q {\ttfamily uugetty}}

§A¦³³\¦h°Ñ¼Æ¥i¥H¥Î¨Ó§ïÅÜ§A©Ò¾Ö¦³ªº¨C¤@­Ó°ð¡D³o¨Ç¬O¥H¤À§O¹ï¨C¤@­Ó°ð¨Ï¥Î¤£¦P°t¸mÀÉªº¤è¦¡¨Ó¹ê§@ªº¡D
³o­Ó {\ttfamily /etc/conf.uugetty} ÀÉ®×·|³Q{\itshape ©Ò¦³\/}ªº {\ttfamily uugetty} ¦æµ{©Ò¨Ï¥Î¡A¦Ó {\ttfamily /etc/conf.uugetty.ttyS}{\itshape N\/} ¥u¥Ñ¨º­Ó°ð¨Ï¥Î¡D
¹w³]ªº°t¸mÀÉ½d¨Ò¥i¥H¦b {\ttfamily getty\_ps} ªº­ì©lÀÉ®×¸Ì§ä¨ì¡A³o¦bµ´¤j³¡¤Àªº Linux µo¦æ®M¥ó¸Ì­±³£·|¦³¡D
¦]¬°½g´Tªº¦Ò¶q¡A¨S¦³§â¥¦­Ì¦C¦b³o¸Ì¡D
­nª`·Nªº¬O¦pªG§A¥Îªº¬O¤ñ¸ûÂÂªº {\ttfamily getty} ª©¥»(¤ñ 2.0.7e ª©ÁÙÂÂ)¡A©ÎªÌ¬O§A¨S¦³¨Ì·Ó FSSTND ªº¸Ü¡A¨º»ò¹w³]ªºÀÉ®×±N·|¬O {\ttfamily /etc/default/uugetty.ttyS}{\itshape N\/}¡D
§Úªº {\ttfamily /etc/conf.uugetty.ttyS3} ¬Ý°_¨Ó¹³³o¼Ë:
\begin{tscreen}
\begin{verbatim}
# sample uugetty configuration file for a Hayes compatible modem to allow
# incoming modem connections
#
# alternate lock file to check... if this lock file exists, then uugetty is
# restarted so that the modem is re-initialized
ALTLOCK=cua3
ALTLINE=cua3
# line to initialize
INITLINE=cua3
# timeout to disconnect if idle...
TIMEOUT=60
# modem initialization string... 
# format: <expect> <send> ... (chat sequence)
INIT="" AT\r OK\r\n
WAITFOR=RING
CONNECT="" ATA\r CONNECT\s\A
# this line sets the time to delay before sending the login banner
DELAY=1
#DEBUG=010
\end{verbatim}
\end{tscreen}


±N¤U­±¨º¤@¦æ¥[¨ì§Aªº {\ttfamily /etc/inittab} ¸Ì¥h¡A¨º»ò {\ttfamily uugetty} ´N·|¦b§Aªº¦ê¦C°ð¤W°õ¦æ(¥Î§AÀô¹Òªº¥¿½T¸ê°T¨Ó¨ú¥N - °t¸mÀÉªº¦ì¸m¡A¦ê¦C°ð¦W¡A³t«×¡A¤Î¹w³]²×ºÝ¾÷§Î¦¡):
\begin{tscreen}
\begin{verbatim}
S3:456:respawn:/sbin/uugetty -d /etc/default/uugetty.ttyS3 ttyS3 F115200 vt100
\end{verbatim}
\end{tscreen}

­«·s±Ò°Ê {\ttfamily init}:
\begin{tscreen}
\begin{verbatim}
linux# init q 
\end{verbatim}
\end{tscreen}

¹ï©ó¦b§A {\ttfamily /etc/inittab} ¸Ì­±ªº³t«×°Ñ¼Æ¡A§A·|§Æ±æ¨Ï¥Î§A¼Æ¾Ú¾÷©Ò¯à¤ä´©ªº³Ì°ª¨C¬í¦ì¤¸¶Ç¿é²v¡D

²{¦b Linux ±N·|ÀH®ÉºÊµø§Aªº¦ê¦C°ð¬O§_¦³³s½u¡D±q§Oªº¦a¤è¼·¸¹¨ÃÃ±¤J§Aªº Linux ¾÷¾¹¡D

{\ttfamily uugetty} ÁÙ¦³§ó¦hªº¿ï¶µ¡A°Ñ¾\ getty (lm) ½u¤W¤â¥UÀò±o§ó§¹¾ãªº±Ô­z¡D
§Oªº¤£´£¥¦ÁÙ¦³±Æµ{(scheduling)ªº¥\¯à¡A¥H¤Î¦^¼·ªº¯à¤O¡D




\section{§Ú«ç»ò³]©w²×ºÝ¾÷³s½u¨ì§Úªº PC ¤W?}

¥»¸`ªº«ü¥Ü¯àÅý²×ºÝ¾÷¤Î¨ä¥¦¹q¸£³s¤W§Aªº Linux ¾÷¾¹ªº¦ê¦C°ð¡D




\subsection{µwÅé»Ý¨D}

­n½T©w§A¦³¤@±ø¥¿½Tªº³s±µ½u¡D¦b¹q¸£°Ó©±¶Rªº null modem ³s±µ½u´N¥i¥H³Ó¥ô¡D
¦ý¬O¥¦¤@©w±o­n¬O¤@±ø {\itshape null modem\/} ½u¡I³\¦hªº¹q¸£¯¸±N³oÃþªº³s±µ½u»¡¦¨¬O¦ê¦C¦Lªí±µ½u¡D
½T©w§A¬O¨Ï¥Î§Aªº¦ê¦C°ð¡A¤½ªº DB25 ©Î¬O DB9 ±µÀY¡A¦Ó¤£¬O§Aªº¨Ã¦C°ð(¥Àªº DB25 ©Î centronics)¡D

        
¹ï DB-25 ±µÀY¦Ó¨¥¡A¦Ü¤Ö§A±o­n¦³:
\begin{verbatim}
 
        PC male DB25                            Terminal DB25
        TxD   Transmit Data         2 --> 3     RxD   Receive Data
        RxD   Receive Data          3 <-- 2     TxD   Transmit Data
        SG    Signal Ground         7 --- 7     SG    Signal Ground
\end{verbatim}


¦pªG§A·Q­n¾Ö¦³¬y¶q±±¨î¥H¤ÎµwÅé³s½u¨ó°Ó(handshaking)ªº¸Ü¡A§A¥²¶·­n¦³¤@±ø§¹¾ãªº null modem ±µ½u¡G
\begin{verbatim}
        PC male DB25                            Terminal DB25
        TxD   Transmit Data         2 --> 3     RxD   Receive Data
        RxD   Receive Data          3 <-- 2     TxD   Transmit Data
        RTS   Request To Send       4 --> 5     CTS   Clear To Send
        CTS   Clear To Send         5 <-- 4     RTS   Request To Send
        DSR   Data Set Ready        6
                                    |
        DCD   Carrier Detect        8 <-- 20    DTR   Data Terminal Ready
        SG    Signal Ground         7 --- 7     SG    Signal Ground
                                          6     DSR   Data Set Ready
                                          |
        DTR   Data Terminal Ready  20 --> 8     DCD   Carrier Detect
\end{verbatim}


¦pªG§Aªº¦ê¦C°ð¤W¦³¤@­Ó DB9 ªº±µÀY¡A¸Õ¸Õ¬Ý¤U­±³o­Ó:
\begin{verbatim}
        PC DB9                                  Terminal DB25 
        RxD   Receive Data          2 <-- 2     TxD   Transmit Data
        TxD   Transmit Data         3 --> 3     RxD   Receive Data
        SG    Signal Ground         5 --- 7     SG    Signal Ground
\end{verbatim}


©ÎªÌ¡A¤@±ø§¹¾ãªº DB9 ¹ï DB25 null modem ³s±µ½u¡G
\begin{verbatim}
        PC DB9                                  Terminal DB25
        RxD   Receive Data          2 <-- 2     TxD   Transmit Data
        TxD   Transmit Data         3 --> 3     RxD   Receive Data
                                          6     DSR   Data Set Ready
                                          |
        DTR   Data Terminal Ready   4 --> 8     DCD   Carrier Detect
        GND   Signal Ground         5 --- 7     GND   Signal Ground
        DCD   Carrier Detect        1
                                    |
        DSR   Data Set Ready        6 <-- 20    DTR   Data Terminal Ready
        RTS   Request To Send       7 --> 5     CTS   Clear To Send
        CTS   Clear To Send         8 <-- 4     RTS   Request To Send
        (RI   Ring Indicator        9 not needed)
\end{verbatim}

(¨S¿ù! ²Ä¤G¤ä¤Î²Ä¤T¤ä¸}¦b DB9 ³s±µÀY¤W{\itshape ½T¹ê\/}©M DB25 ±µÀY·N¸q¬Û¤Ï!)

¦pªG¨Ï¥Îªº¨Ã¤£¬O§¹¾ãªº null modem  ³s±µ½uªº¸Ü¡A§A¥i¯à±o­n°µ¤U­±³o­Ó´ÛÄFªº§Þ¥©:
¦b§A¹q¸£³oÃäªº±µÀY¤W¡A§â RTS ¸ò CTS ±µ¦b¤@°_¡A¦Ó¥B¤]§â DSR, DCD ¥H¤Î DTR ±µ¦b¤@°_¡D
¥Î³o­Ó¤èªk¡A·í¹q¸£­n¨D¤@­Ó¥¿½TªºµwÅé³s½u¨ó°Ó«H¸¹®É¡A¥¦´N¥i¥H±o¨ì(±q¥¦¦Û¤vµo¥Xªº)¡D

²{¦b§A¤w¸g¦³¥¿½Tªº³s±µ½u¡A§â§Aªº²×ºÝ¾÷³s±µ¨ì§Aªº¹q¸£¤W¡D
¦pªG§A¥i¥Hªº¸Ü¡A§i¶D§Aªº²×ºÝ¾÷©¿²¤¼Æ¾Ú¾÷±±¨î«H¸¹¡D
¸Õ¸Õ¬Ý¥Î 9600 bps, 8 data bits, 1 stop bit, no parity bits ¨Ó³]©w²×ºÝ¾÷¡D




\subsection{³]©w {\ttfamily getty}}

¦b {\ttfamily /etc/gettydefs} ¸Ì­±¼W¥[¤@­Óµ¹ {\ttfamily getty} ¥Î¨Ó³s±µ§A²×ºÝ¾÷¶µ¥Ø¡A¦pªGÁÙ¨S¦³³o¶µªº¸Ü:
\begin{tscreen}
\begin{verbatim}
# 38400 bps Dumb Terminal entry
DT38400# B38400 CS8 CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S @L login: #DT38400

# 19200 bps Dumb Terminal entry
DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S @L login: #DT19200

# 9600 bps Dumb Terminal entry
DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S @L login: #DT9600
\end{verbatim}
\end{tscreen}


¦pªG§A­nªº¸Ü¡A§A¥i¥HÅý {\ttfamily getty} ¦bÃ±¤Jªº¼ÐÃD¤W¦L¥X¤@¨Ç¦³½ìªºªF¦è¡D
¦b§Úªº¨Ò¤l¸Ì¡A§Ú¦L¥X¨t²Î¦WºÙ¥H¤Î¦ê¦C½u¸ô¡D§A¥i¥H¥[¤J¨ä¥¦ªºªF¦è:
\begin{tscreen}
\begin{verbatim}
@B    ¥Ø«eªº¨C¬í¦ì¤¸¶Ç¿é²v(bps, ¦b¬Ý¨ì @B ®É¦ô­pªº)¡D
@D    ²{¦b¤é´Á, ®æ¦¡ MM/DD/YY¡D
@L    getty ©Ò³s±µªº¦ê¦C½u¸ô¡D
@S    ¨t²Î¦WºÙ¡D
@T    ²{¦b®É¶¡¡A®æ¦¡ HH:MM:SS (24 ¤p®É¨î)¡D
@U    ¥Ø«eÃ±¤Jªº¨Ï¥ÎªÌ¡D³o¬O¦b /etc/utmp ÀÉ¤¤«DªÅ ut_name Äæ¦ì¶µ¥Øªº­p¼Æ­È¡D
@V    ª©¥»­È¡A¦b¹w³]ÀÉ¤¤µ¹©wªº¡D
¦pªG­nÅã¥Ü '@' ²Å¸¹ªº¸Ü¡A¥Î '\@' ©Î '@@'¡D
\end{verbatim}
\end{tscreen}


·í§A¥¿¦b½s¿è {\ttfamily /etc/gettydefs} ®É¡A§A¥i¥H³o¼Ë¨ÓÀË¬d¥¦ªº»yªk¬O§_¥¿½T:   
\begin{tscreen}
\begin{verbatim}
linux# getty -c /etc/gettydefs
\end{verbatim}
\end{tscreen}




½T©w¨S¦³ {\ttfamily getty} ©Î {\ttfamily uugetty} ªº³]©wÀÉ({\ttfamily /etc/default/$\{$uu$\}$getty.ttyS}{\itshape N\/} ©Î {\ttfamily /etc/conf.$\{$uu$\}$getty.ttyS}{\itshape N\/})¦b§Aªº²×ºÝ¾÷³s±µªº¦ê¦C°ð¤W¡A
¦]¬°³o¤]³\·|¤zÂZ¨ì¦b²×ºÝ¾÷¤W°õ¦æªº {\ttfamily getty}¡D¦pªG¦³ªº¸Ü½Ð²¾°£¥¦¡D

½s¿è§Aªº {\ttfamily /etc/inittab} Åý {\ttfamily getty} ¦b§Aªº¦ê¦C°ð¤W°õ¦æ(¥Î§AÀô¹Òªº¥¿½T¸ê°T¨Ó¨ú¥N - °t¸mÀÉªº¦ì¸m¡A¦ê¦C°ð¦W¡A³t«×¡A¤Î¹w³]²×ºÝ¾÷§Î¦¡):
\begin{tscreen}
\begin{verbatim}
S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100
\end{verbatim}
\end{tscreen}

­«·s°_©l {\ttfamily init}:
\begin{tscreen}
\begin{verbatim}
linux# init q 
\end{verbatim}
\end{tscreen}


²{¦b§AÀ³¸Ó·|¦b§Aªº²×ºÝ¾÷¤W¬Ý¨ìÃ±¤J´£¥Ü¡D¤]³\§A±o«öªð¦^Áä(return)´X¦¸Åý²×ºÝ¾÷ª`·N¨ì¡D




\subsection{±N PC ³]©w¦¨²×ºÝ¾÷ªºª`·N¨Æ¶µ}

³\¦h¤H±N¨ä¥¦ PC ³]©w¦¨²×ºÝ¾÷³s±µ¨ì Linux ¾÷¾¹¤W¡D¨Ò¦p¡AÂÂªº 8088 ©Î¬O 286 PC «D±`¾A¦X³o­Ó¥Î³~¡D
§A»Ý­nªº¥u¬O¤@±i¥]§t¾A¦XÅý§Aªº²×ºÝ¾÷-­Ó¤H¹q¸£ (Terminal-PC) ¨Ï¥Îªº DOS ºÏ¤ù¡A¥H¤ÎÅý§Aªº²×ºÝ¾÷-­Ó¤H¹q¸£°õ¦æªº³q°Tµ{¦¡¡D
{\ttfamily kermit} ¦b³o­Ó¥Î³~¤Wªí²{±o«D±`¦n¡D
§A¥i¥H¦b³o¥x¾÷¾¹ {\ttfamily \onlynameurl{http://www.columbia.edu/kermit/}} ¤W§ä¨ì´X¥G¥i¥HÅý¥ô¦ó²{¦sªº§@·~¨t²Î¨Ï¥Îªº¤w½sÄ¶ªº {\ttfamily kermit} ª©¥»¡D
¨ä¥¦¬y¦æªº DOS ³q°Tµ{¦¡¹³¬O {\ttfamily telix} ¥H¤Î {\ttfamily procomm} ¤]±N·|¦³¤@¼Ë¦nªºªí²{¡D
­n½T©w¿é¤J¥¿½Tªº¦ê¦C°ð¸ê°T¨ì§A²×ºÝ¾÷-­Ó¤H¹q¸£ªº³q°T³]©w¸Ì¥h¡D




\section{§Ú¯à¨Ï¥Î¶W¹L¨â­Óªº¦ê¦C¸Ë¸m¶Ü?\label{irqaddr}}

§A¤£»Ý­n¾\Åª³o¤@¸`¡A°£«D§A·Q­n¨Ï¥Î¤T­Ó©Î§ó¦hªº¦ê¦C³]³Æ...(°²©w§A¨S¦³¦h°ð¥dªº¸Ü)¡D

°²¦p§A¦³¥t¤@­Ó¦h¾lªº¦ê¦C°ð¡A¬Oªº¡A§A¥i¥H¡D
§A¥i¥H¨Ï¥Îªº¦ê¦C°ð¼Æ¥Ø¨ü­­©ó§Ú­Ì¥²¶·¨Ï¥ÎªºµwÅé¤¤Â_­n¨D¥H¤Î°ð¿é¥X¤J¦ì§}ªº¼Æ¥Ø¡D
³o¨Ã¤£¬O Linux ªº­­¨î¡A¦Ó¬O PC ¶×¬y±Æªº­­¨î¡D¥²¶·«ü©w¤¤Â_¸ò¦ì§}µ¹¨C¤@­Ó¦ê¦C³]³Æ¡D
¦ê¦C³]³Æ¥i¥H¬O¦ê¦C°ð¡A¤º±µ¦¡¼Æ¾Ú¾÷©Î¬O¦h°ð¥d¡D

¦h°ð¥d¬O¬°¤F¾Ö¦³³\¦h­Ó¦ê¦C°ð¨Ó¤À¨É¥d¤W©Ò¦³¦ê¦C°ð©Ò¨Ï¥Îªº¬Û¦P IRQ ¦Ó¯S§O³]­pªº¡D
Linux ¹ï¥d¤Wªº¨C¤@­Ó°ð¨Ï¥Î¤£¦Pªº¿é¥X¤J¦ì§}¥H«K±q¥¦­ÌÀò¨ú¸ê®Æ¡D




\subsection{¿ï¾Ü¦ê¦C³]³Æªº¤¤Â_¦ì§}}

§Aªº PC ¤@¯ë·|±N {\ttfamily ttyS0} ¥H¤Î {\ttfamily ttyS2} ³]¦b IRQ 4 ¦Ó±N {\ttfamily ttyS1} ¥H¤Î {\ttfamily ttyS3} ³]¦b IRQ 3¡D
¸g¥ÑÀËµø {\ttfamily /proc/interrupts} §A¥i¥Hª¾¹D¨º¨Ç IRQs ¥¿³Q¨Ï¥Î¡D
­n¨Ï¥Î¨â­Ó¥H¤Wªº¦ê¦C³]³Æªº¸Ü¡A§A¥²¶·­«·s«ü©w¤@­Ó¤¤Â_¡D
¤@­Ó¦n¿ï¾Ü¬O±q§Aªº¨Ã¦C°ð¨ºÃä­«·s«ü©w¤@­Ó¤¤Â_¡D§Aªº PC ¤@¯ë·|³]©w IRQ5 ©Î¬O IRQ7 ·í§Aªº¨Ã¦C°ð¡A¦ý¬O«Ü¤Ö¤H·|¨Ï¥Î¨â­Ó¨Ã¦C°ð¡D
§A¥i¥H­«·s«ü©w¨ä¤¤¤@­Ó¤¤Â_µ¹¦ê¦C³]³Æ¡A¨Ã¦Ó¤´µM¯à¶¶§Q¦a¨Ï¥Î¤@­Ó¨Ã¦C°ð¡D
§A±N·|»Ý­n¥Î¨ì {\ttfamily setserial} µ{¦¡¨Ó°µ³o¥ó¨Æ¡D¦¹¥~¡A§A¥²¶·½Õ¾ã§AªO¤l¤Wªº¸õ±µ³]©w(Jumpers)¡A¬d¬Ý§A¥D¾÷ªOªº»¡©ú¤å¥ó¡D
¸õ±µ§A·Q­nµ¹¨C­Ó°ð¨Ï¥Îªº IRQ¡D

§A±N±o­n°µ¨Ç³]©wÅý¨C­Ó¦ê¦C³]³Æ³£¦³¤@­Ó¡A¨Ã¥B¬O°ß¤@ªº¤@­Ó¤¤Â_¡D
³o¸Ì¬O§Ú¦b {\ttfamily /etc/rc.d/rc.local} ¸Ì©Ò¥Îªº³]©w - §AÀ³¸Ó¦b±Ò°Ê¨t²Î®Éªº¬Y­Ó¦a¤è°µ³o¥ó¨Æ¡D
\begin{tscreen}
\begin{verbatim}
        /sbin/setserial /dev/ttyS0 irq 3        # my serial mouse
        /sbin/setserial /dev/ttyS1 irq 4        # my Wyse dumb terminal
        /sbin/setserial /dev/ttyS2 irq 5        # my Zoom modem 
        /sbin/setserial /dev/ttyS3 irq 9        # my USR modem
\end{verbatim}
\end{tscreen}


¼Ð·Çªº IRQ «ü©w:
\begin{verbatim}
              IRQ  0    Timer channel 0
              IRQ  1    Keyboard
              IRQ  2    Cascade for controller 2
              IRQ  3    Serial port 2
              IRQ  4    Serial port 1
              IRQ  5    Parallel port 2
              IRQ  6    Floppy diskette
              IRQ  7    Parallel port 1
              IRQ  8    Real-time clock
              IRQ  9    Redirected to IRQ2
              IRQ 10    not assigned 
              IRQ 11    not assigned
              IRQ 12    not assigned
              IRQ 13    Math coprocessor
              IRQ 14    Hard disk controller 1
              IRQ 15    Hard disk controller 2
\end{verbatim}


¦b¿ï¾Ü¤¤Â_®É¯uªº¨S¦³¤°»ò¥¿½Tªº¡D¥u­n½T©w¥¦¤£¬O¤w¸g³Q¥D¾÷ªO¡A©Î¬O¨ä¥¦¬É­±¥d©Ò¨Ï¥Î¡D
2, 3, 4, 5 ©Î¬O 7 ¬O¦n¿ï¾Ü¡D``not assigned''ªº·N«ä¬O¥Ø«e¨Ã¨S¦³¤°»òªF¦è¦b¼Ð·Ç±¡ªp¤U·|©T©w¨Ï¥Î³o¨ÇµwÅé¤¤Â_­n¨D¡D
¤]­nª`·N¨ì IRQ 2 ¸ò IRQ 9 ¬O¤@¼Ëªº¡D§A¥i¥HºÙ¥¦¬° 2 ©Î 9¡A¦ê¦CÅX°Êµ{¦¡«D±`¤F¸Ñ³o¤@ÂI¡D
¦pªG§A¦³¤@¶ô 16-bit ¶×¬y±Æ³s±µÀYªº¦ê¦C¥d¡A§A¤]¥i¥H¨Ï¥Î IRQ 10, 11, 12 ©Î 15¡D

¥u­n½T©w§A¨Ï¥Îªº¨Ã«D¬O IRQ 0, 1, 6, 8, 13 ©Î¬O 14! ¥¦­Ì¬O¥Ñ§Aªº¥D¾÷ªO©Ò¨Ï¥Îªº¡D
¦pªG§A®³¨«¦oªº IRQs ªº¸Ü¡A·|¨Ï±o¦o«Ü¤£°ª¿³¡D
§¹¦¨¤§«á¡A¦A¦¸ÀË¬d {\ttfamily /proc/interrupts} ¥H½T©w¨S¦³½Ä¬ðµo¥Í¡D




\subsection{³]©w¦ê¦C³]³Æªº¦ì§}}

±µ¤U¨Ó¡A§A¥²¶·³]°ð¦ì§}¡D¬d¬Ý§A¥D¾÷ªO¤â¥Uªº¸õ±µ³]©w¡D´N¹³¤¤Â_¡A¨C­Ó¦ì§}¥u¯à¦³¤@­Ó¦ê¦C³]³Æ¡D
§Aªº°ð³q±`·|°t¸m¦¨¹³¤U­±³o¼Ë¡G
\begin{tscreen}
\begin{verbatim}
        ttyS0 address 0x3f8
        ttyS1 address 0x2f8
        ttyS2 address 0x3e8
        ttyS3 address 0x2e8
\end{verbatim}
\end{tscreen}


¿ï¾Ü§A·Q­nµ¹¨C¤@­Ó¦ê¦C³]³Æ¨Ï¥Îªº¦ì§}¨Ã¥B¨Ì¦¹¨Ó³]©w¸õ±µ¡D
§Ú±N§Úªº¼Æ¾Ú¾÷³]¦b {\ttfamily ttyS3} ¡A§Úªº·Æ¹«¦b {\ttfamily ttyS0}¡A¦Ó§Úªº²×ºÝ¾÷¦b {\ttfamily ttyS2}¡D

·í§A­«·s±Ò°Ê®É¡A Linux À³¸Ó·|¦b§A©Ò³]©wªº¦ì§}¬Ý¨ì§Aªº¦ê¦C°ð¡D
Linux ©Ò¬Ý¨ìªº IRQ ¥i¯à¤£·|¸ò§A¸õ±µ³]©wªº¬Û²Å¡D
¤£¥²¾á¤ß³o¤@ÂI¡D Linux ¦b¥¦±Ò°Êªº®É­Ô¨Ã¨S¦³°µ¥ô¦óªº IRQ °»´ú¡A
¦]¬° IRQ °»´ú¬O¦MÀI¨Ã¥B¦³¥i¯à³Q´ÛÄFªº¡D¨Ï¥Î {\ttfamily setserial} ¨Ó§i¶D Linux ¨º­Ó°ð¨Ï¥Î¨º­Ó IRQ¡D
§A¤]¥i¥HÀË¬d {\ttfamily /proc/ioports} ¨Ó¬Ý¬Ý¦b Linux ±Ò°Ê«á¨º¨Ç¿é¥X¿é¤J°ð¦ì§}³Q¨Ï¥Î¡D




\section{§Ú«ç¼Ë±N§Úªº¦ê¦C°ð³]¨ì¸û°ªªº³t«×? §Úªº¼Æ¾Ú¾÷¤SÀ³¸Ó¨Ï¥Î¤°»ò¼Ëªº³t«×?\label{spdhi}}

³o¤@¸`À³¸Ó¥i¥HÀ°§A§ä¥X·í§A³z¹L³q°Tµ{¦¡¡A©Î¬O {\ttfamily getty} µ{¦¡¨Ï¥Î§Aªº¼Æ¾Ú¾÷®ÉÀ³¸Ó¨Ï¥Î¤°»ò³t«×¡D
\begin{itemize}
\item ¦pªG§A©Ò¦³ªº¬O¤ñ 9600 bps (V.32) ¼Æ¾Ú¾÷ÁÙ­nºCªºªF¦è¡A±N§Aªº³t«×³]¨ì§Aªº¼Æ¾Ú¾÷©Ò¯à¤ä´©ªº³Ì°ª³t«×¡D
¨Ò¦p 300 (V.21/Bell 103), 1200 (V.22/Bell 212A), ©Î 2400 bps (V.22bis)¡D
\item ¦pªG§A¦³ 9600 bps (V.32) ªº¼Æ¾Ú¾÷¡A¨Ã¥B¤ä´© V.42bis ¸ê®ÆÀ£ÁY¡A¨Ï¥Î 38400 ¨Ó·í§@§Aªº³t«×¡D
V.42bis À£ÁY¨ã¦³ 4:1 ªº{\itshape ²z½×­È\/}¡A¤]´N¬O``4 * 9600 = 38400''¡D
\item ¦pªG§A¦³ 14400 bps (V.32bis) ªº¼Æ¾Ú¾÷¡A¨Ã¥B¤ä´© V.42bis ¸ê®ÆÀ£ÁY¥\¯àªº¸Ü¡A¨Ï¥Î {\ttfamily setserial} µ{¦¡¡A¥[¤W {\ttfamily spd\_hi} ºX¼Ð±N§Aªº¦ê¦C°ð°t¸m¦¨¨Ï¥Î 57600 bps (4 * 14400 = 57600) ªº³t«×¡D
¦pªG§A¦³ 28800 ©Î 33600 bps (V.FC ©Î¬O V.34) ªº¼Æ¾Ú¾÷«h¨Ï¥Î {\ttfamily spd\_vhi} ºX¼Ð (4 * 28800 = 115200)¡D

µM«á¡A¦b§Aªº³q°Tµ{¦¡¡A©Î¬O {\ttfamily /etc/inittab} ¸Ì¨Ï¥Î 38400 ·í§@³t«×³]©w¡D
³o¬O²{¦b§A¯à³]ªº³Ì°ª³t«×¡D­n½T©w§A¦³ 16550A ³q¥Î«D¦P¨B±µ¦¬Âà´«¾¹(UART)¡D

¦pªG§Aªº libc ª©¥»¦Ü¤Ö¬O 5.x¡A¨º»ò·|¦³¥s°µ 57600 ¤Î 115200 ªº³t«×¡D
{\ttfamily libc} ©ñ¦b {\ttfamily /lib}¡A©Ò¥H¦b¨º¸Ì¬Ý¤@¤U§A¥Îªºª©¥»¬O¤°»ò¡D
¦pªG§AªºÀ³¥Îµ{¦¡¤w¸g½sÄ¶¥H¨ú¥Î¦¹ÀuÂI¡A§A¥i¥Hª½±µ¨Ï¥Î¥¦­Ì(¤£¥²¥Î {\ttfamily setserial})¡A
³\¦hªº®M¥ó³£¤w¸g¦³¤F¡A¦]¦¹¦pªG§A¦³³Ìªñª©¥»ªº Linux ®M¥ó¡A³Ì¦nªº¤èªk´N¬O¹Á¸Õ¨Ï¥Î³o¨Ç§ó°ªªº³t«×¡D

\end{itemize}


¥ý¦b©R¥O¦C¤U¥Î {\ttfamily setserial} «ü¥O´ú¸Õ¡AµM«á¦b§A½T©w¥¦­Ì¥i¥H¹B§@«á¡A±N§A©Ò§@ªº­×§ï©ñ¶i {\ttfamily /etc/rc.d/rc.serial} ©Î {\ttfamily /etc/rc.d/rc.local} ¥H«K¦b¨t²Î±Ò°Ê°õ¦æ¥¦­Ì¡D
¦b§Úªº {\ttfamily /etc/rc.d/rc.local} ¸Ì¡A§Ú¬O³o¼Ë³]©w§Úªº {\ttfamily ttyS3} ¨ì 115200 bps ªº:
\begin{tscreen}
\begin{verbatim}
/sbin/setserial /dev/ttyS3 spd_vhi
\end{verbatim}
\end{tscreen}


½T©w§A¥H¦Xªkªº¸ô®|¨Ï¥Î {\ttfamily setserial}¡A¥H¤Î¦Xªkªº¸Ë¸m¦WºÙ¡D
§A¥i¥H¤UªkÀË¬d¤@­Ó¦ê¦C°ðªº³]©w:
\begin{tscreen}
\begin{verbatim}
setserial -a /dev/ttyS3
\end{verbatim}
\end{tscreen}





\section{³q°Tµ{¦¡¤Î¤u¨ã\label{comms}}

³o¸Ì¦³¤@­Ó³q°Tµ{¦¡ªº¦Cªí¡A¦pªG§A©Ò¨Ï¥Îªºµo¦æ®M¥ó¸ÌÀY¨Ã¨S¦³ªº¸Ü¡A³o¨Ç³£¥i¥H¦b¤@¯ëªº FTP ¯¸§ä¨ì¡D

\begin{itemize}
\item {\ttfamily ecu} - ¤@®M³q°Tµ{¦¡
\item \nameurl{http://www.columbia.edu/kermit/}{C-Kermit} - 
¥iÄâªº¡A¥iµ{§Ç¤Æªº¦ê¦C¤Î TCP/IP ³q°Tµ{¦¡¡A¥]§t¶ÇÀÉ¤Î¦r§¹Âà´«¥\¯à
\item {\ttfamily minicom} - Ãþ¦ü {\ttfamily telix} ªº³q°Tµ{¦¡
\item {\ttfamily procomm} - ¥]§t zmodem¡AÃþ¦ü {\ttfamily procomm} ªº³q°Tµ{¦¡
\item {\ttfamily seyon} - ¥H X ¬°°òÂ¦Àô¹Òªº³q°Tµ{¦¡
\item {\ttfamily xc} - xcomm ³q°T®M¥ó
\item ¨ä¥¦¦³¥Îªºµ{¦¡¬O {\ttfamily term} ¤Î {\ttfamily SLiRP}¡D¥¦­Ì´£¨Ñ¨Ï¥Î shell ±b¸¹ªº TCP/IP ¥\¯à¡D
\item {\ttfamily screen} ¬O¥t¤@­Ó¦h°Ï¬q§@·~(multi-session)ªºµ{¦¡¡D³o­Óµ{¦¡´N¹³ªº°Ê§@´N¹³µêÀÀ±±¨î¥x¡D
\item {\ttfamily callback} ³o¤äµ{¦¡·|¨Ï§Aªº¼Æ¾Ú¾÷¦^¼·µ¹§A¡D
\item {\ttfamily mgetty+fax} ³B²z¶Ç¯u¨Æ°È¡A¨Ã¥B´£¨Ñ¤@­Ó¤£¦Pªº {\ttfamily getty}¡D
\item {\ttfamily ZyXEL} ¬O ZyXEL U-1496 ¼Æ¾Ú¾÷ªº±±¨îµ{¦¡¡D¥¦³B²z±µ¨ü¼·±µ¡A¼·¸¹¡A¦^¼·«O±K¡A¶Ç¯u¡A¥H¤Î»y­µ«H½c¥\¯à¡D
\item SLIP ¤Î PPP ªº³nÅé¥i¦b {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/system/network/serial}} §ä¨ì¡D
\item ¨ä¥¦ªF¦è¥i¥H¦b {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/system/serial}} ¥H¤Î {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/apps/serialcomm}} ©Î³\¦hªº¬M®g¸`ÂI¤§¤@§ä¨ì¡D³o¨Ç¬O«O¯d©Ò¦³¦ê¦Cµ{¦¡ªº¥Ø¿ý¡D
\end{itemize}





\section{¦ê¦C¨Ï¥Î¯µ³Z}

 
³o¸Ì¦³¤@¨Ç§A¥i¯àµo²{«Ü¦³¥Îªº¦ê¦C¯¦³Z...




\subsection{{\ttfamily kermit} ¥H¤Î zmodem}

­n¦b {\ttfamily kermit} ¤U¨Ï¥Î zmodem ªº¸Ü¡A±N¤U¦C¤º®e¥[¨ì§Aªº {\ttfamily .kermrc} ¸Ì¥h:
\begin{tscreen}
\begin{verbatim}
define rz !rz < /dev/ttyS3 > /dev/ttyS3
define sz !sz \%0 > /dev/ttyS3 < /dev/ttyS3
\end{verbatim}
\end{tscreen}

­n½T©w¥¿½T¦a©ñ¤J§A¼Æ¾Ú©Ò¦bªº¦ê¦C°ð¡DµM«á¡A­n¨Ï¥Îªº¸Ü¡A¥u­n¦b kermit ªº´£¥Ü²Å¸¹¤UÁä¤J {\ttfamily rz} ©Î {\ttfamily sz $<$ÀÉ¦W$>$} §Y¥i¡D




\subsection{¦Û°Ê³]©w²×ºÝ¾÷«¬¦¡}

­n¦b·í§AÃ±¤Jªº®É­Ô¦Û°Ê³]©w§Aªº²×ºÝ¾÷§Î¦¡ªº¸Ü¡A§â²×ºÝ¾÷ªº§Î¦¡¥[¨ì {\ttfamily /etc/inittab} ªº¶µ¥Ø¸Ì¥h¡D
¦pªG§Ú¦³¤@¥x vt100 ²×ºÝ¾÷¦b {\ttfamily ttyS1} ¤W ¡A§Ú­n¹ï {\ttfamily getty} «ü¥O¥[¤W ``vt100'':
\begin{tscreen}
\begin{verbatim}
S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100
\end{verbatim}
\end{tscreen}


§A¤]¥i¥H¨Ï¥Î {\ttfamily tset}¡A¥i¥H¦b§AÃ±¤Jªº®É­Ô«Ø¥ß²×ºÝ¾÷ªº¯S©Ê¡A¦Ó¥B¤£»Ý­n¨Ì¿à¥ô¦óªº¹w³]­È¡D




\subsection{¦b¦ê¦C³s½u¤Uªº±m¦â {\ttfamily ls}}

        
¦pªG {\ttfamily ls} ¦]¬°±m¦â¯S©Ê¦ÓÂZ¶Ã¤F§Aªº²×ºÝ¾÷¼ÒÀÀ¡A§â¥¦Ãö±¼¡D
{\ttfamily ls --color} ¥H¤Î {\ttfamily ls --colour} ³£¨Ï¥Î±m¦â¯S©Ê¡D¦³¨Ç¦w¸Ë¤è¦¡¨Ï±o {\ttfamily ls} ¹w³]¬°¨Ï¥Î±m¦â¡D
ÀË¬d {\ttfamily /etc/profile} ¥H¤Î {\ttfamily /etc/csh.cshrc} ¸Ìªº {\ttfamily ls} §O¦W¡D
¦pªG§A¤£·Q­×§ï¨t²Î¹w³]­Èªº¸Ü¡A§A¤]¥i¥H³]µ¹ {\ttfamily ls} §O¦W {\ttfamily ls --no-color}¡D




\subsection{±q²×ºÝ¾÷©Ò³s±µªº¦Lªí¾÷¶i¦æ¦C¦L}

        
¦³¤@­Ó¥s°µ {\ttfamily vtprint} ªºµ{¦¡¥i¥H°µ±o¨ì¡A¦b {\ttfamily \onlynameurl{ftp://ftp.sdsu.edu/pub/vtprint}} ¤Î
{\ttfamily \onlynameurl{http://www.sdsu.edu/\~{}garrett}} ¥i¨ú±o¡D

¥t¥~¤@¤ä¥s {\ttfamily xprt} ªºµ{¦¡¤]¯à°µ¨ì¡D¥¦¥i¦b {\ttfamily \onlynameurl{ftp://sunsite.unc.edu/pub/Linux/system/printing}} §ä¨ì¡D




\subsection{Linux ¯à¤£¯à°÷¦Û°Ê¦a°t¸m¦ê¦C³]³Æ?}

¥i¥H¡D­nÅý Linux ¦b±Ò°Êªº®É­Ô¦Û°Ê¦a°»´ú¨Ã¥B³]©w¦ê¦C³]³Æªº¸Ü¡A§â³o¤@¦æ:
\begin{tscreen}
\begin{verbatim}
/sbin/setserial /dev/ttyS3 auto_irq skip_test autoconfig
\end{verbatim}
\end{tscreen}

¥[¨ì§Aªº {\ttfamily /etc/rc.d/rc.local} ©Î¬O {\ttfamily /etc/rc.d/rc.serial} ÀÉ®×¸Ì­±¡D
¹ï¨C¤@­Ó§A§Æ±æ¦Û°Ê°t¸mªº¦ê¦C°ð³£­n°µ¡D­n½T©w©Òµ¹ªº¬O¤@­Ó¯u¥¿¦s¦b©ó§A¹q¸£¤Wªº³]³Æ¦WºÙ¡D




\subsubsection{¦h°ð¥dªºª`·N¨Æ¶µ}

¹ï©ó¥dªº¦ì§}¡A¥H¤Î IRQs ¬d¾\ {\ttfamily setserial} µ{¦¡ÀHªþªº {\ttfamily rc.serial}¡D
¥¦¦³«Ü¦hÃö©ó¦h°ð¥dªº²Ó¸`¡A¥]¬A¿é¥X¤J¦ì§}¥H¤Î³]³Æ¦WºÙ¡D




\subsection{¨Ï¥Î¦ê¦C±±¨î¥x}

¦b²Ä¤T¤Q¤»´Áªº {\itshape Linux Journal\/} ¦b {\ttfamily \onlynameurl{http://www.ssc.com/lj/issue36/index.html}} ¦³½g¤å³¹¸ÑÄÀ¦p¦ó¨Ï¥Î¦ê¦C±±¨î¥x(serial console)¡D
¤£©¯ªº¬O¡A±H¹q¤l¶l¥óµ¹§@ªÌ³£³Q°h¦^¡D§Ú§Æ±æ³o½g¤å³¹·|«Ü§Ö¦a¤W­z URL ªº {\itshape Linux Journal\/} ºô¯¸¤¤¡D




\subsection{§ó°ªªº¦ê¦C¬y¶q}

¦pªG¦b¤@³¡¨Ï¥Î (E)IDE ºÏºÐ¾÷ªº¨t²Î¤W§Aµo²{¬y¶q«ÜºC¦Ó¥B¦ê¦C°ð±`·¸º¡¡A§A¥i¥H¨ú±o {\ttfamily hdparm}¡D
³o¬O¤@­Ó¥i¥H­×§ï (E)IDE °Ñ¼Æ¡A¥]§tÅý¤@ºÏºÐ IRQ °Ê§@´Á¶¡¨ä¥¦ IRQs ¤´¥i¤u§@¡D
³o·|§ïµ½¤ÏÀ³³t«×¨ÃÀ°§U®ø°£·¸º¡¡D½T©w¤p¤ß¦aÅª¹L¤F½u¤W¤â¥U¡A¦]¬°¬Y¨ÇºÏºÐ/±±¨î¥d²Õ¦X¤£³ßÅw¥¦¨Ã¥B¥i¯à·l·´ÀÉ®×¨t²Î¡D

¤]¥i¥H¬Ý¤@¤U¤@­Ó¥s {\ttfamily irqtune} ªº¤u¨ã¡A¥i¥H§ïÅÜ¤@­Ó¸Ë¸m IRQ ªºÀu¥ý¶¶§Ç¡A¨Ò¦p§A¼Æ¾Ú¾÷©Ò¦bªº¦ê¦C°ð¡D³o¤]¥i¯à§ïµ½§A¨t²Îªº¦ê¦C¬y¶q¡D
{\ttfamily irqtune} ªº±`¨£°ÝÃD¸Ñµª(FAQ)¥i¦b {\ttfamily \onlynameurl{http://www.best.com/\~{}cae/irqtune}} §ä¨ì¡D




\section{§ó¶i¤@¨B...}

³o¤@¸`¨Ã¤£»Ý­n¾\Åª¡A¦ý¬O¥i¯à±aµ¹§A¤@¨Ç¹ï©ó Unix ¥H¤Î¹q¤l³q°T¥@¬É§ó¶i¤@¨Bªº¤F¸Ñ¡D




\subsection{¤°»ò¬OÂê©wÀÉ®×(lock files)?}

Lock files ¥u¬O³æ¯Âªº¤@­ÓÀÉ®×¥Î¨Óªí¥Ü¬Y­Ó¯S©wªº³]³Æ¥¿¦b¨Ï¥Î¤¤¡D
¥¦­Ì«O¦s¦b {\ttfamily /usr/spool/uucp} ©Î¬O {\ttfamily /var/lock} ¸Ì­±¡D
Linux ªº lock files ¦W¦r³£¬O {\ttfamily LCK..}{\itshape name\/}¡A¨ä¤¤ªº {\itshape name\/} ¤£¬O³]³Æ¦WºÙ´N¬O¤@­Ó UUCP ¸`ÂI¦WºÙ¡D
¦³¨Çµ{§Ç«Ø¥ß³o¨Ç locks ¥H«KÅý¥¦­Ì¦Û¤v¥i¥H¿W¦û¸Ó³]³Æªº¦s¨úÅv¡D
¨Ò¦p¦pªG§A±q§Aªº¼Æ¾Ú¾÷¼·¸¹¥X¥h¡A±N·|¥X²{¤@­Ó lock §i¶D¨ä¥¦µ{§Ç²{¦b¤w¸g¦³¤H¥¿¦b¨Ï¥Î¼Æ¾Ú¾÷¡D
Lock files ¸Ì­±¥D­n¬O¥]§tÂê¦í¸Ó³]³Æªºµ{§Çªº¦æµ{¸¹½X(PID)¡D
¤j³¡¥÷ªºµ{¦¡·|¬d¾\ lock¡AµM«áÀË¬d¦æµ{ªí(process table)¤¤Âê©w¸Ó³]³Æªº¦æµ{¨Ó¸ÕµÛ¨M©w³o­Ó lock ¬O§_¤´µM¦³®Ä¡D
¦pªGµo²{³o­Ó lock ¬O¦³®Äªº¸Ü¡A³o­Óµ{¦¡(À³¸Ó)­nµ²§ô¡D
¦pªG¤£¬O¡A¬Y¨Çµ{¦¡·|§R°£¹L®Éªº lock¡AµM«á¨Ï¥Î¸Ó³]³Æ¡A¨Ã¦b¦æµ{°õ¦æ®É«Ø¥ß¥L­Ì¦Û¤vªº lock¡D
¨ä¥¦ªºµ{¦¡´N¥u¦nµ²§ô¨Ã§i¶D§A¸Ó³]³Æ¥¿¦b¨Ï¥Î¤¤¡D




\subsection{``baud'' ¹ï ``bps''}

``baud'' ¸ò ``bps'' ¥i¯à¬O¹q¸£/¹q¤l³q°T³o­Ó»â°ì¸Ì³Ì±`³Q¿ù¥Îªº³N»y¤§¤@¡D
·í¥¦­Ì¨Æ¹ê¤W¨Ã¤£¬Û¦Pªº®É­Ô¡A«Ü¦h¤H¤´¥æ´À¨Ï¥Î³o¨Ç³N»y¡D
\begin{description}
\item[Àj²v(baud)] \mbox{}

Àj²v¬O¨C¬íÄÁ¼Æ¾Ú¾÷(½ÕÅÜ¸Ñ½Õ¾¹¡A{\bfseries mo}dulator-{\bfseries dem}odulator)°e¥X¦h¤Ö¦¸°T¸¹§ïÅÜªº«×¶q¡D
¨Ò¦p¡AÀj²v¬° 1200 ªº§t·N¬O«H¸¹¨C¹j 833 ·L¬í(microsecond)§Y§ïÅÜ¤@¦¸¡D
´¶¹MªºÀj²v¦³ 50, 75, 110, 300, 600, 1200 ¥H¤Î 2400¡D¤j³¡¥÷ªº°ª³t¼Æ¾Ú¾÷©Ò¨Ï¥ÎªºÀj²v¬° 2400¡D
¦]¬°»y­µ¯Å(voice-grade)¹q¸Ü½u¸ôªºÀW¼e­­¨î¡A¶W¹L 2400 ªºÀj²v«ÜÃø¹Fªº¨ì¡A¦Ó¥u¯à¦b«D±`¯Â²bªº¹q¸Ü½u«~½è¤U¤~¯à¹B§@¡D
``baud''¤@µü¦b Emile Baudot ¤§«á¤~¦³¡A¥L¬O«D¦P¨B¹q³ø¦Lªí¾÷(asynchronous telegraph printer)ªºµo©úªÌ¡D



\item[¨C¬í¶Ç¿é¦ì¤¸(bps)] \mbox{}

¨C¬í¦ì¤¸¶Ç¿é²v¬O¨C¬íÄÁ¶Ç¿é¦h¤Ö¦ì¤¸ªº«×¶q¡D´¶¹M¨C¬í¦ì¤¸¶Ç¿é²v¦³ 50, 75, 110, 300, 1200, 2400, 4800, 9600, ... 115200¡D
¦b¨Ï¥Î V.42bis  À£ÁY(À£ÁY³Ì¤j²v 4:1)ªº¼Æ¾Ú¾÷¤U¡A{\itshape ²z½×¤W\/}¨C¬í¦ì¤¸¶Ç¿é²v¥i¥H°ª¹F 115200¡D
³o¬O³\¦h¤H¦b¿ù¥Î ``baud'' ³o­Ó¦r®É©Ò«üªº·N«ä¡D        

\end{description}
        

©Ò¥H¡A¦pªG°ª³t¼Æ¾Ú¾÷¥H 2400 baud ¹B§@¡A¥¦­Ì¦p¦ó¯à°÷¶Ç°e 14400 bps?
¼Æ¾Ú¾÷¹ï¨C­Ó baud ½s½X¨Óªí¥Ü¬Y¤@¼Æ¶qªº¦ì¤¸¦Ó¨Ï±o bps ¯à¤j©ó baud¡D
³o¼Ë¤@¨Ó¡A·í¤G­Ó©Î§ó¦h¦ì¤¸½s½X¦¨¤@­Ó baud ªº®É­Ô¡Abps ´N·|¶W¶V baud¡D
¦pªG§Aªº¼Æ¾Ú¾÷¬O¥H 14400 bps ³s½uªº¸Ü¡A¥¦±N·|¥H 2400 baud ªº³t«×¨C­Ó baud ¶Ç°e¤»­Ó¦ì¤¸¡D

        
³o­Ó²V²c¬O«ç»ò¼Ë¶}©lªº? ¶â¡A¦^¨ì¤µ¤Ñªº§C³t¼Æ¾Ú¾÷ÁÙ¬O¬Q¤Ñªº°ª³t¼Æ¾Ú¾÷¨º­Ó®É¥N¡A¨C¬í¦ì¤¸¶Ç¿é²v¸ò«H¸¹§ïÅÜ²v¹ê»Ú¤W¬O§¹¥þ¬Ûµ¥ªº¡D
¨C­Ó bit ½s½X¦¨¤@­Ó baud¡D¤H­Ì¥æ´À¨Ï¥Î bps ¥H¤Î baud ¬O¦]¬°¥¦­Ìªº¼Æ¦r¬Û¦P¡D
¨Ò¦p¤@¥x 300 bps ªº¼Æ¾Ú¾÷¨ä«H¸¹§ïÅÜ²v¤]¬O 300¡D
·í°ª³t¼Æ¾Ú¾÷´¶¤Î«á¤@¤Á³£§ïÅÜ¤F¡A¦Ó¥B¨C¬í¦ì¤¸¶Ç¿é²v¶W¹L¤F«H¸¹§ïÅÜ²v¡D




\subsection{¤°»ò¬O UARTs? ¥¦­Ì¦p¦ó¼vÅT®Ä¯à?\label{uart}}

UARTs (³q¥Î«D¦P¨B±µ¦¬Âà´«¾¹¡A{\bfseries U}niversal {\bfseries A}syncronous {\bfseries R}eceiver {\bfseries T}ransmitter)¬O§A PC ¦ê¦C¥d¤Wªº´¹¤ù¡D
¥¦­Ìªº¥\¥Î¬O§â¸ê®ÆÂà¦¨¦ì¤¸¡A±N³o¨Ç¦ì¤¸°e¤W¦ê¦C½u¸ô¡AµM«á¦b¥t¤@ºÝ­«·s«Ø¥ß¸ê®Æ¡D
UARTs ¬O¥H¦ì¤¸²Õ¬°³æ¦ì³B²z¸ê®Æ¡A«Ü¤è«K¦a¤]¬O¬ü°ê¼Ð·Ç¥æ´«½X(ASCII)ªº¦r¤¸¤j¤p¡D

°²©w¬O§A¦³¤@¥x³s±µ¨ì§A PC ªº²×ºÝ¾÷¡D·í§AÁä¤J¤@­Ó¦r¤¸®É¡A²×ºÝ¾÷§â¥¦¥æµ¹¥¦ªºÂà´«¾¹(¤]¬O UART ªº¤@ºØ)¡D
¸ÓÂà´«¾¹¥H«ü©wªº³t²v§â³o­Ó¦ì¤¸²Õ°e¨ì¦ê¦C½u¸ô¤W¡A¨C¦¸¤@­Ó¦ì¤¸¡D
¦b PC ³o¤@ºÝ¡A±µ¦¬¦ì¤¸ªº UART ®³¨«©Ò¦³ªº¦ì¤¸¡AµM«á­«·s²Õ¦¨¦ì¤¸²Õ¨Ã¥B©ñ¨ì½w½Ä°Ï¸Ì¥h¡D

¦³¨âºØ¤£¦Pªº UARTs Ãþ«¬¡D§A¥i¯à¦³Å¥¹L·MÄøªº(dumb)UARTs - 8250 ÁÙ¦³ 16450¡A¥H¤Î¥ý¶i¥ý¥X¦¡ UARTs - 16550A¡D
­n¤F¸Ñ¥¦­Ìªº¤£¦P¡A­º¥ýÅý§Ú­Ì¨ÓÀËÅç·í UART °e¥X©Î±µ¦¬¤@­Ó¦ì¤¸²Õ®É©Òµo¥Íªº¨Æ¡D

³o UART ¥»¨­¨Ã¤£¯à¹ï¸ê®Æ°µ¤°»ò³B²z¡A¥¦¥u¬O°e¥X¥H¤Î±µ¦¬¥¦¡D
¨C¦¸°e¥X©Î±µ¦¬¤@­Ó¦ì¤¸²Õ®É¡ACPU ³£·|±q¦ê¦C³]³Æ±µ¨ì¤@­Ó¤¤Â_¡D
µM«á CPU ´N§â±µ¦¬¨ìªº¦ì¤¸²Õ±q UARTs ªº½w½Ä°Ï·h¨ì°O¾ÐÅéªº¬Y³B¡A©Î¬O´£¨Ñ¥t¤@­Ó¦ì¤¸²Õµ¹ UART ¶Ç°e¡D
8250 ¥H¤Î 16450 UARTs ¥u¦³¤@­Ó¦ì¤¸²Õªº½w½Ä°Ï¡D³o­Ó·N«ä¬O¡A¨C°e¥X©Î±µ¦¬¤@­Ó¦ì¤¸²Õ´N·|¤¤Â_ CPU ¤@¦¸¡D
¦b§C³tªº±¡ªp¤U³o¼Ë¨S¦³°ÝÃD¡D¦ý¬O¦b°ª³tªº¶Ç¿é²v¤U¡ACPU ·|¦£©ó³B²z UART ¦Ó¨S¦³®É¶¡·Ó®Æ¨ä¥¦¤u§@¡D
¦b¬Y¨Ç±¡ªp¤U¡ACPU ¨S¦³¨¬°÷ªº¾l¸Î¤Î®É³B²z¤¤Â_ªA°È¡A¸Ó¦ì¤¸²Õ±N¦]¸ê®Æ¦p¦¹§Ö³t¦a¶Ç¤J¦Ó³QÂÐ¼g¡D

³o´N¬O 16550A UARTs ¦³¥Îªº¦a¤è¡D³o¨Ç´¹¤ù¨ã¦³ 16 ­Ó¦ì¤¸²Õªº¥ý¶i¥ý¥X¦î¦C¡D
³o­Ó·N«ä¬O¥¦¦b¥²¶·¤¤Â_ CPU ¤§«e¥i¥H±µ¦¬©ÎÂà´«¹F 16 ­Ó¦ì¤¸²Õ¡D
¥¦¤£¶È¬O¯àµ¥¡A¦Ó¥B CPU ²{¦b¤]¥i¥H¦P®É¶Ç°e¥þ³¡ 16 ­Ó¦ì¤¸²Õªº¸ê®Æ¡D
ÁöµM¤¤Â_¬É­­(threshold)«Ü¤Ö¦³³]¨ì 16 ªº¡A³o¹ï©ó¨ä¥¦¥u¦³¤@­Ó¦ì¤¸²Õ½w½Ä°Ïªº UARTs ¦Ó¨¥¤´µM¬O¤@­Ó­«­nªºÀuÂI¡D
CPU ¦¬¨ì¸û¤Öªº¤¤Â_¡A¦]¦¹¥i¥H¦Û¥Ñ¦a°µ¨ä¥¦¨Æ±¡¡D¸ê®Æ¤£·|º|¥¢¡A¨C­Ó¤H³£«Ü°ª¿³¡D
(¤]¦³ 16550 ³o­Ó UART¡A¦ý¬O¥¦¸ò 16450 ¤@¼Ë¦]¬°¥¦¦³°ÝÃD¡D)

¤@¯ë¨Ó»¡¡A 8250 ¥H¤Î 16450 UARTs À³¸Ó¯à°÷³Ó¥ô°ª¹F 38400 bps ªº¤u§@³t²v¡D
¦b°ª©ó 38400 bps  ªº³t²v¤U¡A§A¥i¯à¶}©l¨£¨ì¸ê®Æº|¥¢¡D
¨ä¥¦ªº PC §@·~¨t²Î(³o¸Ìªº©w¸q«Ü¼eÃP)¡A¹³ DOS ¨Ã«D¬O¦h¤uªº¡A©Ò¥H¥¦­Ì¦³¥i¯à¥i¥H¥Î 8250 ©Î 16450s «oÀ³¥Iªº§ó¦n¡D
³o´N¬O¬°¤°»ò¦³¨Ç¤H¨Ã¨S¦³¬Ý¨ì¸ê®Æº|¥¢¡Aª½¨ì¥L­Ì§ï¥Î Linux  ¤~µo¥Í¡D

µL-UART(Non-UART)¥H¤Î´¼¼z«¬¦h°ð¥d¨Ï¥Î¼Æ¦ì³B²z¾÷(DSP)´¹¤ù¨Ó³B²zÃB¥~ªº½w½Ä¥H¤Î±±¨î¡A¦p¦¹§ó¯à´î»´ CPU ªº­t¾á¡D
¨Ò¦p¡ACyclades Cyclom ¤Î Stallion EasyIO ³o¨Ç¥d¨Ï¥Î Cirrus Logic CD-1400 RISC ´¹¤ù¡AÁÙ¦³³\¦h¥d¨Ï¥Î 80186 CPU ©Î§ó¯S§Oªº RISC CPU ¨Ó³B²z¦ê¦C¿é¥X¤J¡D

¤ß¸Ì­n°O±o¡A³o¨Ç·MÄø«¬ªº UART ¨Ã«D¬OÃaªº¡A¥u¬O¥¦­Ì¤£¾A¦X°µ°ª³t¶Ç¿é¡D
·í§A±N²×ºÝ¾÷©Î·Æ¹«³s±µ¨ì³o¨Ç UARTs ®ÉÀ³¸Ó¤£·|¾D¹J§xÃø¡D
¦ý¬O¹ï°ª³t¼Æ¾Ú¾÷¦Ó¨¥¡A16550A ¥i¥H»¡¬O¥²¶·ªº¡D

§A¥i¥Hªá¦h¤@ÂIÂIªº¿úÁÊ¶R¦³ 16550A UARTs ªº¦ê¦C¥d¡A¥u­n¸ß°Ý¹q¸£°Ó¸Ó¥d©Ò¨Ï¥Îªº¬O¤°»ò«¬¸¹ªº UARTs §Y¥i¡D
©ÎªÌ§A·Q¤É¯Å§A²{¦bªº¥d¡A§A¥i¥H¥u­nÂ²³æ¦aÁÊ¶R 16550A ´¹¤ù¨Ã¥B¸m´«§A²{¦bªº 16450 UARTs ´¹¤ù¡D
¥¦­Ìªº¸}¦ì¬Û®e(pin-to-pin compatible)¡D¦³¨Ç¥d¦³ UARTs ´¡¼Ñ¨Ó§@³o­Ó¥Î³~¨Ï¥Î¡D
¦pªG¤£¬Oªº¸Ü§A¥i¥H²k±µ¡Dª`·N¡A¦pªG§A¦³¿ú¡A¶R¤@±i·s¥d±N¥i¯à·|¬Ù±¼§A³\¦h³Â·Ð¡A¥¦­Ì¦b \$50 ¤¸¬üª÷¥H¤U¡D




\section{¬G»Ù±Æ°£}


\subsection{§Ú¤£Â_¦a¦¬¨ì ``line {\itshape NNN\/} of inittab invalid''}

­n½T©w§A¹ï§Aªº {\ttfamily init} ª©¥»¨Ï¥Î¥¿½Tªº¤åªk¡D³o¸Ì©Ò¨S¦³ªº¤@¨Ç {\ttfamily init} ·|¦b {\ttfamily /etc/inittab} ÀÉ®×¸Ì¨Ï¥Î¤£¦Pªº¤åªk¡D
­n½T©w§A¹ï§Aªº {\ttfamily getty} ª©¥»¨Ï¥Î¥¿½Tªº¤åªk¡D




\subsection{·í§Ú¸ÕµÛ¼·¸¹®É¡A¥¦»¡ ``/dev/cua{\itshape N\/}: Device or resource busy''}

³o­Ó°ÝÃD¥i¯àµo¥Í¦b DCD ©Î DTR ¨S¦³³]©w¥¿½Tªº®É­Ô¡D
DCD À³¸Ó¥u¦b¯uªº¦³³s½u®É(¹³¬O¦³¤H¼·±µ¶i¨Ó)¤~³Q³]©w¡A¦Ó¤£¬O¦b {\ttfamily getty} «ùÄòºÊ¬Ý¸Ó°ðªº®É­Ô¡D
ÀË¬d¨Ã½T©w§Aªº¼Æ¾Ú¾÷¥¿½T¦a°t¸m¦¨¥u¦b¯u¥¿³s½u®É¤~³]©w DCD¡D
DTR À³¸Ó¦b¥ô¦óªF¦è¨Ï¥Î©ÎºÊ¬Ý½u¸ô®É³]©w¡A¹³¬O {\ttfamily getty}, {\ttfamily kermit}, ©Î¨ä¥¦³q°Tµ{¦¡¡D

¥t¤@­Ó¤Þ°_ ``device busy''  ¿ù»~ªº´¶¹M­ì¦]¬O§A³]©w§Aªº¦ê¦C°ð¨Ï¥Î¤@­Ó¤w¸g³Q¬YºØ¨ä¥¦ªF¦è¨Ï¥Îªº¤¤Â_¡D
¦b¨C¤@­Ó³]³Æªì©l¤Æªº®É«á¡A¥¦·|­n¨D Linux ¤¹³\¥¦¨Ï¥Î¥¦ªºµwÅé¤¤Â_¡D
Linux «ùÄò°lÂÜ¨º­Ó¤¤Â_³Q«ü©wµ¹½Ö¡A¦Ó¦pªG§Aªº¤¤Â_¤w¸g³Q¦û¥Î¡A§Aªº³]³Æ±N¤£¯à¾A·í¦aªì©l¤Æ¡D
¸Ó³]³Æ¯uªº¨Ã¨S¦³¤°»ò¿ìªk§i¶D§Aµo¥Íªº³o¥ó¨Æ¡A°£¤F·í§A¹Á¸Õ¥h¨Ï¥Î¥¦ªº®É­Ô¡A¥¦·|¦^À³ ``device-busy'' ¿ù»~°T®§¡D
ÀË¬d§A©Ò¦³ªº¥d(¦ê¦C¡A¤A¤Óºô¸ô¡ASCSI ¬É­±µ¥µ¥)¡D§ä´MµwÅé¤¤Â_½Ä¬ðªº¦a¤è¡D




\subsection{§Ú«ùÄò±µ¨ì ``Id S{\itshape N\/} respawning too fast: disabled for 5 minutes''}

½T©w§Aªº¼Æ¾Ú¾÷¦³¥¿½Tªº°t¸m¡D¬d¬Ý¼È¦s¾¹ {\ttfamily E} ©M {\ttfamily Q}¡D
³o¥i¯àµo¥Í¦b§Aªº¼Æ¾Ú¾÷¸ò {\ttfamily getty} ·¾³qªº®É­Ô¡D

½T©w§A¥¿½T¦a±q {\ttfamily /etc/inittab} ©I¥s {\ttfamily getty}¡D
¨Ï¥Î¿ù»~ªº¤åªk©Î³]³Æ¦WºÙ±N·|¤Þ°_ÄY­«ªº°ÝÃD¡D

¥H¤UªkÀË¬d§Aªº {\ttfamily /etc/gettydefs} ¤åªk¬O§_¥¿½T:
\begin{tscreen}
\begin{verbatim}
linux# getty -c /etc/gettydefs
\end{verbatim}
\end{tscreen}




³o¤]¥i¯àµo¥Í¦b {\ttfamily uugetty} ªì¨Ï¤Æ¥¢±Ñ®É¡D°Ñ¾\ \ref{nowork} {(getty ©Î uugetty ¤´µMµLªk¹B§@)} ¤@¸`¡D




\subsection{¦ê¦C³]³Æ«ÜºC©Î¬O¦ê¦C³]³Æ¥u¯à³æ¦V¶Ç°e}

        
§AªºµwÅé¤¤Â_¥i¯à¦³½Ä¬ð¡D½T©w¨S¦³µwÅé¤¤Â_¬O³Q¤À¨Éªº¡D
ÀË¬d§A©Ò¦³ªº¥d(¦ê¦C¥d, ¤A¤Óºô¸ô¥d, SCSI µ¥µ¥)½T©w§A¦ê¦C³]³Æ°tªº¸õ±µ³]©w¥H¤Î {\ttfamily setserial} °Ñ¼Æ¬O¥¿½Tªº¡D
¦P®ÉÀË¬d {\ttfamily /proc/ioports} ¤Î {\ttfamily /proc/interrups} ¥H½T©w¬O§_¦³½Ä¬ðµo¥Í¡D




\subsection{§Úªº¼Æ¾Ú¾÷¦b¬Y¤HÂ_½u«áÅõºÈ©Î¬O {\ttfamily uugetty} ¨Ã¨S¦³­«·s°õ¦æ}

        
³o¦b DTR °T¸¹±¼¤U¦Ó§Aªº¼Æ¾Ú¾÷¨S¦³­«¸m®É·|µo¥Í¡D
³o­Ó°ÝÃD¦b§Ú¨­¤Wµo¥Íªº®É­Ô§Ú¬Ý¨ì§Úªº RD ¸ò SD LEDs ºÆ¨g¦a°{Ã{¡D§A»Ý­nÅý§Aªº¼Æ¾Ú¾÷­«¸m¡D
¤j³¡¥÷ªº Hayes ¬Û®e¼Æ¾Ú¾÷¨Ï¥Î {\ttfamily \&D3} ¨Ó°µ³o¥ó¨Æ¡A¦ý¬O¦b§Úªº USR Courier ¤W¡A§Ú±o­n³] {\ttfamily \&D2} ¥H¤Î {\ttfamily S13=1}¡D¬d¾\§Aªº¼Æ¾Ú¾÷¤â¥U¡D




\subsection{§Ú±N§Úªº²×ºÝ¾÷³s¨ì§Úªº PC  ¤W¡A¦ý¬O¦b§Ú¿é¤JÃ±¤J¦WºÙ¤§«á¡A¥¦´NÂê¦í¤£°Ê}

\begin{itemize}
\item ¦pªG§A¨Ï¥Î {\ttfamily getty}:
¦b§Aªº {\ttfamily /etc/gettydefs} ¶µ¥Ø¸Ì¥i¯à¨S¦³³] {\ttfamily CLOCAL} µ¹²×ºÝ¾÷¡A¦Ó¥B¥i¯à§A¥Îªº¨Ã¤£¬O§¹¾ãªº null modem ³s±µ½u¡D
§A»Ý­n {\ttfamily CLOCAL} ¨Ó§i¶D Linux ©¿²¤¼Æ¾Ú¾÷±±¨î«H¸¹¡D¥¦¬Ý°_¨Ó¹³³o¸Ì³o¼Ë:
\begin{tscreen}
\begin{verbatim}
# 38400 bps Dumb Terminal entry
DT38400# B38400 CS8 CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S @L login: #DT38400

# 19200 bps Dumb Terminal entry
DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S @L login: #DT19200

# 9600 bps Dumb Terminal entry
DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S @L login: #DT9600
\end{verbatim}
\end{tscreen}

±µ¤U¨Ó¡A¥Î {\ttfamily kill} ¬å±¼¸Ó {\ttfamily getty} ¦æµ{³o¼Ë·s¦æµ{·|¥H·sªº¶µ¥Ø²£¥Í¡D
\item ¦pªG§A¨Ï¥Î {\ttfamily agetty}:
¥[¤W {\ttfamily -L} ºX¼Ð¨ì§Aªº {\ttfamily /etc/initab} ¤¤ªº {\ttfamily agetty} ¨º¦æ¡D
³o·|¨Ï±o¥¦©¿²¤¼Æ¾Ú¾÷±±¨î«H¸¹¡DµM«áÁä¤J {\ttfamily init q} ¥H­«·s°õ¦æ {\ttfamily init}¡D
³o­Ó¶µ¥Ø¬Ý°_¨Ó¹³³o¼Ë:
\begin{tscreen}
\begin{verbatim}
s1:345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
\end{verbatim}
\end{tscreen}
\end{itemize}





\subsection{¦b°ª³t¤U¡A§Úªº¼Æ¾Ú¾÷º|¥¢¸ê®Æ}

¦pªG§A¹Á¸Õ¦b¤j©ó 38400 bps ªº³t²v¤U¨Ï¥Î§Aªº¼Æ¾Ú¾÷¡A¦Ó§A¨Ã¨S¦³ 16550A UARTs ªº¸Ü¡A§AÀ³¸Ó­n±N¥¦­Ì¤É¯Å¡D
¦³Ãö UARTs ªº»¡©ú°Ñ¾\ \ref{uart} {(¤°»ò¬O UARTs?)} ¤@¸`¡D




\subsection{¦b¨t²Î±Ò°Ê®É¡ALinux ¨S¦³¨Ì·Ó§Úªº°t¸m¦^³ø¦ê¦C³]³Æ¡D}

³o¬O¨Æ¹ê¡DLinux ¦b¨t²Î±Ò°Ê®É¨Ã¨S¦³°µ¥ô¦óªº IRQ °»´ú¡A¥¦¥u°µ¦ê¦C³]³Æ°»´ú¡D
©Ò¥H¡A¤£­n²z·|¥¦©ÒÅã¥Ü¦³ÃöµwÅé¤¤Â_ªº³¡¥÷¡A¦]¬°¥¦¥u¬O°²©w¨Ï¥Î¼Ð·ÇªºµwÅé¤¤Â_¡D
³o¬O¦]¬°µwÅé¤¤Â_°»´ú¤£¥i¾a¡A¦Ó¥B¥i¯à³Q¿fÄF¦Ó³o¼Ë°µªº¡D

©Ò¥H§Y¨Ï§Úªº {\ttfamily ttyS2} ³]¦b IRQ5¡A§Ú¤´µM¬Ý¨ì
\begin{tscreen}
\begin{verbatim}
Jan 23 22:25:28 misfits vmunix: tty02 at 0x03e8 (irq = 4) is a 16550A
\end{verbatim}
\end{tscreen}

¦b Linux ±Ò°Ê®É¡A§A¥²¶·¨Ï¥Î {\ttfamily setserial} ¨Ó§i¶D Linux §A©Ò¨Ï¥ÎªºµwÅé¤¤Â_¡D
Linux ±Ò°Ê«á¡A§A¥i¥H¬d¬Ý {\ttfamily /proc/interrupts} ÀÉ¥H¤F¸Ñ¯u¥¿³Q°t¸mªº IRQ ¬O¤°»ò¡D 




\subsection{·í§Ú¨Ï¥Î§Úªº¼Æ¾Ú¾÷¥s¥Î Linux ¾÷¾¹®É {\ttfamily rz} ¥H¤Î/©Î¬O {\ttfamily sz} ¤£°Ê}

¦pªG Linux ¦b§A¹Á¸Õ¶Ç°eÀÉ®×®É·|´M§ä {\ttfamily /dev/modem} ªº¸Ü¡A¬d¬Ý {\ttfamily /etc/profile} ¥H¤Î {\ttfamily /etc/csh.cshrc}¡D
¬Y¨Çµo¦æ®M¥ó·|¦b³o¨Ç¦a¤è©w¸q¤@¨Ç§O¦W¡A³ÌµÛ¦Wªº¬O Slackware¡D
³o¨Ç§O¦WÂZ¶Ã¤F zmodem µ{¦¡¡D§â¥¦­Ì®³±¼©Î¬O§ó¥¿¥¦­Ì¡D




\subsection{§Úªº¿Ã¹õ¦L¥X¬Ý°_¨Ó«Ü¦nª±ªº¦r¤¸}

³o¦b·í§A§â¤G¶i¦ì¸ê®Æ°e©¹¿Ã¹õªº®É­Ô·|µo¥Í¦bµêÀÀ±±¨î¥x¤W¡A©ÎªÌ¦³®É­Ô·|µo¥Í¦b¦ê¦C³s½u¤W¡D
­×´_³o­Ó°ÝÃDªº¤èªk¬O¿é¤J {\ttfamily echo \^{}v\^{}[c}¡D¦]¬°±±¨î¦r¤¸¤§¬G¡A¥¦¬O:
\begin{tscreen}
\begin{verbatim}
linux% echo <ctrl>v<esc>c
\end{verbatim}
\end{tscreen}





\subsection{{\ttfamily getty} ©Î {\ttfamily uugetty} ¤´µMµLªk¹B§@\label{nowork}}

{\ttfamily getty\_ps} ¤W¦³­Ó {\ttfamily DEBUG} ¿ï¶µ¡D½s¿è§Aªº {\ttfamily /etc/conf.$\{$uu$\}$getty.ttyS}{\itshape N\/} °t¸mÀÉ¨Ã¥[¤W {\ttfamily DEBUG=}{\itshape NNN\/}¡D
¨ä¤¤ {\itshape NNN\/} ¬O¤U¦Cªº¼Æ¦r²Õ¦X¤§¤@¡A®Ú¾Ú§A·Q­n°»´ú¤°»ò¿ù»~¦Ó©w:
\begin{tscreen}
\begin{verbatim}
D_OPT   001            option settings
D_DEF   002            defaults file processing
D_UTMP  004            utmp/wtmp processing
D_INIT  010            line initialization (INIT)
D_GTAB  020            gettytab file processing
D_RUN   040            other runtime diagnostics
D_RB    100            ringback debugging
D_LOCK  200            uugetty lockfile processing
D_SCH   400            schedule processing
D_ALL   777            everything 
\end{verbatim}
\end{tscreen}

³]©w {\ttfamily DEBUG=010} ¬O­Ó¶}©lªº¦n¦a¤è¡D

¦pªG§A¥¿¦b°õ¦æ {\ttfamily syslogd} ªº¸Ü¡A°»¿ù¸ê°T±N·|¥X²{¦b§Aªº°O¿ýÀÉ¸Ì¡D
¦pªG§A¨S¦³°õ¦æ {\ttfamily syslogd} ¨º»ò {\ttfamily getty} ªº¸ê°T±N·|¥X²{¦b {\ttfamily /tmp/getty:ttyS}{\itshape N\/} ¸Ì¦Ó {\ttfamily uugetty} ªº¸ê°T«h·|¥X²{¦b {\ttfamily /tmp/uugetty:ttyS}{\itshape N\/} ¸Ì¡A¦Ó¥B¥¦­Ì¤]·|³Q©ñ¨ì {\ttfamily /var/adm/getty.log} ¸Ì¥h¡D
¬d¬Ý°»¿ù¸ê°T¬Ý¬Ýµo¥Í¤F¤°»ò¡D³Ì¥i¯àªº¬O¡A§A±N±o­n½Õ¾ã¤@¨Ç§A°t¸mÀÉ¸Ìªº°Ñ¼Æ¡A¨Ã¥B­«·s°t¸m§Aªº¼Æ¾Ú¾÷¡D

§AÀ³¸Ó¤]¥h¸Õ¸Õ {\ttfamily mgetty}¡D¦³¨Ç¤H¦b¨Ï¥Î¥¦®É§ó¬°©¯¹B¡D




\section{¨ä¥¦ªº¸ê°T¨Ó·½}

\begin{itemize}
\item ¤U¦C«ü¥Oªº½u¤W¤â¥U(man pages): {\ttfamily agetty(8)}, {\ttfamily getty(1m)}, {\ttfamily gettydefs(5)}, 
{\ttfamily init(1)}, {\ttfamily login(1)}, {\ttfamily mgetty(8)}, {\ttfamily setserial(8)}
\item §Aªº¼Æ¾Ú¾÷¤â¥U
\item NET-3 HOWTO: ©Ò¦³Ãö©óºô¸ôªºªF¦è¡A¥]¬A¤F SLIP, CSLIP, ¥H¤Î PPP
\item \onlynameurl{PPP HOWTO}: ¦³§U©ó¨Ï¥Î PPP
\item Printing HOWTO: ¦p¦ó³]©w¦ê¦C¦Lªí¾÷
\item Term HOWTO: ©Ò¦³§A·Qª¾¹DÃö©ó {\ttfamily term} µ{¦¡ªº¨Æ±¡
\item UPS HOWTO: ³]©w³s¤W§Aªº¦ê¦C°ðªº UPS
\item UUCP HOWTO: «Ø¥ß UUCP ªº¸ê°T
\item Usenet ·s»D¸s²Õ: 
\begin{tscreen}
\begin{verbatim}
comp.os.linux.answers
        Ãö©ó Linux ªº FAQs, How-To's, READMEs µ¥µ¥¡D
comp.os.linux.hardware    
    Linux §@·~¨t²ÎªºµwÅé¬Û®e©Ê¡D
comp.os.linux.networking  
        Linux ªººô¸ô¤Î³q°T¡D
comp.os.linux.setup       
        Linux ªº¦w¸Ë¤Î¨t²ÎºÞ²z¡D
\end{verbatim}
\end{tscreen}

\item Linux ¦ê¦C¹q¤l¶l¥ó¦Cªí(mailing list)¡D­n¥[¤Jªº¸Ü¡A±H¹q¤l¶l¥ó¨ì {\ttfamily \onlynameurl{majordomo@vger.rutgers.edu}}¡A¤å³¹¤º®e¼g ``{\ttfamily subscribe linux-serial}''¡D
¦pªG§A¦b¤º®e¤W¼g ``{\ttfamily help}''¡A§A·|±o¨ì¤@¥÷»²§U»¡©ú¡D
³o­Ó¦øªA¾¹ÁÙ´£¨Ñ³\¦h¨ä¥¦ªº Linux ¦Cªí¡D°e¥X ``{\ttfamily lists}'' «ü¥O¥i¥H±o¨ì©Ò¦³¹q¤l¶l¥ó¦Cªíªº¦Cªí¡D
\item °Q½×¦ê¦C³q°T¤Î¦h°ð¦ê¦C¥dªº¥Õ¥Ö®Ñ¥i¦Û Cyclades ªº {\ttfamily \onlynameurl{http://www.cyclades.com}} ¨ú±o¡D
\item Modem FAQs:\\ 
\nameurl{http://web.aimnet.com/jnavas/modem/faq.html}{Navas 28800 Modem FAQ}\\ 
\nameurl{http://www.teleport.com/curt/modems.html}{Curt's High Speed Modem Page}
\item ¦ê¦Cµ{¦¡¼g§@:
\nameurl{http://heg-school.aw.com/cseng/authors/stevens/advanced/advanced.nclk}{Advanced Programming in the UNIX Environment}, by W. Richard Stevens 
(ISBN 0-201-56317-7; Addison-Wesley)\\ 
\nameurl{http://www.ora.com/catalog/posix/}{POSIX Programmer's Guide}, by Donald Lewine (ISBN 0-937175-73-0; O'Reilly)
\end{itemize}





\section{»ÊÁÂ}

        
¿W¥ß¼¶¼g³o¥÷ HOWTO ¬O¤£¥i¯àªº¨Æ¡D
ÁöµM³o¥÷ HOWTO ªº¤º®e¤j³¡¥÷³£¬O§Ú¼gªº¡A§Ú¸g±`­«¼g³o¨Ç·PÁÂ¨Óºû«ù³\¦h¦b¼g§@¤è¦¡¥H¤Î¤º®e¤W¦³°^Ämªº¤H¡D
·PÁÂ¨C­Ó´¿¸g°^Äm¸gÅç©Î«ØÄ³ªº¤H¡A³o¨Ç¤Hªº¦Cªí¤w¸gªø±oµLªk¦C¥X(¶W¹L¤@¦Ê¤H)¡D
¯S§O·PÁÂ Ted T'so ¹ï©ó¦³Ãö¦ê¦CÅX°Êµ{¦¡°ÝÃDªº¦^µª¡AÁÙ¦³­t³dºûÅ@ {\ttfamily getty\_ps} ªº Kris Gleason¡A¥H¤Î­t³dºûÅ@ {\ttfamily mgetty} ªº Gert D\"oring¡D

SERIAL HOWTO µ²§ô

\end{document}
