xref: /csrg-svn/share/man/man4/man4.hp300/gb.4 (revision 47672)
1*47672Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
244676Sbostic.\" All rights reserved.
344676Sbostic.\"
444676Sbostic.\" This code is derived from software contributed to Berkeley by
544676Sbostic.\" the Systems Programming Group of the University of Utah Computer
644676Sbostic.\" Science Department.
744676Sbostic.\" %sccs.include.redist.man%
844676Sbostic.\"
9*47672Scael.\"     @(#)gb.4	5.2 (Berkeley) 03/27/91
1044676Sbostic.\"
11*47672Scael.Dd
12*47672Scael.Dt GB 4 hp300
13*47672Scael.Os
14*47672Scael.Sh NAME
15*47672Scael.Nm gb
16*47672Scael.Nd
17*47672Scael.Tn HP98700
18*47672Scael``Gatorbox'' device interface
19*47672Scael.Sh DESCRIPTION
20*47672ScaelThis driver is for the
21*47672Scael.Tn HP98700
22*47672Scaeland 98710 graphics devices, also known as
2344676Sbosticthe Gatorbox.  The term ``Gator'' will often be used, and it is not to be
24*47672Scaelconfused with ``Gator'' used in reference to an
25*47672Scael.Tn HP
26*47672Scael9837 or 200/237 machine.
2744676SbosticAlso, the term Gatorbox is used for the 98700 alone, with the 98701 frame
2844676Sbosticbuffer memory or with the 98710 accelerator installed.  This driver merely
2944676Sbosticchecks for the existence of the device and does minimal set up, as it is
3044676Sbosticexpected the applications will initialize the device to their requirements.
31*47672Scael.Pp
3244676SbosticThe 98700 can be used as the only graphics device on a system, in which case
3344676Sbosticit will be used as the system console.  It can also be installed as a secondary
34*47672Scaeldisplay device.  For the first case, the
35*47672Scael.Tn HP
36*47672Scael.Tn 98287A M.A.D.
37*47672Scaelinterface card
3844676Sbosticshould be set to internal control space.  This will put the frame buffer at
3944676Sbosticthe DIO address 0x200000 and the control registers at 0x560000.
4044676SbosticAt this address it will be the ``preferred'' console device (see
41*47672Scael.Xr cons 4 ) .
4244676SbosticFor use as a secondary device,
4344676Sbosticthe 98287A should be set to frame buffer address 0x300000,
4444676Sbosticand to an external select code.
45*47672Scael.Pp
4644676SbosticIt should be noted that this configuration will conflict with the 98547
4744676Sbosticdisplay card which has a 2 megabyte frame buffer starting at address 0x200000.
4844676SbosticThe 98700 should only be installed as a secondary device in a machine with a
4944676Sbostic1 bit 98544 display card or 4 bit 98545 card.
5044676SbosticThe
51*47672Scael.%T 98700H Installation Guide
5244676Sbosticcontains further configuration information.
53*47672Scael.Pp
5444676SbosticThe
55*47672Scael.Xr ioctl 2
56*47672Scaelcalls supported by the
57*47672Scael.Bx
58*47672Scaelsystem for the Gatorbox are:
59*47672Scael.Bl -tag -width indent
60*47672Scael.It Dv GRFIOCGINFO
6144676SbosticGet Graphics Info
62*47672Scael.Pp
6344676SbosticGet info about device, setting the entries in the
64*47672Scael.Em grfinfo
65*47672Scaelstructure, as defined in
66*47672Scael.Aq Pa hpdev/grfioctl.h .
6744676SbosticFor the standard 98700, the number of planes should be 4.  The number of
6844676Sbosticcolors would therefore be 15, excluding black.  With the 98701 option installed
6944676Sbosticthere will be another 4 planes for a total of 8, giving 255 colors.
70*47672Scael.It Dv GRFIOCON
7144676SbosticGraphics On
72*47672Scael.Pp
73*47672ScaelTurn graphics on by enabling
74*47672Scael.Tn CRT
75*47672Scaeloutput.  The screen will come on, displaying
7644676Sbosticwhatever is in the frame buffer, using whatever colormap is in place.
77*47672Scael.It Dv GRFIOCOFF
7844676SbosticGraphics Off
79*47672Scael.Pp
80*47672ScaelTurn graphics off by disabling output to the
81*47672Scael.Tn CRT .
82*47672ScaelThe frame buffer contents
8344676Sbosticare not affected.
84*47672Scael.It Dv GRFIOCMAP
8544676SbosticMap Device to user space
86*47672Scael.Pp
8744676SbosticMap in control registers and framebuffer space. Once the device file is
8844676Sbosticmapped, the frame buffer structure is accessible.
8944676SbosticThe frame buffer structure describing the 98700
90*47672Scaelis given in
91*47672Scael.Aq Pa hpdev/grf_gbreg.h .
92*47672Scael.It Dv GRFIOCUNMAP
9344676SbosticUnmap Device
94*47672Scael.Pp
9544676SbosticUnmap control registers and framebuffer space.
96*47672Scael.Pp
9744676SbosticFor further information about the use of ioctl see the man page.
98*47672Scael.El
99*47672Scael.Sh EXAMPLE
10044676SbosticA small example of opening, mapping and using the device is given below.
10144676SbosticFor more examples of the details on the behavior of the device, see the device
10244676Sbosticdependent source files for the X Window System, in the
103*47672Scael.Pa /usr/src/new/X/libhp.fb
10444676Sbosticdirectory.
105*47672Scael.Bd -literal -offset indent
106*47672Scaelstruct gboxfb *gbox;
107*47672Scaelu_char *Addr, frame_buffer;
108*47672Scaelstruct grfinfo gi;
109*47672Scaelint disp_fd;
11044676Sbostic
111*47672Scaeldisp_fd = open("/dev/grf0",1);
11244676Sbostic
113*47672Scaelif (ioctl (disp_fd, GRFIOCGINFO, &gi) < 0) return -1;
11444676Sbostic
115*47672Scael(void) ioctl (disp_fd, GRFIOCON, 0);
11644676Sbostic
117*47672ScaelAddr = (u_char *) 0;
118*47672Scaelif (ioctl (disp_fd, GRFIOCMAP, &Addr) < 0) {
119*47672Scael(void) ioctl (disp_fd, GRFIOCOFF, 0);
120*47672Scaelreturn -1;
12144676Sbostic}
122*47672Scaelgbox = (gboxfb *) Addr;                         /* Control Registers   */
123*47672Scaelframe_buffer = (u_char *) Addr + gi.gd_regsize; /* Frame buffer memory */
124*47672Scael.Ed
125*47672Scael.Sh FILES
126*47672Scael.Bl -tag -width /dev/crt98700 -compact
127*47672Scael.It Pa /dev/grf?
128*47672Scael.Bx
129*47672Scaelspecial file
130*47672Scael.It Pa /dev/crt98700
131*47672Scael.Tn HP-UX
132*47672Scael.Em starbase
133*47672Scaelspecial file
134*47672Scael.El
135*47672Scael.Sh DIAGNOSTICS
136*47672ScaelNone under
137*47672Scael.Bx .
138*47672Scael.Tn HP-UX
139*47672ScaelThe
140*47672Scael.Tn CE.utilities/Crtadjust
141*47672Scaelprograms must be used.
142*47672Scael.Sh ERRORS
143*47672Scael.Bl -tag -width [EINVAL]
144*47672Scael.It Bq Er ENODEV
14544676Sbosticno such device.
146*47672Scael.It Bq Er EBUSY
14744676SbosticAnother process has the device open.
148*47672Scael.It Bq Er EINVAL
14944676SbosticInvalid ioctl specification.
150*47672Scael.El
151*47672Scael.Sh SEE ALSO
152*47672Scael.Xr ioctl 2 ,
153*47672Scael.Xr grf 4
154*47672Scael.Sh HISTORY
155*47672ScaelThe
156*47672Scael.Nm
157*47672Scaeldriver
158*47672Scael.Ud
159