Problem with TRANSMIT / Linux 2.0.27 / Redhat 4.1

Problem with TRANSMIT / Linux 2.0.27 / Redhat 4.1

Post by Frank da Cr » Mon, 03 Nov 1997 04:00:00






:
: > You know, of course, that the TRANSMIT command is a last resort, to be
: > used when an error-checking-and-correcting protocol is not available, and
: > that it is very likely to result in corrupted or missing data at the
: > receiving end, right?
:
: I do. That's why I'm using it to bootstrap a hex-encoded kermit server into
: a DS5000 microcontroller that has only a hex file reader in its boot rom.
:
(etc etc)...  I'd be really surprised if the TRANSMIT command did not send
exactly the characters it was told to send -- otherwise I'd have heard about
it by now, in spades, and in any case this is a fairly stable chunk of code
that has barely changed at all in years -- so if transmitted characters are
not coming out the port, then the driver or the port hardware are the most
likely culprits.

There has been a lot of talk recently about Linux drivers -- e.g. the
ttyS devices versus the cu devices.  Have you tried using a different driver
for the same device?

: > : I suppose I can't be totally sure of the reliability of the serial
: > : port, PC chipsets and UARTS being what they are.
: > :
: > You might have answered your own question right there.
:
: I might, though I'm a bit surprised that I haven't seen any problems in the
: other uses of the port if it's an especially unreliable one. Problems in
: the driver might be another matter, since its use by PPP is probably a
: lot different to its use by kermit.
:
Wouldn't PPP hide errors from you by repeatedly forcing retransmission of
damaged material until it gets through correctly?

: > : enabling local echo
: > :       ( the whole file is echoed to the screen, but not sent to the
: > :         line. There's another effect too : echo only works in binary
: > :         mode, not text )
: > :
:
: > The relevant command is "set transmit echo on".
:
: And "set terminal echo on", and especially "set transmit prompt 0".
:
Note that when C-Kermit echos transmitted material, these are exactly the
same characters that it sends to the port.  So if they are not coming out
the port -- and the driver is not reporting an error -- something is badly
amiss under the hood.

: Speed changing was interesting. I tried initially at 19200. I got the
: same, or very similiar results at 1200 and even at 300. The effect of
: speed changes is more noticeable in binary mode : i.e. characters are
: usually lost, but in binary mode higher speeds seem to cause wider
: variations.
:
Hmmm...  If you look at the code (transmit() in ckuus4.c) you'll see that
completely different sections of code are used for text and binary mode.
Therefore if both of them fail for you, the chance that BOTH sections of code
are faulty is pretty slim.

Binary mode should not have to be used for transmitting an ordinary text
file, and especially not for transmitting one like this -- Intel Hex files
are just about the most transportable files on earth -- restricted safe
character set, short lines, etc.

: What did change the behaviour drastically was "transmit pause". Any
: non-zero setting would completely fix the problem in binary mode, but
: at the cost of severely limiting througput (probably due to a minimum
: useful value for msleep on this hardware). Below 12, the problem in
: text mode was not affected. At 12, the problem was fixed for text, too.
:
This is fairly clear evidence that the driver is allowing its output buffer
to be overrun.   It's a good thing C-Kermit has so many controls, eh?
Btw, TRANSMIT PAUSE applies per character in binary mode, and per line in
text mode (as you knew, or discovered).

: Here's a script that illustrates the problem, and all the details of
: running it.  Unfortunately, it may be machine-speed dependent, I
: suppose.
:
Well, as far as Kermit is concerned, the speed doesn't matter.  The same
code is being executed at any speed, and the same bytes are being sent;
it's up to the driver to actually send them, and to take care of realtime
considerations like flow control, kernel buffering, checking the UART's
ready and overflow flags, etc.  In any case, your hex file transmits
perfectly here in text mode.

: For what it's worth, this machine is a 100MHz PCI 486.
:
Beyond the driver, on any PC you need to be aware of buffered versus
unbuffered UART and interrupt conflict issues.

