home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 23278 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!psinntp!cadkey!erics
  3. From: erics@cadkey.com (Eric Smith)
  4. Subject: Re: Accessing IRQ/IO instructions under Linux.
  5. Message-ID: <1993Jan8.191531.12785@cadkey.com>
  6. Organization: cadkey
  7. References: <1993Jan3.210918.25893@ifi.uio.no> <1993Jan7.203354.22647@gkminix.han.de>
  8. Date: Fri, 8 Jan 1993 19:15:31 GMT
  9. Lines: 28
  10.  
  11. In article <1993Jan7.203354.22647@gkminix.han.de> gero@gkminix.han.de (Gero Kuhlmann) writes:
  12. >Rune Fr|ysa (runefr@ifi.uio.no) wrote:
  13. >> Since Linux is (fortunately) running under protected mode, I have
  14. >> some difficulties determining how to use my MPU-401 MIDI interface.
  15. >> Under DOS, i would redirect IRQ 3 (or 9, or .. have forgot the 
  16. >> number) to an interrupt routine of my own.
  17. >> Well, I can get my program work without this IRQ help, but I also
  18. >> need access to port 330h and 331h. In DOS, a simple IO instuction
  19. >> would be sufficient, but in Linux, I guess that I have to tell the
  20. >> kernel to do this. 
  21. >
  22. >There is a device called /dev/port. After opening the device you have to
  23. >position the file pointer at the byte offset corresponding to your port
  24. >address. Then you can read or write successive bytes. I never tried it
  25. >by myself. If you should have any problems with this have a look at
  26. >/usr/src/linux/kernel/chr_drv/mem.c
  27.  
  28. Another way to do this is to setuid to root, then execute ioperm().
  29. ioperm takes the base port number, the number of ports, and a flag
  30. telling the kernel to turn on access to the ports.
  31.  
  32. Eric.
  33.  
  34. -- 
  35. Eric V. Smith         | Technology ... the knack of arranging the
  36. Cadkey, Inc.          |   world so that we need not experience it.
  37. Windsor, CT           |
  38.                       |     - Max Frisch
  39.