SCO Merge User's Guide
Chapter 6, Using SCO Merge from the command line

Chapter 6

Using SCO Merge from the command line


Table of Contents

This chapter describes how to administer SCO Merge and configure your DOS and Windows sessions using the command-line interface.

In general, we recommend that you use the Merge Setup utility in the Desktop environment for most administration tasks.

However, if you don't have the Desktop environment available, or if you want to perform some of the more advanced administration tasks that are not available through the Merge Setup utility, you will find SCO Merge command-line interface useful.

This chapter only documents the usage of SCO Merge administration commands. For a complete discussion of SCO Merge configuration and administration options, see Chapter 4, ``Configuring DOS and Windows sessions'' and Chapter 5, ``SCO Merge resource administration''.

Running DOS and Windows from the UNIX command line

In the non-Desktop environment, you can start DOS and Windows sessions by using the commands dos or win from the UNIX prompt. When the session starts, it uses your whole display.

In the Desktop environment, you normally start DOS or Windows by invoking the appropriate utility from Merge Tools. The resulting DOS or Windows session runs in its own window.

You can also start DOS or Windows from the UNIX shell in a scoterm or xterm window by typing dos or win at the UNIX prompt.

The resulting session starts in a window on the Desktop if the XMERGE environment variable has been set. (XMERGE is set by default on the local X server.)


To set the XMERGE variable using the Bourne or Korn shell, type:

XMERGE=displaytype
export XMERGE

Using the C shell:

setenv XMERGE displaytype

where displaytype is cga, vga, herc, or mono.


If the XMERGE environment variable is not set, Windows does not run, and DOS runs in the xterm window with reduced functionality. Your DOS session will act like a DOS session started on a serial terminal: It will have no graphics, no color, and no DOS fonts available.

You can also start your DOS or Windows session in a window on the Desktop by using the +x option with the dos and win command.

Configuring DOS and Windows sessions from the UNIX command line

There are two ways to configure DOS and Windows sessions using the command-line interface.

You can configure the session at the time you start it by using various configuration options with the dos and win commands.

You can also modify the default DOS and Windows configurations first by using the mrgconfig command with appropriate configuration options. Then, any session you start using the dos or win commands will use this modified configuration.

It is also possible to create multiple configurations from which DOS and Windows can be started, so that you can run DOS and Windows using different parameters at any time if you need to.

Using dos and win commands with configuration options

Use the dos and win commands as follows:

dos [ options ] [ dosprogram ]

win [ options ] [ winprogram ]

Options

Specifying options with dos and win commands overrides equivalent options in the personal session configurations set either by default or explicitly with the mrgconfig command.

+ados_device
Attaches devices to DOS or Windows environments. Most standard devices are automatically attached to your DOS or Windows environment upon startup. However, you can use this option to attach devices such as COM ports, DOS partitions, or EMS memory.


NOTE: On UnixWare 7, Merge only supports direct attaching of IO ports. Serial (COM) ports cannot be directly attached.

dos_device is a token, which is a short name that uniquely identifies the device to the SCO Merge session. Associated with each token is a set of configuration parameters that are defined at the time the token is created (using the mrgadmin command or the System-Wide Merge Administration option of the Merge Setup utility in the Desktop environment).

The following tokens are available by default for use with the +a option:

-ados_device
Do not attach a device that is specified in your session configuration.

+b
Specifies that the MS-DOS program is stream-oriented (behaved). See ``Specifying DOS application output behavior'' in Chapter 7 for more information.

+efile[,file ...]
Interprets one or more config.sys files instead of the one specified in the session configuration. Note that there are no spaces between +e and file.

-e
Does not interpret any config.sys files.

+h
Displays help text.

+k[user:]config
Uses the personal session configuration named config. If the user option is specified, that user's config is used. (For example, to run Windows using tom's session configuration, type win +ktom:win.)

You cannot use the +kuser:config option to specify a session configuration belonging to an NIS-administered user other than yourself. See ``The mrgconfig command'' for more information on personal session configurations.

-l
Starts a DOS environment by booting from the floppy that is inserted in drive A.

+mn
Specifies the total standard memory in megabytes.

+pfile
Runs the DOS batch program file in place of the standard autoexec.bat file. Note that there are no spaces between +p and file.

-p
Does not execute any autoexec.bat files, not even the automatically generated ones that SCO Merge normally uses.

+r
Start the session with the initial directory at the root of your personal drive.

-r
Start the session with the initial directory set to the current UNIX directory.

+sn
Sets printer timeout to n seconds and overrides any timeout setting for LPT1, LPT2 or LPT3 in the personal session configuration.

