From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp Subject: Re: Portable code for accessing the hardware ports under DOS and Linux Date: Fri, 8 Oct 1999 16:45:04 -0500 Organization: Rose-Hulman Institute of Technology Lines: 57 Message-ID: <7tlool$72n$1@solomon.cs.rose-hulman.edu> References: <006401bf106f$5d63d060$0100a8c0 AT pcpablo> NNTP-Posting-Host: 137.112.205.146 X-Trace: solomon.cs.rose-hulman.edu 939419221 7255 137.112.205.146 (8 Oct 1999 21:47:01 GMT) X-Complaints-To: news AT cs DOT rose-hulman DOT edu NNTP-Posting-Date: 8 Oct 1999 21:47:01 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com From: Pablo M. Dotro Newsgroups: comp.os.msdos.djgpp To: You double posted. Post your article either to c.o.m.d or to the mail address; otherwise, it'll appear twice in both places. > Hi to all! > > I am creating a special made data adquisition software for > one of the Physics labs of the university in which I work, and > I have a mixed DOS/Win95 and Linux network. DOS emulation software on Linux is pretty mature. > My idea is to create a software that has to have the same > look and feel under DOS and under Linux (probably using > ncurses or sth. like that). I would suggest Allegro for the visual interface. Allegro code will compile under DJGPP, M$ Visual C++, and Linux gcc with about three tiny source code changes per platform. http://www.talula.demon.co.uk/allegro/ To see what can be done with Allegro, especially how easy it is to write source that compiles under many platforms, look at the source for DOSArena. http://come.to/yerrick > So I decided to use DJGPP for the DOS/Win95 machines > and the GCC of my RedHat 5.2 in the others. As far as I know, > under DOS there are a couple of functions (inportb() and > outportb()) which handle the access to the hardware ports > (I need to access port 0x220), PC I/O port 0x220 is in the Sound Blaster region. If your acquisition hardware emulates a Sound Blaster, then Allegro has portable code to control it. > but I do not know if they work under Linux... I've tested, > and they do not seem ot exist under Linux, so either I have > to use some other function or I need to add another include > file under my Linux project. > Does anyone knows if there is a protable way to access > hardware ports (without assembler)? Are there any > standard functions to do this? Not all platforms have I/O ports; therefore, a standard such as the C standard or the C++ standard cannot include hardware I/O port access. Anything in the way of I/O ports will always be implementation defined. Damian Yerrick