From: Andrew Cottrell Newsgroups: comp.os.msdos.djgpp Subject: Re: where i can find the right code examples Date: Fri, 19 Jul 2002 20:36:52 +1000 Organization: ihug ( New Zealand ) Lines: 39 Message-ID: References: <3d36efb1$0$250$ba620e4c AT news DOT skynet DOT be> NNTP-Posting-Host: p360-tnt1.syd.ihug.com.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: lust.ihug.co.nz 1027075024 24059 203.173.129.106 (19 Jul 2002 10:37:04 GMT) X-Complaints-To: abuse AT ihug DOT co DOT nz NNTP-Posting-Date: Fri, 19 Jul 2002 10:37:04 +0000 (UTC) X-Newsreader: Forte Agent 1.91/32.564 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com >Im a new user of djgpp and gcc and im looking for workable code! >Is there a place where i can find a list of code that i can use. >I need code that can drive a parallel and serial port on a dos PC I have written parallel port driving and checking software with DJGPP. There are a number of ways to start on the parallel port, they are:- 1) Download Ralph Brown's interrupt list and check out the I/O port definitions. 2) Find a site whoch has programming info on the parallel port and convert the code from BCC/MS VC to DJGPP. This is is a trivial task is the code from what I can remember. The serial port is a bit more complex as you need to figure out what your requriements are as some of the serial libraries :- a) only support one com port some support mutliple ports b) some are interrupt driven and some are polled. I would advise against usign a polled serial library. c) some have call back functions on errors. I have not used these. d) only one supports wakeup mode / 9 bit comms depends on the background. e) the majority of the serial libraries are in C, but soem are in assembly f) some are available for DJGPP, BCC and Linux. some are DJGPP/BCC only and some are DJGPP only g) some have timing functionality some don't (it's not a big deal as it is easy to add ) I have a serial data sniffer with full source code available from my home page http://homepages.ihug.com.au/djgpp~acottrel/ (remove the djgpp from the url) It supports logging the data to a file and includes timing and replay facility. May be a place to start. There are bugs in the save/replay code becuase I have not had time to merge the changes from another project which uses an updated save/replay core. Regards, Andrew