-t
For all programs passed as an argument to the commands dos and win, the default is to translate the UNIX-style path separators (/) to DOS-style separators (\) and to translate UNIX-style switch characters (-) to DOS-style switch characters (/). So, the command dos dir /etc -w becomes dir \etc /w before it is passed on to DOS. When the -t option is specified, this translation is disabled, and the command is passed to DOS as is.

+w
When used with a dos command, starts a DOS session using the Windows session configuration. This option is useful when you want to start DOS first, and then start Windows from that DOS session.

+x
Runs the session in its own window under X. You can also set the XMERGE environment variable to force the session to come up in its own window.

-x
Ignore the setting of the XMERGE environment variable, and run the session inside the window from which it is started.

+z
When running under X, this option forces the session to immediately zoom (take over the whole display).

-z
When running under X, this option disables immediate zooming of the session, so that the user is prompted to zoom when necessary.

The mrgconfig command

You can use the mrgconfig utility to view or change options for your standard DOS and Windows session configurations. You can also create and save alternate configurations.

mrgconfig accomplishes the same thing as the Personal Merge Session Configuration option of the Merge Setup graphical Desktop utility.

The following forms of the mrgconfig utility are used for listing, setting, or deleting session configuration options:

mrgconfig config list [option[,option]...]
mrgconfig config set option=value
mrgconfig config delete option=value

Here, config can be dos, win, or another session configuration name. (See "Creating new configurations" for instructions on adding and removing new configurations).

To display the current setting of a given option, use the list command. For example:

mrgconfig win list memory

displays the current memory setting for the standard Windows session configuration (win).

To display all the configuration values for the standard DOS (dos) and Windows (win) environments, type:

mrgconfig dos list
mrgconfig win list

To set or change the value of an existing option, use the set command. For example:

mrgconfig win set memory=6
mrgconfig dos set lpt1=laser,15

To remove a device attachment option from a configuration, use the delete command. (This command works only with custom device tokens.) For example:

mrgconfig dos delete customdev=sound-card

removes the customdev=sound-card entry from the standard DOS session configuration. It does not remove any other customdev entries that may exist.

Setting mrgconfig options

To change any standard DOS or Windows session configurations, use the set command with the mrgconfig utility. This command takes option names as arguments. Each option is assigned a value, as follows:

mrgconfig config set option=value

Legal values for each option are given below. Some values are tokens. (A token is a unique name for a hardware device that is either predefined by SCO Merge or added by the system administrator. You can get a list of available tokens by using the following command: mrgadmin -list.)

autoexecglobal=
Specifies whether the file J:\autoexec.bat is used when you start a SCO Merge session. Values are true or false.

autoexeclocal=
Specifies whether the /autoexec.bat file on your personal drive is used when you start a SCO Merge session. Values are true or false.

autoexecprivate=
Specifies an autoexec.bat file to be used when you start a SCO Merge session. The value is the full UNIX path name to the file or blank.

autofreeze=
Specifies whether your session is temporarily suspended while the input focus is switched away from your session's window to another window. Values are true or false.

autozoom=
Specifies whether or not the SCO Merge session zooms automatically. Values are true or false.

com1=
Specifies the serial port to attach for COM1 during a SCO Merge session. The value is a COM1 class token.

com2=
Specifies the serial port to attach for COM2 during a SCO Merge session. The value is a COM2 class token.

configglobal=
Specifies whether the file J:\config.sys is used when you start a SCO Merge session. Values are true or false.

configlocal=
Specifies whether the /config.sys file on your personal drive is used when you start a SCO Merge session. Values are true or false.

configprivate=
Specifies a config.sys file to use when you start a SCO Merge session. The value is the full UNIX path name to the file or blank.

customdev=
Specifies a device to attach during a SCO Merge session. The value is a custom class token.

displaytype=
Specifies the display type to be used for a DOS session. The values are auto, vga, cga, mono, or herc.

dosfont=
Specifies the font size to be used for a DOS session running inside an X window. The values are auto, small, or medium.

drive=
Specifies how drive letters are mapped. This option has the following form:
   drive=driveletter,drive_name[,readonly][,exclusive]
Here, driveletter is the DOS drive letter; drive_name can be none, indicating that the drive is not mapped to anything, a DOS fixed disk in the form dosn, or a token for a virtual drive.

ems=
Specifies the amount of expanded memory to attach to a SCO Merge session. The value is a number of megabytes of expanded memory from 0 through 8.

installcolormap=
Specifies whether a private color map is used for DOS or Windows sessions running on the Desktop. Values are true or false.

lptn=
Specifies the DOS printer ports for SCO Merge sessions (LPT1, LPT2, or LPT3). The value is a printer class token, followed by a timeout value t from 5 through 3600 (or 0, which means printing never occurs as the result of a timeout), as follows:
   lpt1=token,t

maxcolors=
Value is low, medium, or high. Specifies the maximum number of colors SCO Merge allocates to a Windows session. low allocates only 20 colors. medium reserves an additional 49 colors. high reserves the original 20 colors, plus 109 more. (This option is useful only when a shared colormap is used, i.e., installcolormap is set to false, and the Desktop display has 256 colors.)

memory=
Specifies the amount of standard memory to attach to a Windows session. The value is a number of megabytes of standard memory from 1 through 64.

mouse=
Specifies the mouse definition for the SCO Merge session. The value is a mouse class token.

personaldrive=
Specifies the DOS drive letter to be used as your personal drive.

run=
Specifies an optional command that SCO Merge is to run when a session starts.

scaledosgraphics=
Specifies the graphics scaling factor to be used for DOS sessions running on the Desktop in Hercules or CGA modes. Values are auto, 1, or 2.

session=
Specifies the type of SCO Merge session this configuration is used for. Values are dos, win3x, or win95.

showmenukey=
Specifies the key combination that brings the menu and status bars of Merge's DOS or Windows window back into view or unfocuses the mouse when it is focused to the DOS window. You can set the key combination to any combination of <Ctrl>, <Alt>, and <Shift> keys plus another key, which you specify with the X key symbol name. When you specify more than one key, separate them with spaces and surround the combination with quotes. For example, to set the key combination to <Ctrl><Alt><Shift><F10>:

showmenukey="ctrl alt shift F10"

To set the showmenu key to be just the <Home> key:

showmenukey=Home

By default, SCO Merge defines <Shift><F12> as the key sequence.

startzoomed=
Specifies whether to zoom your session to full screen as soon as it is started from the Desktop. The value is true or false.

unzoomkey=
Specifies the key combination that unzooms. You can set the key or key sequence to any combination of <Ctrl>, <Alt>, and <Shift> keys plus another key, which you specify with the X key symbol name. When you specify more than one key, separate them with spaces and surround the combination with quotes. For example, to set the key combination to <Ctrl><Alt><Shift><F10>:

unzoomkey="ctrl alt shift F10"

To set the unzoom key to be just the <Home> key:

unzoomkey=Home

By default, SCO Merge defines <Shift><F12> as the key sequence.

windowsdir=
Specifies the subdirectory on your personal drive where Windows is installed. A typical setting is "windows".

windowsizeauto=
Specifies that SCO Merge should automatically compute the window size when a Windows 3.1 session starts. Values are true or false. When set to true, the windowswidth= and windowsheight= commands are ignored.

windowswidth=
Specifies the width of the Windows 3.1 window in pixels. The minimum width is 600. This option is ignored when the value for the windowsizeauto= command is true.

windowsheight=
Specifies the height of the Windows 3.1 window in pixels. The minimum height is 400. This option is ignored when the value for the windowsizeauto= command is true.

windowsmode=
Specifies whether your Windows 3.1 environments start in standard mode or in enhanced mode. The values are standard or enhanced.

windowspaging=
Specifies whether or not Windows 3.1 environments that run in enhanced mode should use the Virtual Memory features of Windows. Values are true or false.

xcutandpaste=
Specifies whether or not your Windows environments start with the X Cut and Paste feature turned on or off. Values are true or false.

Creating new configurations

You can create and use new configurations other than the default dos and win configurations, which can be useful if you regularly alternate between DOS or Windows environments that require different configurations.

To create a new configuration in a non-Desktop environment, use the addmrgconfig command. This command simply copies an existing configuration to a new name. You can then use the mrgconfig command to modify it appropriately.

The syntax for addmrgconfig is:

addmrgconfig existing_config [copyto] new_config

For example, if you want to create a specific DOS configuration that is similar to your default DOS configuration except that it uses 2MB of expanded memory and a custom device called sound-card, follow these steps:

  1. Create a new configuration and give it a name. In this example, the new configuration is based on the default DOS configuration and is called dos-sound:

    addmrgconfig dos copyto dos-sound


    NOTE: Configuration names can contain the characters A through Z (uppercase and lowercase), the numbers 0 through 9, and the hyphen (-). Although some systems allow longer names, we recommend that you limit your configuration names to no more than 10 characters.

  2. Use mrgconfig to change its settings:

    mrgconfig dos-sound set ems=2
    mrgconfig dos-sound set customdev=sound-card

To start a DOS session with the new configuration, use the +k option:

dos +kdos-sound

To list all of your existing configurations:

listmrgconfig

