Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Nov 1998 00:38:42 -0800 (PST)
From:      Joshua Kneubuhl <joshk@CSUA.Berkeley.EDU>
To:        freebsd-questions@FreeBSD.ORG
Subject:   hacking wacky modem echo...
Message-ID:  <Pine.BSF.3.96.981112001343.19420A-100000@soda.CSUA.Berkeley.EDU>

next in thread | raw e-mail | index | archive | help

More info / thoughts on the modem echo problem ...

I got a new ppp from awfulhak.org, and tried to use gdb to trace some the
data flow from tty<->socket<->tun0(?)<->kernel<->/dev/cuaa2 
(This is purely speculation- feel free to correct, as I have only a slight
idea of tun0's purpose...)

I stumbled upon the following hack in the source, and thought it might be
relevant:

#ifdef __FreeBSD__
  /*
   * A FreeBSD hack to dodge a bug in the tty driver that drops output
   * occasionally.... I must find the real reason some time.  To display
   * the dodgy behaviour, comment out this bit, make yourself a large
   * routing table and then run ppp in interactive mode.  The `show route'
   * command will drop chunks of data !!!
   */
  if (mode == PHYS_INTERACTIVE) {
    close(STDIN_FILENO);
    if (open(_PATH_TTY, O_RDONLY) != STDIN_FILENO) {
      fprintf(stderr, "Cannot open %s for input !\n", _PATH_TTY);
      return 2;
    }
  }
#endif                      


Now, this alludes to an error _reading_ input from the tty, and it seems
that the error is in ouput getting to the terminal from the modem.
Though, after some more thought, I was thinking that this might be
something do do with the way that the tty is using select() to get input
from the fds...  I thought that maybe if input from the console was
triggering a callback to tell that the MODEM was ready with output, it
would account for the output from teh modem getting to the console after
each input...  In addition, I noticed that when trying to get the
disagnostics from the modem by holding down the space bar thr output from
the modem would proceed in approximately the same rate as the repeat rate
from the keyboard.  Trying to be semi-automated, I started pasting
mouse-buffers filled with spaces.  To my dismay it slowed the output from
the modem IMMENSELY.  

Could the X paste grab small chunks of spaces, and pass them to the shell
running minicom?  Each pasted chunk of spaces would generate a single
select() interrupt and signal a byte to be read from the modem.  When the
modem is connected to my isp, puhing space is enough to generate a
sizeable block of data to be read from the modem.

Is this completely in the wrong direction?


Help!  Its a horrible end to be using windows 98 to type mail...


Josh

(This is a semi-followup to a message earlier tonight entitled "funky
modem echo!")




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981112001343.19420A-100000>