WMSTART(1)
Series 300 Implementation
NAME
wmstart − start the window system on one display
SYNOPSIS
wmstart [optional_args]
DESCRIPTION
This command initiates the window system for one display, normally the one from which it is invoked. First it sets environment variables as needed (see below). It does not change your $PATH variable or your current working directory. It checks that no window manager is currently running using the directory specified by environment variable $WMDIR. If the variable is not null, i.e. the window special files directory is not the current directory, and it is also not set to “/” or /dev, it attempts to remove any character special files found in or below the specified directory.
wmstart starts the window system, which blocks input to (but not output from) the internal terminal emulator (ITE). The window manager (wm) process is started and, if no argument is specified to wmstart, it calls wsh(1) to create an initial window (named wconsole) with a shell attached.
wmstart , is a shell script that normally resides in /usr/bin. You can study and modify wmstart if so desired. Personal copies of it can be tailored to the specific hardware being used. Desired applications or window commands can be initiated after the window system is up.
Note: If you customize wmstart, change a copy, not the original script, so your changes are not lost at the time of system software update. Then execute your copy to start the window system.
The wmstart process does not terminate until operation of the window system is terminated. Thus the caller (e.g., init(1M) or sh(1)) can wait for it to terminate. See below for examples.
Environment Variables
wmstart sets necessary environment variables to default values if undefined or null. Only those are set which must be defined for wm or the window commands to work properly. Those already in the environment are not altered (except for $TERM), so you can pass in values from outside the window system. Note that you can (in sh(1)) set them on the command line which calls wmstart, for example:
WMDIR=/dev/screen1 wmstart
In particular, the $WMDRIVER variable tells the window system what type of display you have. If it is undefined or null, wm (not wmstart) sets it automatically to the right type. If you set it explicitly to the wrong type, you may get strange results.
Here is the complete list of variables. For each variable, the default value (if any) set up by wmstart is indicated along with the default value that the window system uses if the variable is undefined or null.
WMDIR
Directory where window device files are put by the window manager. Default: set to /dev/screen. Typical values might be: /dev/screen1, /dev/screen2, etc. If wm is called with it undefined or null, "$WMDIR/" is never prepended to a window_spec. See windows(1) for more on window_specs.
WMSCRN
Device file of the physical display where windows appear. Default: not set by wmstart; if undefined, wm uses /dev/crt. Typical values might be: /dev/crt9837, /dev/crt98700, etc.
WMDRIVER
Starbase driver used to write to the display when windows is running. Default: not set by wmstart. If this variable is undefined, then wm uses the appropriate driver for the window system running on your display. For example, on Series 300 low- or medium-resolution displays, wm uses "hp300l" for the driver.
SB_DISPLAY_ADDR
Memory address in the user address space of the Starbase display device. Default: not set by wmstart; if undefined, wm uses "0xb00000". Since this is normally a global entity, it should be set and exported from /etc/profile and /etc/csh.login. Should different instances of the variable have different values, unpredictable errors may occur.
WMKBD
Device file of the keyboard. Default: set to /dev/hilkbd. If wm is called with it undefined or null, keyboard input is disabled.
WMINPUTCTLR
Device file of the input controller. Default: set to /dev/rhil. If wm is called with it undefined or null, keyboard input is disabled.
WMLOCATOR
Device file of the locator. Default: set to /dev/locator. If wm is called with it undefined or null, locator input is disabled.
WMLOCSCALE
Normally, when the graphics tablet is used as a locator device, the entire graphics tablet maps to the entire screen. By setting this variable, you can map a rectangular area on the graphics tablet to the entire screen−i.e., you can specify that only part of the graphics tablet map to the display screen. This variable requires four coordinates and is set as follows:
WMLOCSCALE="x1 y1 x2 y2"
where x1,y1 are coordinates on the graphics tablet that coorespond to the lower-left corner of the display screen; x2,y2 coorespond to the upper-right corner of the screen.
Coordinates can be specified as either absolute or percentage. Absolute coordinates require knowledge of the graphics tablet resolution; percentage coordinates do not.
Absolute coordinates give an absolute address on the graphics tablet; percentage coordinates give a location with respect to the entire tablet and have a trailing percent sign.
Absolute and percentage coordinates can be mixed. For example, the following causes the display screen to map to the lower-left quadrant of the graphics tablet:
WMLOCSCALE="0 0 50% 50%"
WMPTYMDIR
Directory where master pseudo-tty (pty) special files are located. Default: not set by wmstart; if undefined, wm uses /dev/ptym.
WMPTYSDIR
Directory where slave pseudo-tty (pty) special files (generic window names) are located. Default: not set by wmstart; if undefined, wm uses /dev/pty.
WMPTYNAME
Starting name of the set of pseudo-ttys (ptys) used for windows. Must follow the pty naming convention: tty[p-v][0-f]. Default: not set by wmstart; if undefined, wm uses "ttyp8".
WMPTYCNT
Number of contiguous pseudo-ttys (ptys) used by the window manager. Default: not set by wmstart; if undefined, wm uses "31". Note: The number of open files allowed per process sets an upper limit on this value. Each graphics window type requires one pty and each Term0 window type requires three ptys.
WMPTYCACHECNT
Maximum number of pseudo-ttys (ptys) that the window manager is permitted to keep pre-opened for performance purposes, and thus unusable by other applications. Default: not set by wmstart; if undefined, wm uses "10". Note: This pty cache applies only for graphics window types or two of the three ptys used by Term0 window types.
WMSHMSPC
Maximum size of shared memory used by window manager. Increments of 0x1000 are strongly recommended. Default: set to "0x200000". Minimum size is 0x20000 even if set to a smaller value.
WMIATIMEOUT
The purpose of this variable is two-fold:
1. It specifies the timeout period (in seconds) for interactive operations, and
2. It determines the number of milliseconds the window manager will not process locator changes. This allows other processes to run when the window manager is tracking.
Specifying Timeout
The two least-significant bytes of this variable (0xFFFF) specify the number of seconds of absolute inactivity in the locator that the window manager will allow during an interactive operation.
If this value is not set, or is less than or equal to zero or null, then it defaults to 60 seconds.
Tracking
The window manager reads information from the locator whenever its position changes; this is known as tracking. If the position changes a lot, the window manager (because it is a high-priority process) may nearly consume the CPU, thereby preventing other processes from running. If one or more of the other processes is also trying to track locator movement, then their tracking becomes jerky or stops. To more fairly allow other processes to run, the window manager temporarily ignores the locator for a short period of time, thus allowing the other processes to run.
You can control the length of time that the window manager ignores locator information during tracking. Valid values range anywhere from 0 to 255 milliseconds. Values are specified in the third byte of this environment variable (0xFF0000).
If no value is specified or 0 is specified, it defaults to 30 milliseconds.
Values from 1 to 254 can be used. Keep in mind: (1) as this number becomes lower, the echo tracks better on the screen, but user processes can’t track as well; (2) as this number becomes higher, the echo tracks worse on the screen, but user processes track the locator as least as well as the window manager.
Note that although time can be specified in one-millisecond increments, the Series 200/300 clock "clicks" every twenty milliseconds. Therefore, you might want to specify time in 20-millisecond increments on Series 200/300.
If the value is 255, then locator information is not ignored.
WMCONFIG
Window manager configuration, the OR of:
0x07 Enable window manager process locking: 0x0 default is for no locking, 0x1 is text only, 0x2 is data only, and 0x4 is shared memory locking. Any combination of the three bits is allowed. This can be used when lots of physical memory is present, the window system is competing with very large processes, and snappy window system performance is still desired. If shared memory locking is enabled, setting WMSHMSPC to the minimum value needed is advisable.
0x08 Enable clear of graphics retained raster unconditionally upon create of a graphics window. The default of 0 is much faster because the clear is delayed until the window is made visible or graphics is done in the window. This enable is for compatibility purposes in the case of programs that meet all of the following: linked prior to 5.2 HP-UX, drawing in a concealed window that the same program did not create, and depend on the window being cleared prior to any gopen.
0x10 Enable double buffering color mode. This causes all colors used in window borders, window icons, softkeys, desktop, popup menus, and term0 window text to be modified so that the visible color for these will not change whenever the display-enabled planes are modified by a Starbase program using double buffering. All colors written to the display are first converted to (C << (N/2) + C), where C is the color being written and N is the number of planes on the display. The window manager will modify the color map so that color indices (C << (N/2)) and (C << (N/2) + C) have the same RGB values as color index C.
Enabling double buffering color mode reduces the effective number of colors from 2^N to 2^(N/2). The window system will force all colors set via environment variables to be within the allowed range.
Double buffering color mode may only be enabled on color displays, i.e. displays with at least two planes.
Default: not set by wmstart; if undefined, wm uses "0x00", i.e. don’t lock the window manager process or shared memory, allow higher performance delayed clear of graphics windows upon create, and don’t enable double buffering color mode.
WMIUICONFIG
Interactive user interface configuration, the OR of:
0x00007f Enabled buttons; button 1 is least significant bit.
0x000080 Enable Select key.
0x000100 Top if select over window.
0x000200 Top if going icon/normal.
0x000400 Top if unobscured move/size.
0x000800 Top if obscured move/size.
0x001000 Disable move manipulation symbol.
0x002000 Disable icon/normal manipulation symbol.
0x004000 Disable size manipulation symbol.
0x008000 Disable pause/resume manipulation symbol.
0x010000 Disable pan manipulation symbols.
0x020000 Disable popup menu in border.
0x040000 Disable popup menu over desk top.
0x080000 De-select if going to icon.
0x100000 Icon default position base: 0 == lower left; 1 == upper right.
0x200000 Disable tiler alignment by interactive operations.
0x400000 If set, it lets the sprite (echo) move outside the menu without aborting the pop-up menu operation.
0x800000 If set, interactively changing a window from an icon to normal representation will automatically select the window.
0x1000000 If set, disables the cache of a pop-up window create.
0x2000000 If set, serializes the pop-up window creates so that you cannot do two or more creates simultaneously.
0x4000000 If set, disables audio feedback that an interactive operation was somehow aborted.
0x8000000 If set, reverses the sense of the border arrows for graphics windows whenever the scroll bars are set to pan mode. The sense of the border arrows for term0 windows is also reversed.
Default: not set by wmstart; if undefined, wm uses "0x80781", i.e. button 1 (left mouse button), Select key, top if select over window, top if going icon/normal, top if unobscured move/size, and de-select if going to icon.
WMRTPRIORITY
Real time priority for window manager and servers. First byte is real time priority for window manager, second byte for servers. Range for each is 0 (highest) to 127 (lowest). If out of range, real time priority is disabled. Default: not set by wmstart; if undefined, wm uses "0x787c", i.e. 120 for window manager, 124 for servers.
WMDESKPTRN
Dither pattern for desktop; value ranges from 0 to 100. Significant values are 0, 25, 50, 75 and 100; given value is rounded to nearest significant value. Zero means desktop is solid in the desk background color; 100 means solid in the desk foreground color. Default: not set by wmstart; if undefined, wm uses "50".
WMDESKFGCLR
Foreground color for the desk top. Default: not set by wmstart; if undefined, wm uses "0" (black, unless the color map is changed). If out of range for device, forced within range.
WMDESKBGCLR
Background color for the desk top. Default: not set by wmstart; if undefined, wm uses "1" (white, unless the color map is changed). If out of range for device, forced within range. Note: If $WMDESKBGCLR == $WMDESKFGCLR, $WMDESKBGCLR is treated if set to the complement of the least significant bit of the foreground color, i.e. black or white unless the color map is changed.
WMBDRFGCLR
Initial foreground color for window borders. Default: not set by wmstart; if undefined, wm uses $WMDESKFGCLR. If out of range for device, forced within range.
WMBDRBGCLR
Initial foreground color for window borders. Default: not set by wmstart; if undefined, wm uses $WMDESKBGCLR. If out of range for device, forced within range. Note: If $WMBDRBGCLR == $WMBDRFGCLR, $WMBDRBGCLR is treated if set to the complement of the least significant bit of the foreground color, i.e. black or white unless the color map is changed.
WMMENUFONT
Font used for pop-up menus. Default: not set by wmstart; if undefined, wm uses /usr/lib/raster/dflt/b/v/language for the very high resolution display, /usr/lib/raster/dflt/b/h/language for the high resolution display, or /usr/lib/raster/dflt/b/l/language for the low resolution display where, language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it uses /usr/lib/raster/10x20/lp.b.8U for the very high resolution display, /usr/lib/raster/8x16/lp.b.8U for the high resolution display, or /usr/lib/raster/6x8/lp.8U for the low resolution display.
WMSFKFONT
Font used for softkey labels. Default: not set by wmstart. If this variable is undefined, wm uses /usr/lib/raster/dflt/b/v/language for the very high resolution display, /usr/lib/raster/dflt/b/h/language for the high resolution display, and /usr/lib/raster/dflt/b/l/language for the low resolution display, where language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it uses /usr/lib/raster/10x20/lp.8U for the very high resolution display, /usr/lib/raster/8x16/lp.8U for the high resolution display, or /usr/lib/raster/6x8/lp.8U for the low resolution display.
ICONFONT
Font used for icons. Default: not set by wmstart; if undefined, wm uses /usr/lib/raster/dflt/b/v/language for the very high resolution display, /usr/lib/raster/dflt/b/h/language for the high resolution display, or /usr/lib/raster/dflt/b/l/language for the low resolution display where language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it uses /usr/lib/raster/6x8/lp.8U for all displays.
BANNERFONT
Font used in window borders. Default: not set by wmstart; if undefined, wm uses /usr/lib/raster/dflt/b/v/language for the very high resolution display, /usr/lib/raster/dflt/b/h/language for the high resolution display, or /usr/lib/raster/dflt/b/l/language for the low resolution display, where language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it uses $WMMENUFONT.
WMFONTDIR
Directory under which font files are located. Default: set to /usr/lib/raster.
WMBASEFONT
Default font to load as base font for newly-created term0 windows. Default: set to /usr/lib/raster/dflt/b/v/language for the very high resolution display, /usr/lib/raster/dflt/b/h/language for the high resolution display, or /usr/lib/raster/dflt/b/l/language for the low resolution display where language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it defaults to /usr/lib/raster/10x20/lp.8U for very high resolution display, or /usr/lib/raster/8x16/lp.8U for high resolution display; for Series 300 low resolution displays, it defaults to /usr/lib/raster/6x8/lp.8U.
WMALTFONT
Default font to load as alternate font for newly-created term0 windows. HP-15 (2-byte) fonts cannot be used for the alternate font. Default: set to /usr/lib/raster/dflt/a/v/language for the very high resolution display, /usr/lib/raster/dflt/a/h/language for the high resolution display, or /usr/lib/raster/dflt/a/l/language for the low resolution display where language is the value of the $LANG environment variable. If $LANG is not defined or an entry for the language does not exist, it defaults to /usr/lib/raster/10x20/lp.b.8U for very high resolution displays or /usr/lib/raster/8x16/lp.b.8U for high-resolution displays; for Series 300 low-resolution displays, it defaults to /usr/lib/raster/6x8/lp.b.8I.
KJINPUTFONT
Font used in the Kanji input window for term0 windows. KJINPUTFONT is used only by the Japanese t0server which supports the Kanji input method. Default: not set by wmstart; if undefined, $WMBASEFONT is used.
TERM
Always set to "hp9836".
Window System Context
There are a number of different ways you can start up and exit the window system.
1. Directly from init to wmstart This is appropriate for a single-user (single-display), single-uid system, or one with limited flexibility (always same user on each display; no security). You can go through su(1) if desired to run the window system’s processes as other than super-user (for safety, if nothing else). Init can be told to restart wmstart if the window system terminates. No login status is recorded. Extra work is needed in inittab to set up environment variables, etc.
1.1. wmstart from init state 1 Wakes up immediately when the system is booted. May be dangerous if fsck(1M) is needed, because lots of file system activity occurs in the process of waking up the window system, which could corrupt a disc further. Greatly increases the dependence on the health of the system to get a shell, compared to vanilla getty/login.
1.2. wmstart from init state 2 The system wakes up a single-user (super-user) shell for fsck, on the ITE or on a normal terminal. May or may not require login while in state 1 (it’s up to you). The "init 2" command is given by the super-user when ready to start the window system. The single-user shell may be automatically killed, or the super-user may have to exit it first.
2. From init via getty Appropriate for a single- or multi-user (multi-display), multi-uid system. Not every terminal need be a bit-mapped display which supports windows. Getty and login run using the ITE. Users must log in normally. This can be done from init state 1 (wake up multi-user), or init 2 (wake up single-user, then switch).
2.1. User’s home shell is wmstart Windows start up automatically after login. All terminals must be bit-mapped displays, or window users may only log in on window devices (other users may or may not, at their choice). It’s difficult to customize the environment per user without modifying wmstart. Doing a wmstop leaves you logged out.
To put wmstart in /etc/passwd as a login shell, the following must be done:
1. Make a custom version, and name it something that does not contain the letter r, for example, "wmstat".
2. In the custom version, explicitly set SHELL to the value desired:
SHELL="bin/sh"; export SHELL
3. Put the name of this custom version in /etc/passwd.
2.2. Home shell is sh(1) or csh(1) This allows you to customize the window environment for all users. You must set up the ITE environment first (e.g. using tset(1)).
2.2.1. Run wmstart from /etc/profile All users get windows (all terminals are bit-mapped displays). Windows start up automatically after login. No per-user customization is possible (global only). Only works for sh(1) (until csh(1) supports global initialization).
2.2.2. Run wmstart from .profile or .login Per-user customization and control is possible. Windows start up automatically after login. This can be made conditional on terminal type (bit-mapped display or not).
2.2.3. Run wmstart manually You get a normal shell on the ITE after login. You can reinvoke wmstart to restart windows after exiting. This provides full user control, but windows aren’t automatic.
For methods 2.2.1 - 2.2.3, there are two ways to start the window system:
2.2.A. Run as subprocess (’wmstart’) ITE shell waits for termination (an extra process). After wmstop, the user is still logged in to the ITE shell, and can manually restart windows.
2.2.B. Execute directly (’exec wmstart’) The ITE shell is replaced by the wmstart process; there is no waiting shell process. After wmstop, the user is logged out.
Note that clever combinations of init(1) and wmstart are possible. For example, you could require login to a single-display, multi-user system, then run wmstart, then switch to an init state which, for example, restarts a shell on the console window (wconsole) each time the old one terminates.
Suppose you want the window system to terminate when the first shell exits. To accomplish this, you can execute "trap wmstop 0" in that shell. To make this automatic, change a copy of wmstart so it invokes wsh with the −g (login shell) option, and put a .profile file containing the command in your home directory.
SEE ALSO
windows(1), wmready(1), wmstop(1), wsh(1), umask(1), rtprio(2), plock(2), pty(4).
DIAGNOSTICS
In general wmstart does not check for errors. If anything goes wrong, various commands may write to standard error, but the script might not terminate. If $PATH is strange, some commands may not be found. If the window manager is not ready after about 20 seconds, wmstart prints a message to standard error and quits waiting to start an initial window and shell.
BUGS
If you invoke wmstart from the ITE in the background (with "&"), the ITE shell does not wait. Instead it puts out a prompt before blocking waiting for the next command line. Depending on timing, this prompt may appear on the windows screen, and can only be erased by repainting.
Hewlett-Packard Company — May 11, 2021