To delete a configuration:

delmrgconfig config


NOTE: You cannot delete the dos or win configuration.

You can also borrow a configuration file from another user by adding the user's user identification to the existing_config option of the addmrgconfig command. For example, if user john has created a session configuration named goodie, and you want a copy of it, run the following command:

addmrgconfig john:goodie copyto myconfig

You must have appropriate read permissions on a user's home directory before you can copy a configuration.

SCO Merge administration from the UNIX command line

If you are not running in the Desktop environment, you can accomplish SCO Merge administration tasks from the UNIX command line.

The following commands are available:

Using mrgadmin

In a non-Desktop environment, you can use the mrgadmin(1merge) command to manage device definitions. You must be logged in as root to create, modify, or delete device definitions using this command.

This section mainly describes the syntax of the mrgadmin command. For a complete discussion on device definition and attachment, see ``Device definition'' in Chapter 5.

Each device definition is identified by a unique token. To list the tokens currently available for attachment, use the list option, as follows:

mrgadmin class list

Here, class is one of the following types of tokens:

To display a definition of each class of token, type:

mrgadmin class printdef token

For example, to find out about tokens available for attachment as the COM1 serial port, type:

mrgadmin com1 list

Assume that token dcom1 was listed as one of the available tokens. To see its definition, type:

mrgadmin com1 printdef dcom1

Use the add option of the mrgadmin command to create new tokens and the update option to modify them.

For example, to create a new COM1 token, use the following command:

mrgadmin com1 add token:file name:"full_name"

Here, token is the token name, file name is the name of a definition file, and full_name is a more descriptive name for the token. The definition file contains all the information necessary for SCO Merge to access this particular device. See ``Tokens and full names'' and ``Definition files'' for details.

To delete tokens you have created but no longer need, use the delete option, as follows:

mrgadmin class delete token

For example, to delete the printer token printer1, type:

mrgadmin printer delete printer1

Do not use the add, update, or delete option with the ems or mouse classes.

Once you create the device definition tokens, you can attach them to a DOS or Windows session by using the +a option of the dos or win command. You can also modify your session configurations by using the mrgconfig command or the Merge Setup graphical utility in the Desktop environment.

Note, that if you create a new virtual DOS volume token (class dosdrive), you also need to use the mkvdisk command to create the actual UNIX file that will contain the new DOS volume before you can attach it to your DOS or Windows session.


CAUTION: Do not remove or modify the values of the standard tokens that come with SCO Merge. Doing so can interfere with the standard operation of SCO Merge. You may add, update, and delete only your own token definitions.

Tokens and full names

Tokens are short names used to identify device definitions.

Tokens must be unique. They can only contain the letters A-Z, the numbers 0-9, and the hyphen (-). The token names should be kept short (no more than 12 characters) to make them easy to use.

Full names (full_name) are more descriptive names for the device definitions. A full name can contain any character, including spaces. However, the entire full_name entry must be enclosed in double quotes when used in a mrgadmin class add command.

Definition files

A definition file contains device definition information necessary for SCO Merge to access the device from DOS and Windows sessions. You can use any UNIX system text editor to create the definition file.

The definition file can be named anything and can reside anywhere. The add option of the mrgadmin command only reads the contents of the file in order to update its internal tables. You can delete the definition file after you run the mrgadmin command.

Definition files for DOS drives

Definition files for DOS drives (or volumes) contain three entries:

   attachtype=drive
   drivename=
   failureaction=

where:

attachtype=
Must always be set to the value drive.

drivename=
Specifies the full path to the UNIX file name of the virtual DOS volume. Instead of a full path file name, you can use a leading H/ to indicate a file name relative to the user's home directory.

failureaction=
Can be set to abort, warn, or ignore. When this option is set to abort, any DOS or Windows session that tries to attach this volume fails to start if this volume is not available (that is, if it is in use by another process when you have used the exclusive attach option). When this option is set to warn, only a warning is issued and the session continues to start. If the option is set to ignore, all failures are silently ignored.

You should set this entry to warn unless you have special requirements that are best served with the abort or ignore option. Again, note that the failureaction setting is only used when the drive is attached with the exclusive option.

For example, the definition file for making the virtual drive /var/vdrive available for attachment contains the following entries:
   attachtype=drive
   drivename=/var/vdrive
   failureaction=warn

Definition files for virtual COM devices

Definition files for virtual attach serial ports contain four entries:

   attachtype=vpippi
   vpidevice=
   ppidevice=
   failureaction=
   irq=
   ioports=

attachtype=
must always be set to the value vpippi.

vpidevice=
must be either /dev/vcom1 for COM1 or /dev/vcom2 for COM2. (Please note that some manufacturers of multiport devices may provide their own device names for supporting SCO Merge. In that case, vpidevice= should be set to the necessary device names. Consult the multiport documentation for details.)

ppidevice=
should be set to the UNIX device name of the actual serial port. Consult the device documentation for details.

failureaction=
can be set to abort, warn, or ignore. When the option is set to abort, any DOS or Windows session that tries to attach this port fails to start if this port is not available (that is, if it is in use by another process). When this option is set to warn, only a warning is issued and the session continues to start. If the option is set to ignore, all failures are silently ignored. You should set this entry to warn unless you have special requirements that are best served with the abort or ignore option.

irq=
should indicate the virtual IRQ used. COM1 uses 4, and COM2 uses 3. This is for documentation purposes only. This setting is optional.

ioports=
should indicate the virtual I/O ports used. COM1 uses 3f8-3ff, and COM2 uses 2f8-2ff. This is for documentation purposes only. This setting is optional.

For example, the definition file for making the serial port /dev/tty3a available for attachment as COM1 contains the following entries:
   attachtype=vpippi
   vpidevice=/dev/vcom1
   ppidevice=/dev/tty3a
   failureaction=warn
   irq=4
   ioports=3f8-3ff

Definition files for print spoolers

Definition files for spooler attach printers contain two entries:

   attachtype=
   printercommand=

attachtype=
must always be set to the value spooler.

printercommand=
is the UNIX command that processes a print stream (for example, the lp command).
For example, the definition file for making the UNIX printer laser available for use under DOS contains the following entries:
   attachtype=spooler
   printercommand=lp -dlaser


NOTE: If you are using DOS or Windows 3.1, you need to attach the newly defined printer to your session before you can use it.

If you are using Windows 95, you do not need to attach printers to your session. All available printer definitions show up in the list of available Windows 95 printers.


Definition file for direct attached devices


NOTE: On UnixWare 7, Merge only supports direct attaching of IO ports.

Definition files for custom direct attach devices can contain one or more of the following:

   attachtype=
   irq=
   ioports=
   memmappedio=
   dmachannel=
   physicalirq
   physicalioports
   physicalmemmappedio
   physicaldmachannel
   failureaction=
   useraccess=
The definition file can have any name and can reside anywhere. Use any UNIX text editor to create the file.

attachtype=
must always be set to the value direct.

irq=
A single decimal number or series of comma-separated numbers that denote which interrupt levels are used. Values can only be 2 through 7, 9, 10, 12, or 15.

Note: Direct attach IRQ is only avaiable on OpenServer systems.

ioports=
has the following recursive definition:

X[-Y][,io_port_range]

Here, the form X specifies the I/O port address X (in hex), and the form X-Y specifies an I/O port address range, from low X (in hex) to high Y (in hex) that the device uses. As the syntax shows, single or multiple ports or ranges may be given. Values are typically in the range of 0 to 3ff (hex).

memmappedio=
has this recursive definition:

X-Y[,memory_mapped_io_range ]

Here, X and Y are two hex numbers, separated by a hyphen, denoting the range of the memory-mapped I/O. The first number is the lowest address and the second is the highest address. Each range must start on a 4K boundary and be a multiple of 4K. As the syntax shows, multiple ranges may be specified. Values are typically c0000 to effff (hex).


NOTE: When you add or remove a definition that uses memmappedio or change memmappedio in an existing definition, you must make new DOS images. See ``Making new DOS images'' in Chapter 5 for more information.

Note: Direct attach memory-mapped I/O is only avaiable on OpenServer systems.

dmachannel=
is a single decimal number or a series of comma-separated decimal numbers that denote which DMA channels are used. (Note that devices that use certain DMA modes may not work.) Values may be 0, 1, 2, 3, 4, 5, 6, or 7.

Note: Direct attach DMA is only avaiable on OpenServer systems.

physicalirq
When used, this specifies the real physical IRQ(s), and irq specifies the virtual IRQ(s) that the DOS or Windows process uses. The number of IRQ values specified must be the same in irq and physicalirq.

This line is used only when attachtype is direct and when irq is also used. It is optional.

physicalioports
When used, this specifies the real physical I/O ports, and ioports specifies the virtual ioports that the DOS or Windows process uses. The syntax of the port values for physicalioports is the same as for ioports. The ranges in ioports and physicalioports must match in size and number.

This line is used only when attachtype is direct and when ioports is also used. It is optional.

physicalmemmappedio
When used, this specifies the real physical addresses of the memory mapped I/O of the device, and memmappedio specifies the virtual address where the DOS or Windows process accesses it. The syntax of the address values is the same as for memmappedio. The ranges in memmappedio and physicalmemmappedio must match in size and number.

This line is used only when attachtype is direct and when memmappedio is also used. It is optional.

physicaldmachannel
When used, this specifies the real physical DMA channel(s) used by the device, and dmachannel specifies the virtual DMA channel(s) that the DOS or Windows process uses. The number of channels specified in dmachannel and physicaldmachannel must be the same.

This line is used only when attachtype is direct and when dmachannel is also used. It is optional.

failureaction=
can be set to abort, warn, or ignore. When the option is set to abort, any DOS or Microsoft Windows session that tries to attach this device (using +atoken or using the Merge Setup window) fails to start if this device is not available (that is, if it is in use by another process). When this option is set to warn, only a warning is issued and the session continues to start. If this option is set to ignore, all failures are silently ignored. While you are setting up your token, you should set this entry to abort. Once you have a token configuration that works correctly, you should set this entry to warn unless you have special requirements that are best served with the abort or ignore option.

useraccess=
can be set to root or to nothing. When the entry is set to root, only the root user can attach this device. When this entry is removed or set to nothing, all users can attach the device. While you are setting up your token, you should set this entry to root. Once you have a token configuration that works correctly, you should set this entry to nothing so that the device becomes available to all users.

For example, consider a hypothetical adapter card for a widget device. The widget card I/O ports range from 240 to 25f, the interrupt for the card is 7, and the device requires an 8K RAM buffer with a starting address of ce000. The DMA channel field is not relevant for this device. Therefore, the definition file for this device contains the following entries:

   attachtype=direct
   irq=7
   ioports=240-25f
   memmappedio=ce000-cffff
   dmachannel=
   failureaction=abort
   useraccess=root
Be sure that the interrupt, the port ranges, and the RAM address you specify do not conflict with any already existing DOS devices (such as the mouse driver or the EMS driver). If a conflict does exist, you should change the settings on your hardware device. If you need to change the default settings for the mouse driver instead, refer to ``The mouse'' in Chapter 5.

Incorrect use of device specifications for a direct attach custom device can crash the UNIX system. You should install and test the device in system maintenance mode and at a time when users are not inconvenienced if you need to reboot the system.

During this testing phase, you may have to fine tune the entries in your definition file. Instead of continuously deleting a token and adding it again, you can use the update option of the mrgadmin command. For example, if you want to change an entry in the definition file for widget, edit the definition file, make the desired change, and then type:

mrgadmin custom update widget:def-file:"Widget Adapter"


NOTE: Since this example definition specifies memmappedio, you must make new DOS images. See ``Making new DOS images'' in Chapter 5 for more information.

You can continue this testing process until you have a definition that works. Then, you should clear the useraccess= entry so others can use the device; you may also change the failureaction= entry from abort to an option appropriate to your environment.

Directly attached devices cannot be shared. As long as one process is using a directly attached device, other processes are prevented from using the device until the process controlling the device exits.

Creating virtual DOS volumes using the mkvdisk command

You can create the virtual DOS drive volume associated with the new device definition token created by the mrgadmin dosdrive command by issuing the following command from the proper directory:

/usr/lib/merge/mkvdisk [-s] filename size

Here, filename is the name of the UNIX file that will be used as the virtual volume, size is the size of the drive in kilobytes, and the -s option, when present, allocates the full size when you create the drive.

By allocating this space when you create the drive, you ensure that it is available in the future. If you omit the -s option, mkvdisk creates only a small file as a placeholder. However, this file can grow as your DOS programs use the virtual drive to store files as long as there is sufficient space on the UNIX file system to accommodate the growth.

For example, to create a 5MB virtual DOS drive named mydrive.dsk in your home directory and allocate the full size at creation, type:

/usr/lib/merge/mkvdisk -s mydrive.dsk 5000

Configuring running sessions from the DOS command line

The following SCO Merge commands allow you to configure your current session from the DOS prompt:

Using the printer command

You can use the SCO Merge printer command from the DOS command line to redirect DOS or Windows 3.1 printing to a UNIX printer other than the default spooler doslp. (You can also put the printer command in your autoexec.bat file.)

The syntax for selecting a print stream, a printer, and a UNIX print command is:

printer lptn unix [prt_cmd | /r] [/x0 | x1] [/t[timeout]]

Here, n is 1, 2, or 3 and indicates whether you are using LPT1, LPT2, or LPT3.

prt_cmd specifies the UNIX print command that should be used to process the DOS or Windows print requests you send to this port. If you use the /r option instead of specifying a print command, SCO Merge passes the print stream to the UNIX default print process.

timeout is the number of seconds you want SCO Merge to wait without receiving print data before it passes the print stream to the UNIX command. The timeout value can be in the range 5 to 3600; the default is 15. When you set /t0, print breaks (that is, when the print stream is sent to the UNIX command) never occur as a result of a timeout. Instead, the print stream is sent when the DOS application requesting printing exits (/x1, which is the default setting for the printer command). When you set /x0, the print stream is not automatically sent when the DOS application exits. Setting both /x0 and /t0 causes SCO Merge to hold the print stream until you explicitly request a print break by typing:

printer lptn /p

To discard print jobs that are being held, type:

printer lptn /d


NOTE: The timeout and /x options have no meaning when you print from Windows 3.1 using the SCO Merge Network Printing driver.

For example, to direct DOS print output sent to LPT2 to a UNIX printer called laser, follow these steps:

  1. Start a DOS environment if you have not already started one.

  2. Use the following printer command, from the DOS prompt, to direct print stream LPT2 to the printer named laser:

    printer lpt2 unix "lp -dlaser"

    In this command, the -d (destination) option on the lp command identifies the printer named laser.

  3. To send DOS printer output to the printer, name the DOS print stream in your DOS print command or in your DOS application. For example:

    copy letter.txt lpt2

    You can direct printer output from DOS applications to any UNIX printer using the same procedures.


WARNING: Do not use print spoolers such as the DOS print command when printing to a UNIX printer.

Note that the prt_cmd that you specify when you use the printer command is typically lp -d printer, where printer is the name of a UNIX printer. However, prt_cmd can be any UNIX command that you choose to use to process a print stream.

Tuning application execution using the merge command

The merge command allows you to tune the operation of the DOS and Windows 3.1 sessions for certain applications. (Windows 95 is not affected by the merge command)

Unlike the configuration options, you use the merge command to set characteristics of the DOS or Windows environment only from within DOS.

With the merge command, you can:

Handling applications that poll the keyboard

Many DOS and Windows 3.1 applications continuously poll the keyboard for keyboard input. Such applications consume system resources even when they are idle by getting into a polling loop. This reduces system performance by consuming CPU time that would otherwise be available to other processes.

Unlike standard DOS and Windows 3.1, SCO Merge automatically puts applications that continuously poll the keyboard to sleep until there is keyboard input.

Some applications may appear to be in a polling loop when they actually are not. The SCO Merge default to put these applications to sleep causes them to perform poorly in the SCO Merge environment. This situation is not common, but if you encounter it, you can disable the sleep feature.

To disable the SCO Merge default of putting applications that continuously poll the keyboard to sleep, type the following at the DOS prompt:

merge set pollsleep off

To return to the standard SCO Merge default, type:

merge set pollsleep on

Handling DOS application network transactions

From the point of view of some DOS and Windows applications, the SCO Merge file system is a network device. These applications use various DOS system calls to determine whether and how they should operate. An application may enable or disable file locking, for example, based on its tests of network status.

The four merge command options described in the following sections (drive, handle, netbios, and 5f02) have defaults that allow DOS applications to run correctly when they access the UNIX file system.

Specifying local and remote drives

Some DOS and Windows 3.1 applications detect whether a DOS drive is local or remote by using the DOS interrupt 21H system call function 44H (IOCTL) code 09H (Is Logical Device Local or Remote). These applications may not operate correctly if a DOS drive is remote when the application expects it to be local or vice versa.

SCO Merge always treats your personal drive C as local; by default, it treats other UNIX drives (such as D and J) as remote drives. You can change this setting for all non-personal UNIX drives by typing the following command at the DOS prompt:

merge set drive local

If you always want these drives treated as local, you can insert this command in your autoexec.bat file.

To return to the SCO Merge default -- interpreting UNIX drives as remote -- type:

merge set drive remote

Specifying local and remote files

Some DOS and Windows 3.1 applications detect whether a DOS file is local or remote by using the DOS interrupt 21H system call function 44H (IOCTL) code 0AH (Is Redirected Handle). These applications may not operate correctly if a DOS file is interpreted as remote when the application expects it to be local or vice versa.

SCO Merge always treats files on personal drive C as local; by default, it treats files on other UNIX drives (such as D and J) as remote files.

Type the following command at the DOS prompt to configure your environment so DOS interprets files on non-personal UNIX drives as local:

merge set handle local

If you always want files on these drives treated as local, you can insert this command in your autoexec.bat file.

To return to the SCO Merge default, type:

merge set handle remote

Specifying NetBIOS

Some DOS and Windows 3.1 applications specifically ask whether NetBIOS support is available before they operate properly in a network environment.

