Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cpqag(7) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Xcpqag(1)

sdevice(4)

cpqag(7)  —  

NAME

cpqag − COMPAQ AG1024 driver

DESCRIPTION

The COMPAQ AG1024 kernel driver facilitates accessing the COMPAQ AG1024 board.  It is a regular character-based driver that manages one AG1024 board.  It is used by programs that draw using the graphics modes of AG1024. 

CONFIGURATION

The sdevice(4) file /etc/conf/sdevice.d/cpqag describes the I/O port addresses as well as the shared memory addresses. The seventh and eighth fields in this file describe the starting and ending I/O port addresses.  The ninth and tenth fields in this file describe the starting and ending shared memory addresses.  The shared memory fields are not used for the Xcpqag server for X11.  All of these fields are given in hexadecimal.  The default sdevice file entry with an I/O base address of 0290h is:

cpqag   Y       1       0       0       0       290     29f     0       0

If you want to use an I/O base address of 0280h instead, then the following sdevice entry should be used:

cpqag   Y       1       0       0       0       280     28f     0       0

If you change the default sdevice entry, you will have to build a new kernel and boot it for these changes to become effective. 

PROGRAMMING INTERFACE

The COMPAQ AG1024 device is opened by a call to open. Currently, only minor device 0 is supported. If a non-zero minor device is specified, then an error will occur and errno will be set to ENOENT.  A simple check is done to see if the AG1024 board is in the system.  If it is not, an error will result and errno will be set to ENXIO.  An I/O address clash may also cause this error.  Only one user is allowed to open the AG1024 board at a time, unless the subsequent user is the superuser.  If a subsequent open is attempted by another user who is not the superuser, an error will result and errno will be set to EPERM. 

Read and write interfaces are provided to access the memory of the Texas Instruments 34010 processor in the AG1024.  Seek addresses are specified in bytes.  Because addresses on a 34010 processor are given in bits, it is necessary to divide the bit address by 8 to get a byte address.  The state of the 34010 is saved before each read and write, and it is restored when the read or write is completed. 

The following ioctl calls allow a user program to access the AG1024 board directly:

CPQAG_GET_INFO
This ioctl returns a structure containing the addresses of the board described in the section “Configuration” above.  The structure returned is:

typedef struct  cpqag_info  {
shortcpqag_port;/* i/o port */
shortcpqag_endport; /* i/o port */
char*cpqag_sram;/* physical address */
char*cpqag_endsram; /* physical address */
}   cpqag_info_t;

This structure is filled in with information in the seventh through tenth fields of the sdevice file.  It is stored at the location specified by the argument that is passed. 

CPQAG_MAP_BOARD
This ioctl allows the process to do in and out instructions at the I/O ports specified in the sdevice file.  The argument passed is unused. 

CPQAG_UNMAP_BOARD
This ioctl prevents the process from doing in and out instructions at the I/O ports specified in the sdevice file.  The argument passed is unused. 

CPQAG_MAP_SRAM
This ioctl allows the process to have direct access to the shared memory.  The argument passed is the address of the memory to map to the AG1024 board.  It must be page (4096 byte) aligned and span a length specified by the sdevice file (which is also a multiple of 4096 bytes).  The memory that had existed at the argument passed will be irretrievably deleted, and the current contents of the shared memory will be placed at those locations.  This assumes that the I/O ports describing the shared memory are set up ­properly.  One way of allocating the virtual memory in the user’s address space that will be mapped to the shared memory is to call malloc requesting (length + 4096) bytes.  Then, using the address that malloc returns, round it up to the next page (4K) boundary and use the result as the argument to this ioctl.

CPQAG_UNMAP_SRAM
This ioctl call unmaps the direct access to the shared memory.  The map must have been set up with CPQAG_MAP_SRAM by the current process.  The argument passed should be the same one given to CPQAG_MAP_SRAM.  The memory where the shared memory had been becomes zeros. 

FILES

/dev/cpqag

SEE ALSO

Xcpqag(1). 
sdevice(4) in the INTERACTIVE SDS Guide and Programmer’s Reference Manual.

\*U  —  Version 1.0

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