Linux 版 (精华区)

发信人: netiscpu (说不如做), 信区: Unix
标  题: [M] 如何将PC机作为一台终端
发信站: 紫 丁 香 (Sat May 23 19:08:10 1998), 转信


        本文整理自Linux-Admin Mailling List.

[问题] Howto use a PC as a terminal

Hello,
        I am setting up an old 286 for my dad's use as a terminal. I read
the Linux serial howto in which it talks about setting up terminals.
However I still need help. The terminal is running DOS7 off of a bootdisk
with the last version of DOSKermit. I have a straight through serial cable
with a null modem adapter and have mgetty set up to accept the login. I
have my mouse on ttyS0, modem on ttyS1, and terminal on ttyS2. The kernel
recognizes all of these at boot time. When init runs (or restarts)
however, it can't start mgetty for the serial line. When I change mgetty
to the modem it works fine and picks up the phone like it should. However,
nothing on the serial cable.

        I was wondering about the null modem wiring. In the Serial-HOWTO
it shows the wiring thusly:

          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

On the back off the box for the null modem adapter it shows the following:

                                  1 --> 1
                                  2 --> 3
                                  3 --> 2
                                4=5 --> 8
                                  6 --> 20
                                  7 --> 7
                                  8 --> 4=5
                                 20 --> 6

Could the disrepancy in the two wirings be the source of my troubles? If
so, what kind of config is the serial HOWTO talking about? I talked to
several wiring shops around town and they said the second diagram is a
standard null modem config. If it is the problem should I wire my own null
modem or does the adapter go under different names? Is there anything else
that could be causing it not to work over a standard serial port? All
ideas appreciated.

Thanks a bunch,

Joseph Martin
martinja@exis.net
Linux newbie/sysadmin ( dangerous combo! ;-> )

[回答1]

My guess.. 

ttyS0 = IRQ 4
ttyS1 = IRQ 3
ttyS2 = IRQ 4

The mouse will basically own IRQ 4 so ttyS2 wont be able to get any
access. It might work when sharing an IRQ between the terminal and the 
modem. Try terminal on ttyS3 -or- swap mouse and modem -or- change
one item's IRQ to something else.

Robert Towster

[回答2]

The second setup above loops RTS -> CTS locally, so you have no flow
control signals. You would need to configure the tty driver and
terminal software to use software (XON/XOFF) flow control. You may be
better off wiring your own null-modem adapter if you can't find a
ready-made one supporting RTS/CTS.

-- 
Glynn Clements <glynn@sensei.co.uk>

[回答3]

I almost hate to ask, but how do I configure the tty driver? I'd like to
try that before I wire my own null modem.

Thanks,

Joseph Martin
martinja@exis.net
Linux newbie/sysadmin ( dangerous combo! ;-> )

On Wed, 20 May 1998, Glynn Clements wrote:

[回答4]

        I've never done what you're doing before, but I'll take a stab
at it:
        It should just be a matter of adding an entry in /etc/inittab
and doing an "init q".
        ** back up your inittab, and make sure root is logged in on a
different console before you modify your inittab **
        The entry might look like this (Read the man pages for inittab
and getty and write a line that fits your needs, though):

        9:2345:respawn:/sbin/getty -h ttyS0
        In English, this says: <unique label>:<run in runlevels 2,3,4,&
5>:<restart the process every time it terminates>:<the process is getty.
Do not reset the line on startup. The line is Com1.>

        If you have trouble, check out the man pages for gettydefs and