By default, SCO Merge responds yes when a DOS program asks whether NetBIOS support is available. Note that SCO Merge does not actually support NetBIOS; it only responds this way to the initial query from the application.

Although this default value does not adversely affect any tested applications, you might discover an application that does not behave as expected unless you change the default.

Type the following command at the DOS prompt to change the default so that SCO Merge responds no to inquiries about NetBIOS support:

merge set netbios off

To return to the SCO Merge default, type:

merge set netbios on

Specifying the Microsoft redirector

Some DOS and Windows 3.1 applications recognize the DOS interrupt 21H system call function 5f02 (Get Redirector List Entry) used by the Microsoft redirector.

By default, SCO Merge enables processing for this function.

Although this default value does not adversely affect any tested applications, you might discover an application that does not behave as expected unless you change the default.

Type the following command at the DOS prompt to change the default so that SCO Merge does not recognize the 5f02 function:

merge set 5f02 off

To return to the SCO Merge default, type:

merge set 5f02 on

Printing files with control characters

DOS normally opens character output devices, such as printers, in character mode. In character mode, DOS recognizes certain ASCII codes as instructions to DOS or to the output device. For example, DOS interprets the ASCII code for the Ctrl-Z (^Z) combination as an end-of-file instruction and stops processing the file at that point.

By default, SCO Merge opens character output devices, such as printers, in binary mode. In binary mode, DOS treats embedded control characters as ordinary characters and outputs them to the device just like any other character. That is, in binary mode, encountering a ^Z in a file does not cause DOS to halt printing.

To have SCO Merge open character devices in standard DOS character mode instead of binary mode, type the following at the DOS prompt:

merge set lpt_binary off

To return SCO Merge to the default of opening character devices in binary mode, type:

merge set lpt_binary on

Displaying current settings

To display the current settings for any merge command option, use the display option.

For example, to see the current setting for pollsleep, type the following at the DOS prompt:

merge display pollsleep

To see the current settings for all the merge command options, type:

merge display

Setting the DOS exit code

You can use the merge return option to set the DOS exit code to a numeric value (0 or 1) that corresponds to the state of one of the other merge options.

SCO Merge assigns the value 1 to the on or remote condition and the value 0 to the off or local condition.

For example, suppose you want to determine the current pollsleep setting. Type the following:

merge return pollsleep

When the current value for pollsleep is on, SCO Merge sets the DOS exit code to 1. When the current value for pollsleep is off, SCO Merge sets the DOS exit code to 0.

You can create a DOS batch file, such as errlevel.bat, to check the exit code and take appropriate action. You can include the following lines in the batch file to determine whether pollsleep is on:

   merge return pollsleep
   if errorlevel == 1 goto ISON
   echo POLLSLEEP is OFF
   goto END
   :ISON
   echo POLLSLEEP is ON
   :END

Installing DOS and Windows from the UNIX command line

It is possible to install DOS and Windows from the UNIX command line if you are not working in the Desktop environment.

You must be logged in as root to install DOS (except if you are installing DOS 7 from the Windows 95 CD for the first time). Once DOS is installed on your system, it is available to all users.

Each user must install his or her own copy of Windows.

Warning:

Installing DOS

To install DOS versions 6.2, 6.21, or 6.22 from floppies or to re-install DOS version 7, which you previously installed from the Windows 95 CD, run the dosinstall command.

This command guides you through the installation by prompting you to specify the version of DOS you are installing and the number of floppies in your set.

If you plan to install Windows 95, DOS version 7 will be automatically installed from the Windows 95 CD. If you want to install DOS version 7 from the Windows 95 CD without installing Windows, you can run the instdos7cd command. Please see the man page for instdos7cd(1merge) for more information.

Installing Windows

To install Windows 3.1, Windows 3.11, or Windows for Workgroups, you need to run the winsetup command. See ``Installing Windows 3.1, Windows 3.11, and Windows for Workgroups'' in Chapter 2 for instructions.

To install Windows 95, run the instwin95cd command. This command installs Windows 95 on user's personal drive C from the standard Microsoft Windows 95 CD.

Please see the man page for instwin95cd(1merge) for more information.

Configuring X resources

SCO Merge makes use of some X resources to configure Desktop features, mostly for color definitions. Procedures for administering X resources vary according to the X server installed on your system and are described in the documentation for your Desktop.

For a complete list of resources that SCO Merge uses, refer to the file /usr/lib/X11/app-defaults/DOS.

Switching between Multiscreens

SCO Merge uses the same screen-switching key combination as the SCO X server.

On OpenServer systems you can use the switchkey program to configure the screen-switching key combination for SCO Merge and the SCO X server.