Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ grfx(7) — DG/UX 5.4.2A

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mmap(2)

ioctl(2)

valloc(3C)



grfx(7)                          DG/UX 5.4.2                         grfx(7)


NAME
       grfx - AViiON series workstation graphics processor

DESCRIPTION
       This device driver supports a monochrome or color graphics processor
       for the Data General AViiON series workstations.  The device is
       accessed using the standard open(2), close(2), mmap(2), and ioctl(2)
       system calls.  The AViiON series graphics processors are memory-
       mapped devices.  Data and commands to and from the graphics processor
       are placed directly into the device hardware control registers by
       mapping these registers into the user program logical address space.

       The open(2) system call provides a handle to access the graphics
       processor.  Multiple opens on the graphics device are allowed, but it
       is the application's responsibility to mediate access to the single
       device.

       The close(2) system call frees the handle to the graphics processor
       established by open(2).

       The mmap(2) system call can be used to map either the graphics
       processor control registers or the frame buffer into the caller's
       address space.  The device should be opened for reading and writing.
       Mmap(2) can then be called with its parameters set as follows:

       addr   Set to 0 unless the mapping is desired at a specific address.
              If a specific address is required, set addr to that (page
              aligned) address, and set MAPFIXED in the flags parameter.

       len    Set to the appropriate size for the registers or frame buffer
              to be mapped.  The size of the registers is
              usizeof (necregtype) for monochrome, or
              usizeof (cgaregtype) for color.  These structures are
              defined in the monochrome and color header files
              <sys/dggrfxmono.h> and <sys/dggrfxcolor.h>.  The size of
              the frame buffer is 512 kilobytes (0x00080000) for monochrome,
              1.5 megabytes (0x00180000) for monochrome with Kanji memory,
              or 128 megabytes (0x08000000) for color.

       prot   Set to (PROTREAD | PROTWRITE).

       flags  Set to MAPSHARED for the system to select the address for the
              mapping, or to (MAPFIXED | MAPSHARED) to map at address
              addr.

       fd     Set to the open file descriptor for the device.

       off    Set to GRFXREGSMMAPOFFSET to map the control registers, or
              to GRFXFBMMAPOFFSET to map the frame buffer for the
              graphics processor.  These constants are defined in
              <sys/ioctl.h>.

       Upon successful return from mmap(2), the return value indicates the
       address at which the control registers or frame buffer has been



Licensed material--property of copyright holder(s)                         1




grfx(7)                          DG/UX 5.4.2                         grfx(7)


       mapped.  This address can be cast to a pointer to the appropriate
       type, e.g., necregtype, for subsequent access to the mapped memory.

       The ioctl(2) system call has the following form:

            int ioctl (fildes, command, argument);
            int       fildes;
            int       command;
            int       argument;

       It can be used with the following commands:

       GRFXRESET         Resets the video timing on the graphics processor.

       GRFXVIDEOENABLE  Enables/disables (argument nonzero/zero) video
                          display.

       GRFXLOGERROR     Enables/disables (argument nonzero/zero) graphics
                          error logging (monochrome only).

       GRFXLOGCLIP      Enables/disables (argument nonzero/zero) logging
                          of clipped drawing operations (monochrome only).

       GRFXMAPREGS      Maps graphics processor control registers into
                          user memory pointed to by argument.

       GRFXMAPFB        Maps the frame buffer into user memory pointed to
                          by argument.

       GRFXUNMAPREGS    Unmaps graphics processor control registers
                          pointed to by argument.

       GRFXUNMAPFB      Unmaps frame buffer pointed to by argument.

       GRFXGETFBSIZES  Returns frame buffer configuration in the
                          grfxfbsizestype structure pointed to by
                          argument.

       Mapping the graphics control registers using ioctl(2) can be
       accomplished by first reserving one page of logical memory with
       valloc(3C).  The address returned by valloc(3C) must then be supplied
       as the argument to the GRFXMAPREGS ioctl command.  Upon return from
       the ioctl(2) system call, the graphics processor control registers
       may be referenced by casting the address supplied in argument to a
       pointer to a necregtype (monochrome) or a cgaregtype (color)
       structure.  These structures are defined in the monochrome and color
       header files <sys/dggrfxmono.h> and <sys/dggrfxcolor.h>.

       Graphics frame buffer memory may be mapped using ioctl(2) by first
       using valloc(3C) to reserve 512 kilobytes (0x00080000) for
       monochrome, 1.5 megabytes (0x00180000) for monochrome with Kanji
       memory, or 128 megabytes (0x08000000) for color.  The address
       returned by valloc(3C) must then be supplied as the argument to the
       GRFXMAPFB ioctl command.  Upon return from the ioctl(2) system



Licensed material--property of copyright holder(s)                         2




grfx(7)                          DG/UX 5.4.2                         grfx(7)


       call, the graphics frame buffer memory may be referenced beginning at
       the address supplied in argument.

FILES
       /dev/grfx
              grfx device node
       /usr/include/sys/ioctl.h
              graphics ioctl commands (see
              /usr/include/sys/intdggrfxioctl.h)
       /usr/include/sys/dggrfxmono.h
              monochrome graphics register, command and mask definitions
       /usr/include/sys/dggrfxcolor.h
              color graphics register, command and mask definitions

SEE ALSO
       mmap(2), ioctl(2), valloc(3C).

NOTE
       Mapping the video frame buffer via ioctl(2) is not recommended,
       because such access may require the system to have an unreasonably
       large swap area in order to successfully invoke valloc(3C) as
       required.  Use mmap(2) to map the frame buffer instead.



































Licensed material--property of copyright holder(s)                         3


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