DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

inb(D3oddi)


inb, outb -- read a byte from or write a byte to a physical I/O address

Synopsis

int inb(int read_addr);

void outb(int write_addr, char value);

Description

The inb( ) function reads a byte from the specified I/O address.

The outb( ) function writes the specified byte to the specified physical I/O address.

Arguments


read_addr
an integer specifying the physical I/O address from which to read.

write_addr
an integer specifying the physical I/O address to which to write.

value
byte to be written

Return values

inb( ) returns an integer in which the least significant byte is the value read from the read address read_addr and the three most significant bytes are zero (0).

outb( ) has no return value.

Usage

Context and synchronization

All contexts.

Hardware applicability

All Intel IA-32 compatible platforms

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

The inb(D3) and outb(D3) functions are essentially the same functions for SVR5 DDI drivers, although note that the casting of the function and arguments is different.

DOS systems often issue these functions from user-level code. ``Porting DOS inb and outb functionality'' in HDK Technical Reference provides information about how to port such code to SCO OpenServer systems.

References

ind(D3oddi), inw(D3oddi), repinsb(D3oddi)

``Porting DOS inb and outb functionality'' in HDK Technical Reference

Examples

The following code reads a byte register at I/O address 0x300:
   unsigned char val;
   val = (unsigned char) inb(0x300);
The next segment writes the 8-bit value 0xF to a byte register at I/O address 0x300:
   outb(0x300, (char)0xF);

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005