Need help reading IO ports

Need help reading IO ports

Post by Jason Arthur Gaym » Thu, 19 Oct 1995 04:00:00



Someone please help! I'm looking for an efficient way to write a program
that reads an IO port once every five or so seconds and updates a few files
before sleeping for the alloted time period and then repeat the process.
What I need help is with reading the /dev/port device--need something to
do the same job as Borland C's inp() command.  I've tried opening /dev/port
with fopen and then using getc with a loop to get all 1024 port values, but
this causes some unexpected trouble with the network cards.  I'm new to
programming C for unix devices so any help will really be appreciated.
Thanks!

-jason.
 
 
 

Need help reading IO ports

Post by Coop Accou » Thu, 19 Oct 1995 04:00:00



|> Someone please help! I'm looking for an efficient way to write a program
|> that reads an IO port once every five or so seconds and updates a few files
|> before sleeping for the alloted time period and then repeat the process.
|> What I need help is with reading the /dev/port device--need something to
|> do the same job as Borland C's inp() command.  I've tried opening /dev/port
|> with fopen and then using getc with a loop to get all 1024 port values, but
|> this causes some unexpected trouble with the network cards.  I'm new to
|> programming C for unix devices so any help will really be appreciated.
|> Thanks!

|> -jason.
|>
        If your familiar with inp() and outp() you can try including <asm/io>
        these are inline assembly macro that will work with gcc. Such functions
        as inb() insw() and their out couterparts
        are defined and essentially work like borland's own
        (i.e. read/write a byte || word || dword from the specified port)
have fun
--

        Stephane Trinh


                * What matters is not what you eat *
             * What matters is what you think you eat *

 
 
 

1. Need help reading IO ports.

Someone please help! I'm looking for an efficient way to write a program
that reads an IO port once every five or so seconds and updates a few files
before sleeping for the alloted time period and then repeat the process.
What I need help is with reading the /dev/port device--need something to
do the same job as Borland C's inp() command.  I've tried opening /dev/port
with fopen and then using getc with a loop to get all 1024 port values, but
this causes some unexpected trouble with the network cards.  I'm new to
programming C for unix devices so any help will really be appreciated.
Thanks!

-jason.

2. obsd30/ipf crashes on w2k ping

3. Need help with Parallel Port IO

4. Yggdrasil does not work on Compaq Presario

5. Reading IO ports in Linux

6. DISABLING in.pop3d message logging

7. how to give permission to read and write an IO port

8. Oh this is a good one

9. how do i read/write system io ports?????????

10. Help needed for reading serial port under SCO 3.2

11. "Help needed : read special character from serial port"

12. Need help porting a CD-ROM reading and control library

13. Help needed : read special character from serial port