Date: Thu, 13 Jun 1996 11:59:08 GMT From: James Raynard <fqueries@jraynard.demon.co.uk> To: jstuardo@lucas.elo.utfsm.cl Cc: questions@freebsd.org Subject: Re: UNIX question Message-ID: <199606131159.LAA25881@jraynard.demon.co.uk> In-Reply-To: <31BF5A81.7DAB@lucas.elo.utfsm.cl> (message from Jaime Stuardo on Wed, 12 Jun 1996 21:02:09 -0300)
next in thread | previous in thread | raw e-mail | index | archive | help
> Let me make a question about UNIX. How can I initialize serial ports > COM1, COM2 in UNIX by mean of a C program? after initialized, how can I > send data to them? Do you know where can I get an example program about > that? In Unix, everything is a file, so you can just use functions like open(), read() and write() to communicate with a modem, for example (and perhaps a call to tcsetattr() to configure it). Any good book or resource related to Unix programming should have examples of how to use these functions. If you need to communicate directly with hardware, use inb() and outb() after opening /dev/io - see /usr/include/machine/cpufunc.h. -- James Raynard, Edinburgh, Scotland james@jraynard.demon.co.uk jraynard@FreeBSD.ORG
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606131159.LAA25881>