Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Peter Petrakis <ppetrakis@alphalinux.org>
To: axp-list@redhat.com
Subject: Re: Kermit?
Date: Tue, 25 May 1999 18:58:51 -0400	[thread overview]
Message-ID: <374B2B2B.FB795CE3@alphalinux.org> (raw)
In-Reply-To: v590aclv6l.fsf@Phantom.newport.com

Have you tried using minicom yet?

Peter

Rui-Tao Dong wrote:
> 
> I have a not quite dead (floppyless and diskless) UDB and I am trying
> to make it a dedicated firewall for my cable modem.  I need a terminal
> program to talk to serial console.
> 
> Has anyone got Kermit working?  I got the (very old) rpm from
> Columbia, but it crashes on connect.  I am having a hard time
> compiling it.  Does anyone have an RPM?  Or has any suggestion on a
> better terminal program?  I tried to roll my own, but without much luck.
> 
> --
> Regards,
> 
>                         Rui-Tao (x679)
> 
> /* Usage link /dev/cua0 */
> 
> #include <stdio.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include <sys/types.h>
> 
> #define BUFSIZE 1024
> 
> void copy_bytes(int in_fd, int out_fd)
> {
>   char buf[BUFSIZE];
>   int rbytes;
> 
>   if ( (rbytes=read(in_fd, buf, BUFSIZE)) > 0 )
>     {
>       int wbytes;
>       char* buf_p=buf;
>       fprintf(stderr, "Reading %d bytes from %d.\n", rbytes, in_fd);
> 
>       while (buf_p < buf+rbytes)
>         {
>           int wsize=rbytes+buf-buf_p;
>           wbytes=write(out_fd, buf_p, wsize);
>           fprintf(stderr, "Writing %d bytes to %d.\n", wbytes, out_fd);
>           buf_p += wbytes;
>         }
>       if (wbytes < 0)
>         {
>           perror("write");
>           exit(-1);
>         }
>     }
>   else if (rbytes < 0)
>     {
>       perror("read");
>       exit(-1);
>     }
> }
> 
> int main(int argc, char** argv)
> {
>   int fd;
>   fd_set read_set;
>   /* Initialize the file descriptor set. */
> 
>   if (argc !=2)
>     {
>       fprintf(stderr, "Using %s device-file.\n", argv[0]);
>       return -1;
>     }
> 
>   if ((fd=open(argv[1], O_RDWR)) < 0)
>     {
>       perror("open");
>       return -1;
>     }
>   FD_ZERO (&read_set);
>   FD_SET (fd, &read_set);
>   FD_SET (0, &read_set);
> 
>   while (1)
>     {
>       if ( select(FD_SETSIZE, &read_set, NULL, NULL, NULL) < 0 )
>         {
>           perror("select");
>           return -1;
>         }
> 
>       if ( FD_ISSET(fd, &read_set))
>         {
>           copy_bytes(fd, 1);
>         }
>       else if (FD_ISSET(0, &read_set))
>         {
>           copy_bytes(0, fd);
>         }
>       else
>         {
>           return -1;
>         }
>     }
> 
>   close(fd);
>   return 0;
> }
> 
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

--
www.alphalinux.org
Peter Petrakis          Warrior/Engineer       ppetrakis@alphalinux.org
"Oh my God! They killed Xena! You bastards!!" 
"<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..."


  parent reply	other threads:[~1999-05-25 23:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-25 21:02 Kermit? Rui-Tao Dong
1999-05-25 22:10 ` Kermit? Michal Jaegermann
1999-05-25 22:18 ` Kermit? Larry Snyder
1999-05-25 23:18   ` Kermit? Dan O'Reilly
1999-05-25 22:41 ` Kermit? Wes Bauske
1999-05-25 22:58 ` Peter Petrakis [this message]
1999-05-26  9:34 ` Kermit? Peter Rye
1999-05-26 12:04   ` Kermit? mgraffam
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox