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