Re: Writing to i/o at a lower level
From: Alexandre Jasmin (alex.jasmin_at_sympatico.ca)
Date: 12/03/03
- Next message: Benjamin Wang: "How to get CPU utilization?"
- Previous message: Fletcher Glenn: "Re: Writing to i/o at a lower level"
- In reply to: Fletcher Glenn: "Re: Writing to i/o at a lower level"
- Next in thread: Andrew Falanga: "Re: Writing to i/o at a lower level"
- Reply: Andrew Falanga: "Re: Writing to i/o at a lower level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 03 Dec 2003 01:59:11 GMT
Le Wed, 03 Dec 2003 00:19:18 +0000, Fletcher Glenn a écrit :
>
>
> 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.
Just had a quick look at theses Linux functions.. They don't seam to
have anything to do with /dev files. They deal with numbered I/O ports on
the PC and would let you put bit directly on the parallel port registers.
I did that kind of stuff once in DOS and Qbasic but I doubt that would help
you much ;-)
Are you working on an electronic project Andrew.
- Next message: Benjamin Wang: "How to get CPU utilization?"
- Previous message: Fletcher Glenn: "Re: Writing to i/o at a lower level"
- In reply to: Fletcher Glenn: "Re: Writing to i/o at a lower level"
- Next in thread: Andrew Falanga: "Re: Writing to i/o at a lower level"
- Reply: Andrew Falanga: "Re: Writing to i/o at a lower level"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|