check out /etc/conf.getty (Maybe you'll need to specify a line speed?).
The Keyboard and Console HOWTO should provide all the fine-tuning hints
you could ever need.

        Cheers!
                --Chris

[回答5]

The `stty' command sets the various options.

        stty -crtscts -ixon -ixoff

should disable RTS/CTS flow control and enable XON/XOFF flow control.

You may also want to add -clocal (disable DSR/DTR/DCD).

As Robert Towster pointed out, if you have more than 2 serial devices
you will probably need to change the default IRQ assignments to avoid
conflicts.

-- 
Glynn Clements <glynn@sensei.co.uk>

[回答6]

I have a P100 server and a 386 terminal conected by null modem; the 386
have DOS and
a terminal emulator called TELIX
I maked my own cable.A couple of DB25 about 10M of wire (cable) a
solder....and ada!
I use the following configuration and it goes:

DB25          DB25
TD   2-------3  RD

RD   3-------2  TD

RTS  4-------8  DCD
     |
CTS  5

DSR  6-------20 DTR
     |
RI  22

GND  7-------7  GND

DCD  8-------4  RTS
             |
             5  CTS
DTR 20-------6  DSR
             |
             22 RI

I hope I help you
                                        Juampe

[回答7]

Thanks for all the help. However I have a couple more questions. On the
com ports and irqs. I can reset the irq without changing hardware jumpers
for my DB25 port? (Are there even jumpers?) And yes I know how to do it
with setserial I just want to make sure I'm not missing anything.

Secondly on wiring null modems... Could someone send real graphics showing
how they are wired, or links to good instructions? (There's only so much
you can show with ascii :) ). I am totally new to null modems and wirings
and howto and such so pointers are welcome. (Info like which pins are
which numbers, which direction it counts from, what numbers are on the
top and bottom rows, etc.)


Thanks,

Joseph Martin
martinja@exis.net
Linux newbie/sysadmin ( dangerous combo! ;-> )

[回答8]

Hey,
        An addendum to the last message: When I restart init with the
serial line changed to XON/XOFF I get the following message every 12
minutes:
INIT: s2 respawning too fast. Shutting down for five minutes.
I can tell obviously that mgetty is restarting too fast and is being shut
down as a result, but what causes mgetty to respawn quickly?

Joseph Martin
martinja@exis.net
Linux newbie/sysadmin ( dangerous combo! ;-> )

[回答9]

IRQ and Com ports has always been a problem with PC's..
Many of them are set via jumpers and if they are you will either have
to refer to the documentation that you got with the serial port card or
your computer (or perhaps the card / motherboard / case will have a
diagram).. If you have jumpers and no docs.. well.. good luck..
Newer computers can set their serial ports in the BIOS (thank god)..
Hopefully you will have one of these..

Anyway.. If I remember right.. You said you have:
Mouse    - Com 1 - IRQ 4  *
Modem   - Com 2 - IRQ 3
Terminal  - Com 3 - IRQ 4  *
which I can almost guarantee you will not work.. This is because
the interrupts for the mouse and the terminal conflict.. You *may*
get the modem and terminal to share an IRQ.. but.. your most
likely way to get all 3 of them to work at the same time would be
to either switch to a PS/2 mouse (uses IRQ 12) or find out if you 
can set one of your com ports to a non-standard IRQ.. (not 3 or 4)

>Secondly on wiring null modems... Could someone send real graphics showing
>how they are wired, or links to good instructions? (There's only so much
>you can show with ascii :) ). I am totally new to null modems and wirings
>and howto and such so pointers are welcome. (Info like which pins are
>which numbers, which direction it counts from, what numbers are on the
>top and bottom rows, etc.)

Check out the following pages that have pinouts..

http://confused.ume.maine.edu/mdw/HOWTO/Serial-HOWTO-8.html#ss8.1

http://www.geocities.com/TheTropics/Shores/2250/pinout.html

Hope this helps....
Robert Towster

[回答10]        

The message usually indicates that the program terminates immediately,
e.g. because of an error in its command-line options or its config
file. It may just be that an error has crept in whilst changing the
settings.

-- 
Glynn Clements <glynn@sensei.co.uk>

[回答11] 

/* 注:本篇回答与主题无关,希望大家在Reply Mailling-List时,注意这个问题,
      否则会引起其他Mailling-List Users的反感 */

Hi,

     I was interested in Linux, but I don't know the Slackware 3.4 and

Redhat 5.0 which one is better.

    Can anyone tell me.

--


楷蓝咨询公司:李凯
----------------------------------------------------------
Mr. Li Kai  Manager,   Kailan Consulting Inc.
Tel: 0086-520-8233099  Fax: 8233050
请访问我们的主页:http://www.kailan.com 让你全面了解张家港
给我们发电子邮件:mailto:kailan@public1.sz.js.cn 携手合作

-----------------------End--------------------------------


[回答12]

Seems to me there is/was some web pages by (Mrs?) Kantronics that dealt
with wiring diagrams of various radios to various TNCs.  There would be
pictures of DB9 & DB25 connectors there, I imagine.  Maybe even a null
modem picture.  

 As I get older my is gets poorer & I'd just as soon go to
Radio Shack or a mailorder house and buy a null modem cable/adapter
than to try to solder to those little pins. :-|

Chuck

[回答13]

  A while back I use to do similar things with Coherent...which had a neat
command that created nodes for async devices...
asymkdev.....with it you could create devices that "shared " the same port
....but one worked in the interrupt-driven mode and the other in the polled
mode....thus you could have both the mouse and a modem on the same port
working in different modes....the more demanding device got the interrupt
mode and the other got the polled mode...mouse & modem in this case.....

Question: Can you do similar things with Linux?  If so might be the solution
to the original problem/posting...

Minor thought on cables.....For a basic "get-it-up-and-working cable"    2
<----->3 , 3 <----->2,  and 7 <--->7 will work 90 per cent of the
time....THEN you can get fancy with flow control etc, etc, etc.

"Gimme KERMIT & a  serial cable and I'll network the world!"  --author
unknown.

GL....Bill..............


[回答14]


  A while back I use to do similar things with Coherent...which had a neat
command that created nodes for async devices...
asymkdev.....with it you could create devices that "shared " the same port
....but one worked in the interrupt-driven mode and the other in the polled
mode....thus you could have both the mouse and a modem on the same port
working in different modes....the more demanding device got the interrupt
mode and the other got the polled mode...mouse & modem in this case.....

Question: Can you do similar things with Linux?  If so might be the solution
to the original problem/posting...

Minor thought on cables.....For a basic "get-it-up-and-working cable"    2
<----->3 , 3 <----->2,  and 7 <--->7 will work 90 per cent of the
time....THEN you can get fancy with flow control etc, etc, etc.

"Gimme KERMIT & a  serial cable and I'll network the world!"  --author
unknown.

GL....Bill..............

[完]

--

                              Enjoy Linux!
                          -----It's FREE!-----

※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: mtlab.hit.edu.cn]
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:212.781毫秒