sp200(7) —
NAME
sp200 − Spectre SP200 Display Controller driver
DESCRIPTION
The Spectre SP200 kernel driver facilitates accessing the Spectre SP200 board. It is a regular character-based driver that manages one SP200 board. It is used by programs that draw using the graphics modes of SP200.
CONFIGURATION
The sdevice(4) file /etc/conf/sdevice.d/sp200 describes the I/O port addresses and the memory addresses of the SP200 board. The seventh and eighth fields in this file describe the starting and ending input/output port addresses. The ninth and tenth fields in this file describe the starting and ending memory addresses. The length of memory must be either 16K or 32K. All of these fields are given in hexadecimal. The default sdevice file entry is:
sp200 Y 1 0 0 0 2b0 2bf d0000 d7fff
As an example, if you want to change the default sdevice to use I/O ports of 200-20f, and only 16K of memory from CC0000- CFFFFF, then the following sdevice file would be used:
sp200 Y 1 0 0 0 200 20f cc000 cffff
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 Spectre SP200 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. Only one user is allowed to open the SP200 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 34020 processor in the SP200. Seek addresses are specified in bytes. Because addresses on a 34020 processor are given in bits, it is necessary to divide the bit address by 8 to get a byte address. The state of the 34020 is not saved before each read and write and not restored when the read or write is completed. The kernel uses and does not restore segment 4, and the control register.
The following ioctl calls allow a user program to access the SP200 board directly:
SP200_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 sp200_info {
shortsp200_port;/* i/o port */
shortsp200_endport; /* i/o port */
char*sp200_addr;/* physical address */
char*sp200_endaddr; /* physical address */
} sp200_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.
SP200_MAP_BOARD
This ioctl allows the process to do in and out instructions at the I/O ports as well as allowing direct access to the memory specified in the sdevice file. The argument passed is the address of the memory to map to the SP200 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 memory allocated to the SP200 will be placed at those locations. The user must store values in the memory base registers to use the SP200 memory. One way of allocating the virtual memory in the user’s address space that will be mapped to the SP200 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.
SP200_UNMAP_BOARD
This ioctl call unmaps the direct access to the SP200 memory as well as preventing the process from doing in and out instructions at the I/O ports specified in the sdevice file. The map must have been set up with SP200_MAP_BOARD by the current process. The argument passed should be the same one given to SP200_MAP_BOARD. The memory where the SP200 memory had been becomes zeros.
FILES
/dev/sp200
SEE ALSO
Xsp200(1).
sdevice(4) in the INTERACTIVE SDS Guide and Programmer’s Reference Manual.
\*U — Version 1.0