From owner-freebsd-questions Tue Oct 15 19:44:23 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA00404 for questions-outgoing; Tue, 15 Oct 1996 19:44:23 -0700 (PDT) Received: from seabass.progroup.com (catfish.progroup.com [206.24.122.2]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA00398 for ; Tue, 15 Oct 1996 19:44:19 -0700 (PDT) Received: from seabass.progroup.com (seabass.progroup.com [206.24.122.1]) by seabass.progroup.com (8.7.5/8.6.12) with SMTP id TAA18730; Tue, 15 Oct 1996 19:42:08 -0700 (PDT) Message-ID: <32644B80.41C67EA6@progroup.com> Date: Tue, 15 Oct 1996 19:42:08 -0700 From: Craig Shaver Organization: Productivity Group, Inc. X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.1.0-RELEASE i386) MIME-Version: 1.0 To: hmmm CC: freebsd-questions Subject: Re: using sio ports References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk hmmm wrote: > > i'm not to great at UNIX and would appreciate any guidance in proceeding > with the following: > > i have a FBSD box that needs to communicate with another non-UNIX box > using a custom async protocol. > > my current state of ignorance would just like to mark off a BSD com port, > throw in a polling-based driver for the marked off port, and be on my way, > without further complications. > > but i think i'm oversimplifying. i think i'd have trouble because the > remote PC would cause overruns in the FBSD box due to FBSD interrupts. > Why? If you hang a read on the port it should get everything. The device driver will take care of any FIFO and store a certain amount of chars in kernel space. > if i have to use a standard FBSD sio driver for the com port i wish to use, > what special considerations/configurations do i need to take into account? You just need to know how to set up the port using ioctl(). > > can i just connect the 2 PCs with a NULL modem cable and start C coding > with some print routines in/out the ports? Open the port (=device in /dev) as a regular file. Set it up for the line protocol you need using ioctl(). Do a man -s 4 tty (tty(4)), and follow the "see also" man pages, especially termios. See also sio(4). > > does it matter whether i use a NULL modem cable between the FBSD box and > the remote PC as opposed to 2 radio modems? (diff cfgs?) Null modem should work great. > > is there a good libc function that allows you to > putarray(numofbytes)/getarray(numofbytes) and puts()/gets() > in and out of sio ports? use the std c lib. use whatever you want, read(), fread(), fgets(), fgetc(), ......... > ------------------------------------------------------------------------------ > ? http://www.alaska.net/~hmmm > ------------------------------------------------------------------------------ -- Craig Shaver (craig@progroup.com) (415)390-0654 Productivity Group POB 60458 Sunnyvale, CA 94088