GRAPHICS(7)
Series 200 and 300 Only
NAME
CRT graphics − information for CRT graphics devices
Remarks:
This information is valid for Series 200 and 300 only.
DESCRIPTION
CRT graphics devices are frame-buffer based raster displays. These devices use memory-mapped I/O to obtain much higher performance than is possible with tty-based graphics terminals. CRT graphics devices should only be accessed through the STARBASE libraries. They cannot be piped or redirected to because they are not serial devices.
Special (device) files for CRT graphics devices are character special files with major number 12.
The minor number for CRT graphics devices is of the form:
0xSSTTXX
where SS is a one-byte select code number, TT is a one-byte type specifier, and XX is zero or contains device-specific information as defined in the appropriate Starbase Device Driver manual.
The type field in the minor number is defined as follows:
0 auto-configures to one of the following:
a) low resolution graphics device at physical address 0x520000 (if present).
b) high resolution graphics device at physical address 0x560000 if low resolution device at 0x520000 not present.
1 high resolution graphics device at physical address 0x560000 (unless there is no low resolution device at 0x520000, in which case type 1 is invalid).
2 high or low resolution graphics device at the select code specified by the select code field in the minor number.
Communication with a CRT graphics device is begun with an open system call. Multiple processes may concurrently have the graphics device open.
Close shuts down the file descriptor associated with the graphics device. If the close is for the last system wide open on the device then the graphics device is also unmapped from the user address space; otherwise it is left mapped into the user address space (see GCUNMAP below).
Read and write system calls are undefined and will always return ENXIO.
Ioctl is used to control the graphics device. The valid ioctl commands (see <sys/graphics.h> ) are:
GCID Return the identity of the CRT graphics device. Possible identities are:
1 = 98204A
2 = 9826A
3 = 9836A
4 = 9836C
5 = 98627A
6 = 98204B
7 = 9837
8 = 98700
9 = hp9000s300 displays
10 = 98720
GCON, GCOFF Turn graphics "on" or "off". May be a no-op for some devices.
GCAON, GCAOFF turn alpha "on" or "off". May be a no-op for some devices.
GCMAP map the CRT graphics device into the user address space at the address specified in the ioctl argument. The argument is ’char **arg’. The value *arg is used as a requested address. The actual mapping address is then returned in *arg. If *arg is 0 then the system selects the first available address (see GCLOCK/GCUNLOCK below).
GCUNMAP remove the mapping of the CRT graphics device from the user address space.
GCLOCK ensure exclusive use of the CRT graphics device.
GCUNLOCK relinquish exclusive use of the CRT graphics device.
For all frame buffers the data bytes scan from left to right and from top to bottom. Some displays map in control areas which must be skipped over to reach the frame buffer. Some devices map individual bits to pixels, (dots on the screen.) Some map bytes or parts of bytes to pixels. Lsb stands for least significant bit; msb stands for most significant bit.
HP 98204A There are 300 lines of 100 bytes each. Only the odd numbered bytes are used. There is a one bit per pixel, with msb left, and lsb right.
HP 98204B There are 390 lines of 64 bytes each. There is a one bit per pixel, with msb left, and lsb right.
HP 98627A Starting 0x8000 bytes from the base address, there are 3 buffers of 0x8000 bytes each. The 3 buffers are the data for red, green, and blue. There is one bit per pixel, with msb left, and lsb right. There are 64 bytes per line. The number of lines depends on the setting of control registers.
Model 237 Starting 0x10000 bytes from the base address, there are 768 lines of 1024 bytes each. There is one pixel per byte. The lsb of each byte corresponds to a pixel.
HP 98700 Starting 0x10000 bytes from the base address, there are 768 lines of 1024 bytes each. There is one pixel per byte. Each byte corresponds to the color map index of a pixel.
HP 98720 Starting 0x20000 bytes from the base address, there are 1024 lines of 2048 bytes each (1280 bytes by 1024 lines are displayable); one pixel per byte.
Series 300 Displays:
These displays have registers describing the display size. The following code computes frame buffer width and height and determines what portion of the frame buffer is being displayed:
/* unsigned char *base = <base address for display mapping>; */
buffer_width = (base[5] << 8) + base[7];
buffer_height = (base[9] << 8) + base[11];
displayed_width = (base[13] << 8) + base[15];
displayed_height = (base[17] << 8) + base[19];
not_square = ((base[23] & 1) == 1);
Starting 0x10000 bytes from the base address, there are <buffer_height> lines of <buffer_width> bytes each. There is one pixel per byte. Each byte corresponds to the color map index of a pixel. On a monochrome display, the byte value is either 0, (black), or 1 (white). If ((base[23] & 1) == 1) then pixels are twice as high as they are wide, and may be used in pairs to produce square double pixels.
One shared memory descriptor (see shmget(2)) is used for each graphics device. Each shared memory descriptor is accessible only through its graphics interface. Thus, any attempt to access them through shmat(2)), shmctl(2)), shmdt(2)), etc. results in EACCESS errors.
ERRORS
[ENXIO] no such device or read/write not supported.
[ENOSPC] cannot allocate required resources for mapping.
[ENOMEM] cannot allocate sufficient memory for mapping.
[ENOTTY] bad ioctl command, or an ioctl was attempted on an open file.
SEE ALSO
Hewlett-Packard Company — May 11, 2021