Re: Writing to i/o at a lower level
From: Fletcher Glenn (fletcher_at_removethisfoglight.com)
Date: 12/03/03
- Next message: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Previous message: David Schwartz: "Re: Newbie TCP/IP Socket Question"
- In reply to: Andrew Falanga: "Writing to i/o at a lower level"
- Next in thread: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Reply: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Previous message: David Schwartz: "Re: Newbie TCP/IP Socket Question"
- In reply to: Andrew Falanga: "Writing to i/o at a lower level"
- Next in thread: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Reply: Alexandre Jasmin: "Re: Writing to i/o at a lower level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|