Home
Developer Resources

crttrap

PDF Documents
Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

crttrap

Detect video hardware and start the correct driver

Syntax:

crttrap  [-b bits] [-c config_file] [-gx,y]
         [-V] [-VV] [-wt trap_opt]
         command

Runs on:

Neutrino

Options:

-b bits
Choose mode by the number of bits per pixel. This is usually done when trapping video modes to change the default trapped mode.
-c config_file
Specify the name of the trap configuration file. This file contains the io-graphics command lines needed to start various drivers.

The default file name is graphics-modes. The crttrap utility adds the path prefix /etc/system/config/ to this file name (also see the path prefix extension for networks in the Description section).

-gx,y
Choose mode by resolution. This is usually done when trapping video modes to change the default trapped mode.
-V
Be verbose.
-VV
Be very verbose and pass on the -V option to the trapper programs that are started.
-wt trap_opt
Pass option to trapper.
command
Start the probe with one of these commands:
  • clear -- Remove the current trap configuration file (the default is /etc/system/config/graphics-modes).
  • dump -- Print the contents of the trap configuration file (default /etc/system/config/graphics-modes).
  • query -- Print the command line that would be executed by start.
  • start -- Execute the first line of the trap configuration file (default /etc/system/config/graphics-modes) to start the modeswitcher and a photon graphics driver.
  • trap -- detect the graphics card and create the trap configuration file (default /etc/system/config/graphics-modes).

Caution: If you change your video hardware, run crttrap clear to remove your current configuration file. If you don't, your video driver may fail.

Description:

The crttrap utility has several options enabling you to manipulate the configuration information for your video hardware. Its main purpose is to detect the video hardware and modes you can use in your system and store the command lines needed to start your graphics drivers in a configuration file.


Note: This utility needs to have the setuid ("set user ID") bit set in its permissions. If you use mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use the perms attribute to specify its permissions explicitly, and the uid and gid attributes to set the ownership correctly.

The utility can also be used to start the video driver and mode that has been automatically selected as the most appropriate for your system. The phgrafx utility refers to the configuration file when offering you available alternative video configuration choices.

Here's how crttrap works:

The enum-devices manager processes the file /etc/system/enum/devices/graphics to enumerate the graphics devices present on your computer. Using the enumeration information as a basis, enum-devices puts together the command lines that devgt-iographics will use to detect the video modes available on these devices. These command lines are stored in /etc/system/config/graphics-traplist.

When you run crttrap, it starts devgt-iographics and then combines the enumerated device data with the detected mode information to create command lines that io-graphics can use to start your graphics drivers in the modes you select.

The crttrap utility stores the resulting command lines in a trap configuration file named graphics-modes; the path of this file depends on whether your computer is on a network or not:

When you run crttrap with the start or trap commands, crttrap looks for /etc/system/config/crtc-settings. If it doesn't find this file, it copies the default file from /usr/photon/config/ into /etc/system/config.

The crtc-settings file contains monitor timing information used to adjust the centering, sizing, etc. of the display. The default crtc-settings file contains the VESA discrete monitor timings.

Examples:

Detect the modes available for the graphics devices in your system and generate the appropriate command lines in graphics-modes:

crttrap trap

Execute the first line of graphics-modes to start the modeswitcher and the corresponding graphics driver:

crttrap start

Print the command line that would be executed by crttrap start:

crttrap query

Print the contents of the graphics-modes file:

crttrap dump

Delete the current graphics-modes file:

crttrap clear

See also:

devgt-iographics, io-graphics, phgrafx

Connecting Hardware in the Neutrino User's Guide