Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ iomap(7) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mknod(1M)

IOMAP(7)

Series 200/300 Only

NAME

iomap − physical address mapping

Remarks:

This information is valid for Series 200 and 300 only. 

DESCRIPTION

The iomap mechanism allows the mapping (thus direct access) of physical addresses into the user process address space.   For Series 200 and Series 300 Models 310 and 320 computers, the physical address space begins at 0x000000 and extends to 0xffffff. 

The special (device) files for iomap devices are character special files with major number 10. 

The minor number for iomap devices is of the form:

          0xAAAANN

where AAAA is a two-byte address, and NN is a one-byte field. 

The address portion of the minor number is formed by dividing the physical address by 65536.  NN*65536 is the size of the region to be mapped.  For example, the minor number for a device at 0x720000 and 128k in size is 0x007202. 

Access to the iomap devices is controlled by the file permissions set on the character special file. 

Multiple processes may concurrently have iomap devices opened and mapped.  It is the responsibility of the processes to synchronize their accesses. 

Read and write system calls are not supported. 

Ioctl is used to control the iomap device.  The valid ioctl commands (see <iomap.h> ) are:

     IOMAPMAP
map the iomap device into user address space at the location specified in the ioctl argument.  If the user address specified in the ioctl argument is 0, the system selects an appropriate address.  The ioctl then returns the user address where the device was mapped, storing it in the original ioctl argument (see EXAMPLES below).  Multiple processes may concurrently have the iomap device mapped. 

     IOMAPUNMAP
unmap the iomap device from the user address space.

Close shuts down the file descriptor associated with the iomap device.  If the close is for the last system wide open on the device then the iomap device is also unmapped from the user address space; otherwise it is left mapped into the user address space (see IOMAPUNMAP above). 

One shared memory descriptor (see shmget(2)) is used for each iomap device.  Shared memory descriptors are accessible only through the iomap interface.  Consequently, attempts to access them through shmat(2), shmctl(2), shmdt(2), etc. result in EACCESS errors. 

WARNING

Iomap devices should be created and used with extreme caution.  Inappropriate accesses to io devices or ram may result in a system crash. 

ERRORS

[ENINVAL] address field out of range, ioctl command invalid. 

[ENOMEM] cannot allocate required memory for mapping. 

[ENODEV] read/write unsupported. 

[ENXIO] no such address. 

[ENOSPC] cannot allocate required resources for mapping. 

[ENOTTY] bad ioctl command, or an ioctl was attempted on an open file. 

EXAMPLES

Consider the following code fragment:

        #include <iomap.h>
        ...
        int fildes;
        char* addr;
            addr=REQUESTED_ADDRESS;
            ioctl(fildes,IOMAPMAP,&addr);
            printf("actual address=0x%x/n,addr);

where fildes is the device special file descriptor and addr is a pointer to a character variable. 

If addr is zero, the system selects a suitable address then returns the selected address, in addr. 

If the value in addr is non-zero, it is used as a specified address for allocating memory.  If the specified address cannot be used, an error is returned (see ERRORS). 

SEE ALSO

mknod(1M). 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026