For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2005 > Re: Need sample C code for access I/O ports









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Need sample C code for access I/O ports
Floyd L. Davidson

2005-08-25, 9:56 pm

Henrik Carlqvist <Henrik.Carlqvist@deadspam.com> wrote:
>Steven Woody <anti-spam.narkewoody@gmail.com.dont-post-to> wrote:

Yes, that should do just fine for writing a board configuration
program. This isn't something that will be used except for the
one time you install and configure the board.
[color=darkred]
>Yes, you can probably write a program using ioperm and outb to change
>those settings. But then what? If you from user space change the IRQ
>and/or address of a serial port the kernel is going to be if it
>before thought that the port should have other values. Maybe you could fix
>this with the program setserial.


That is exactly the same as if the board had hardware jumpers to
set the port addresses and IRQ's. In either case the kernel
(driver) doesn't really know what they are, and if it isn't the
default it has to be set. I'm not sure what the approved way to
do that is today, but /setserial/ should work.

However, I would expect that the best way would be to load the
driver with the appropriate command line options, assuming the
driver for that board does in fact have such facilities. In any
case, reading the docs on the driver being used would be
essential.

--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@apaflo.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com