home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / sysv386 / 14095 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  6.3 KB

  1. Path: sparky!uunet!sun-barr!news2me.ebay.sun.com!seven-up.East.Sun.COM!sixgun.East.Sun.COM!sungy!stasys!lmsys!mrz!busybit!jochen
  2. From: jochen@busybit.mrz.sub.org (Jochen Fahrner)
  3. Newsgroups: comp.unix.sysv386
  4. Subject: Loosing incoming serial characters [summary]
  5. Message-ID: <JOCHEN.92Sep5145619@busybit.mrz.sub.org>
  6. Date: 5 Sep 92 12:56:19 GMT
  7. Sender: uucp@stasys.sta.sub.org
  8. Organization: Busybit's Software Labor, D-8068 Pfaffenhofen
  9. Lines: 128
  10. X-Md4-Signature: 2df955ff714bdbd4a0b5884042ad66ae
  11.  
  12. Some weeks ago I wrote about problems, loosing incoming characters on
  13. my dumb serial port. I got many replies from people with similar
  14. problems, so I think this should be in the FAQ, even if it is not
  15. frequently asked, because most people don't realize this problem.
  16.  
  17. So I will describe the problem in the way of an FAQ.
  18.  
  19. Question:
  20.     My system looses incoming serial characters at speeds >2400bps
  21.     even with fas and 16550 chips.
  22.     I have SCSI-disks with busmaster dma hostadapter (like adaptec 1542)
  23. or
  24.     With uucp and V32bis connections I get 1300cps on outbound
  25.     traffic, but only 800cps on inbound traffic.
  26.     I have SCSI-disks with busmaster dma hostadapter (like adaptec 1542)
  27.  
  28. or
  29.     My floppy is slow and sometimes I get floppy I/O-errors when
  30.     there is activity on the hard disk.
  31.     I have SCSI-disks with busmaster dma hostadapter (like adaptec 1542)
  32.  
  33. Answer:
  34. The PC-Design is not very good for multitasking operating system like
  35. unix or OS/2. There are at least 2 dumb periphery devices which needs
  36. fast response by the cpu or the dma-chip: the floppy controller and
  37. the dumb serial ports. These devices have no own intelligence and want
  38. to get every byte in the right moment over the bus. In single tasking
  39. environments like MS-DOS this is not a problem, there is no other
  40. traffic on the bus when doing such things. In multitasking operating
  41. systems this is also no problem, if the cpu is interruptable with the
  42. desired speed and has control over the bus.
  43.  
  44. But there comes a problem with busmaster cards. These intelligent
  45. cards can use the bus without cpu intervention. The cpu only says:
  46. "read sector 4711 from disk 0 to memory location 0815". Thats all. The
  47. busmaster adapter does the rest alone in a very fast way.
  48.  
  49. This has one big advantage: The cpu can do something else in the
  50. meantime.
  51.  
  52. But: what happens, if the cpu wants to use the bus while the adapter
  53. is transfering data to memory ? The cpu has to wait until the bus is
  54. free. To avoid such conflicts, when the cpu has to serve some dumb
  55. periphery, the busmaster adapters are configurable how long they can
  56. use the bus and how long they should leave it free. These parameters
  57. are called buson- and busoff-time. If the buson time is longer than 5
  58. usec., you will get problems with your floppy drive.
  59.  
  60. This is the theory.
  61. But here comes the practice:
  62. The timings for busmaster dma was never exactly specified by ibm for
  63. the isa-bus. So every mainboard manufacturer and every adapter
  64. manufacturer implements a little variant of busmaster timing. If you
  65. have luck, you will have a mainboard/adapter combination which works
  66. without problems. But often you will have a combination which will not
  67. work as described, the adapter does not leave the bus free at the
  68. specified times.
  69.  
  70. Often you will not notice, that you have such trouble. The only time
  71. critical devices are the floppy controller and the dumb com-ports.
  72. The driver for the floppy controller will do some retries when there
  73. are erorrs reading or writing the floppy disk. So you will only
  74. mention slow floppy accesses.
  75.  
  76. The driver for the serial ports will have no chance to do a retry, but
  77. mostly you will use some sort of file transfer protocol with the
  78. serial device, like uucp-g or kermit, which will do its own retries
  79. with communication failures. Again, you will notice only slow
  80. throughput when receiving data. Sending data is not a problem, because
  81. it is not time critical. You will not loose characters if the cpu can
  82. not access the bus.
  83.  
  84. Question:
  85. How can I determine, if I have problems with my busmaster hostadapter?
  86.  
  87. Answer:
  88. 1) If you have a high-speed modem:
  89.    Configure it right, so that flow control works at 2400bps.
  90.    Verify that flow control works, by doing some cpu-intensive
  91.    work in the background.
  92.    Login to a unix system, do something like "ls -lR" and watch the
  93.    output. If scrolling stops and continues without loosing
  94.    characters, your flow control works.
  95.    Now try the same thing with 9600bps or 19200 bps. If you are
  96.    loosing no characters with cpu-intensive tasks in the background,
  97.    you are ok.
  98.    Now try the same thing with 9600bps or 19200 bps with something   
  99.    like "while true ; do cp /unix /foo; done" in the background.
  100.    If you are now losing characters (the output columns of ls -lR are
  101.    not aligned), you have problems with your host adapter.
  102.  
  103. 2) If you have a streamer tape
  104.    Boot from your boot-floppy, with root filesystem on floppy disk.
  105.    Mount the harddisk and do some restore from tape to disk. If you
  106.    get I/O errors with your floppy drive if the system accesses the
  107.    floppy during restore (I don't know what the system does on floppy 
  108.    disk during restore, but it does something on my system), you
  109.    probably have problems with your hostadapter.
  110.  
  111. Caution: It is not enough to run the adaptec dma test at bios location
  112. DC00:9. This only prooves, that the adaptec can access main memory
  113. without problems. It does not test, if the cpu can acces the bus
  114. within the specified buson-/busoff-times. With the above described
  115. problems the hostadapter itself works very fine, problems arise when
  116. the cpu wants to acces some dumb periphery devices during heavy(!)
  117. disk-I/O.
  118.  
  119. Question:
  120. How can I solve this problems ?
  121.  
  122. Answer:
  123. Try setting the buson-time for your hostadapter to a low value like
  124. 5 usec. and setting the busoff-time to a high value like 9 usec.
  125. If this does not help, you have no chance. You have to switch your
  126. hostadapter or your mainboard.
  127.  
  128. I can recommend hostadapters which do memory-mapped I/O, like most of
  129. the ethernet cards do. Memory mapped I/O has the same advantages like
  130. busmaster-dma, but not the disadvantages,
  131.  
  132. If you have not simultaneous users logged in to your unix system, you
  133. can also use adapters with programmed I/O (like adaptec 1522) with no
  134. significant disadvanteges. I now use a 1522 and I am very happy with
  135. this controller.
  136.  
  137. Jochen
  138. -- 
  139. Jochen Fahrner, D-8068 Pfaffenhofen, jochen@busybit.mrz.sub.org
  140.