In any case, since this is a one-time-only bootstrapping operation, and
you seem to have a workaround, I think we can consider the case closed as
far as C-Kermit is concerned.  Unless there is something wrong amongst the
many ioctls given to the driver to condition it for transmitting; these
are done in the ttpkt() routine in ckutio.c, and have worked fine in Linux
for many years, but again, C-Kermit can't see which driver you are using
-- it can only issue the appropriate and documented API calls and expect
them to work as advertised.  However, if any Linux expert wants to take a
look and suggest corrections, perhaps based on changes in the APIs that
I don't know about, feel free!

- Frank

 
 
 

Problem with TRANSMIT / Linux 2.0.27 / Redhat 4.1

Post by Adrian Godw » Fri, 07 Nov 1997 04:00:00




Quote:>There has been a lot of talk recently about Linux drivers -- e.g. the
>ttyS devices versus the cu devices.  Have you tried using a different driver
>for the same device?

I have now ...  no, it's exactly the same.

Quote:>Wouldn't PPP hide errors from you by repeatedly forcing retransmission of
>damaged material until it gets through correctly?

Quite possibly. But if it was very bad, it would probably affect throughput
noticeably. The problem is very repeatable here.

Quote:>In any case, since this is a one-time-only bootstrapping operation, and
>you seem to have a workaround, I think we can consider the case closed as
>far as C-Kermit is concerned.  Unless there is something wrong amongst the
>many ioctls given to the driver to condition it for transmitting; these
>are done in the ttpkt() routine in ckutio.c, and have worked fine in Linux
>for many years, but again, C-Kermit can't see which driver you are using
>-- it can only issue the appropriate and documented API calls and expect
>them to work as advertised.  However, if any Linux expert wants to take a
>look and suggest corrections, perhaps based on changes in the APIs that
>I don't know about, feel free!

>- Frank

I've re-built ckermit to patch level 35 and find the same problem still
occurs. If I insert a short delay (500ms) just before ttres() is called,
the problem goes away - the critical point seems to be the first tcsetattr()
in that area. A delay before it helps, a delay after it doesn't. It looks as
though TCSADRAIN isn't being fully respected by the driver (and a specific
call to tcdrain() didn't improve things, either).


acknowledged a problem in this respect, in response to a poster who had had
difficulties with speed changing. I don't know why changing the attributes
should cause the output to be lost (the reported problem with speed changes
just caused undrained output to be sent at the new speed), but it seems as
though this may be an explanation. I'm not sure why it works in other
situations, but since there would be a race between the hardware/interrupt
handler and the user code, it's possible that my particular setup 'just
happens' to show it up.

Anyway, the fix is apparently to use a 2.1 or later kernel : it won't be
fixed in 2.0. kernels.

-adrian

 
 
 

1. RedHat Linux 4.1 Kernel 2.0.27 Log Problems Pleaes Help!

I have a problem that hopefully someone will be able and willing to help me
with, I tried manually rotating the message log on our server. I did this by
doing a cp to messages.bac and then creatinga  new messages file, now the
systom will not write to the log file, I tried using the touch command, I
have checked the ownership and chmod setting, they are exactly the same as a
freshly installed linux system but still no logging. What can the problem be
and how do i fix it, please please help..

TIA,
Brad

2. new to linux-need help dowloading files

3. RedHat 4.1 Kernel 2.0.27, Log problems........

4. xview event loop

5. RedHat Linux 4.1 Kernel 2.0.27

6. Running 2 networks into Linux Box !?!?!

7. RedHat Linux 4.1 kernel 2.0.27.....

8. Socket "name" question

9. RedHat 4.1 Linux 2.0.27 Error: modprobe: Can't locate module binfmt-0

10. ICMP Difficulties with RedHat 4.1 and 2.0.27 and.30 Kernels

11. Terrible behaviour of NS 4.0b3 under RedHat 4.1 (2.0.27)

12. Netscape 3.01 hang on RedHat 4.1 with kernel 2.0.27 at fvwm95 [HELP]

13. Redhat 4.1 (2.0.27) IP -> Name Auth Failure