From owner-freebsd-questions Thu May 13 11: 1:49 1999 Delivered-To: freebsd-questions@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.144.32]) by hub.freebsd.org (Postfix) with ESMTP id 19DD1150FE for ; Thu, 13 May 1999 11:01:43 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.8.8/8.8.8) with ESMTP id LAA19744; Thu, 13 May 1999 11:01:42 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Date: Thu, 13 May 1999 11:01:41 -0700 (PDT) From: Doug White To: HyunTech@mail.hitel.net Cc: questions@freebsd.org Subject: Re: How can I send/receive data th In-Reply-To: <199905130900.RAA21231@mail.hitel.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Don't bcc: lists, thanks. On Thu, 13 May 1999 HyunTech@mail.hitel.net wrote: > I want to send/receive data to other computer thru serial port without modem. > So, I have connected COM1 to COM2 of itself and programed as follows. > > Shell("stty -f /dev/ttyd0 clocal cread raw 9600 cs8 -parenb -cstopb"); > Shell("stty -f /dev/ttyd1 clocal cread raw 9600 cs8 -parenb -cstopb"); > fd1 = open("/dev/ttyd0", O_RDWR); > fd2 = open("/dev/ttyd1", O_RDWR); > childpid = fork(); > if(childpid > 0) > for(;;){ > ch = getchar(); > write(fd1, &ch, 1); > } > else if(childpid == 0) > for(;;){ > rc = read(fd2, &ch, 1); > putchar(ch); > } > > But, if press any key, login message is displayed or nothing is displayed. > But, I don't want to use serial port for terminal, but only for data > communication. > How can I solve this problem ? Turn the getty off in /etc/ttys on your port (ttyd*) then kill -HUP init. Doug White Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve http://gladstone.uoregon.edu/~dwhite | www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message