Configuring SCO OpenServer 5 MDI drivers

Accessing the I/O bus and the address bus

The UNIX I/O model generally uses kernel-level device drivers for all access to the hardware. User-level processes call these device drivers through system calls rather than directly accessing the PC 's I/O and address busses. However, acfg utilities are a special case and must be able to search the I/O and memory address space looking for hardware before the device driver has been linked into the UNIX kernel.

If the acfg needs access to the I/O bus, it must issue the sysi86( ) system call to enable I/O bus access. The system call is:

   #include <sys/sysi86.h>

sysi86(SI86V86, V86SC_IOPL, 0x3000)

A small piece of assembler code is linked into each acfg utility to provide function calls that use these instructions. The assembler module is given a name such as io.s; the sample source code for drivers that use an acfg utility include examples. The following functions are implemented:

int inb(int io_address)
Read byte from I/O bus (inb instruction)

outb(int io_address, int value)
Write byte to I/O bus (outb instruction)

For more information, see ``Programmed I/O (PIO)''

To access the memory address bus, the acfg should address the /dev/mem driver. To read from physical memory, open the device for reading, seek to the start address, and read the region into the user process from the file descriptor.

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005