On Tue, Jun 02, 1998 at 07:48:17AM -0700, Andy Moskoff wrote:
>
> Hi:
>
> I'm writing some low level software and I need to do I/O to a memory-mapped
> register on a ISA card. I believe that inb/outb are fine for this, however,
> I can't find any detailed info on how to use them. Does anybody here know
> where I can find more detailed info? The man page has a reference to outb(9)
> but there is no man page there.
>
I don't know about inb and outb, but here's an excerpt from kbdrate.c
(which reprograms the keyboard hardware repeat rate) of how to read/write
such device registers:
if ( (fd = open( "/dev/port", O_RDWR )) < 0) {
perror( "Cannot open /dev/port" );
exit( 1 );
}
do {
lseek( fd, 0x64, 0 );
read( fd, &data, 1 );
} while ((data & 2) == 2 ); /* wait */
lseek( fd, 0x60, 0 );
data = 0xf3; /* set typematic rate */
write( fd, &data, 1 );
do {
lseek( fd, 0x64, 0 );
read( fd, &data, 1 );
} while ((data & 2) == 2 ); /* wait */
lseek( fd, 0x60, 0 );
sleep( 1 );
write( fd, &value, 1 );
close( fd );
I've not experimented with this much, don't know if you need to be root
to make this work, or not.
Good luck!
Fred
--
---- Fred Smith -- [EMAIL PROTECTED] ----------------------------
"And he will be called Wonderful Counselor, Mighty God, Everlasting Father,
Prince of Peace. Of the increase of his government there will be no end. He
will reign on David's throne and over his kingdom, establishing and upholding
it with justice and righteousness from that time on and forever."
------------------------------- Isaiah 9:7 (niv) ------------------------------
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject.