Re: Writing to i/o at a lower level

From: Fletcher Glenn (fletcher_at_removethisfoglight.com)
Date: 12/03/03


Date: Wed, 03 Dec 2003 00:19:18 GMT


Andrew Falanga wrote:
> Hello,
>
> Sorry for the earlier posting. I was able to get some help from a
> knowledgable person here. I wasn't setting my file to setuid, and I
> didn't have it owned by root. That problem is now taken care of.
>
> I'm wondering now about writing data to an I/O port, but at a lower
> level than say, cat <somefile> > /dev/parallel. I'm writing a C
> program to write to the parallel/serial devices at this level. The
> Linux HOWTO I referenced earlier (in earlier posting) specifies using
> ioperm()/iopl() to gain access to the io device, and then using
> outb()/inb() macros for character io.
>
> I'm using these things as spelled out in the HOWTO, but nothing
> appears to be happening. What are some things to look for?
>
> Thanks,
> Andy

Most I/O devices are owned by the device driver. This is certainly
true for anything in /dev, and you can only do to a device what the
driver will let you do. Now for the most part, unless the driver
supports a "raw" mode, you cannot do bytewise I/O. Even so, you cannot
normally directly access a device's hardware ports unless you are
running in kernel mode, something that an ordinary user (including
root) cannot do. The main difficulty (if the device is memory
mapped) is that you cannot manipulate the memory address translation map
from userland.

--
Fletcher Glenn


Relevant Pages

  • Re: FC4 crashes repeatedly on dual dual-core Opteron Supermicro AS1020A-T
    ... doing I/O in memory). ... No success. ... Once the driver is in memory, even if it's not being used, ...
    (Fedora)
  • [PATCH 19-rc1] Fix typos in /Documentation : U-Z
    ... when the underlying device was capable of handling the i/o in one shot. ... using dev->irq by the device driver to request for interrupt service ... The EMU10K2 chips have a DSP part which can be programmed to support ... -(This acticle does not deal with the overall functionality of the ...
    (Linux-Kernel)
  • Re: [PATCH 19-rc1] Fix typos in /Documentation : U-Z
    ... +iii.Ability to represent large i/os w/o unnecessarily breaking them up (i.e ... when the underlying device was capable of handling the i/o in one shot. ... using dev->irq by the device driver to request for interrupt service ... -(This acticle does not deal with the overall functionality of the ...
    (Linux-Kernel)
  • [PATCH 18-rc3] Fix typos in /Documentation : S
    ... Request flows seen by I/O schedulers ... cpufreq-stats is a driver that provices CPU frequency statistics for each CPU. ... +interface will appear in a separate directory under cpufreq ... This drives supports all SMC ISA/MCA adapters. ...
    (Linux-Kernel)
  • Re: Does anyone remember IAS?
    ... interesting from an I/O point of view in that every driver was also ... and the RSX11D and IAS privilege sets prefigured the ... I wrote the driver ...
    (comp.os.vms)

Loading