home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 16 / FREEDOS.ZIP / FD_A4PRE.ZIP / HELP / MODE < prev    next >
Text File  |  1995-06-28  |  14KB  |  342 lines

  1.     Program usage documentation for the Free-DOS MODE program
  2.  
  3.     (c) Copyright 1994-1995 by K. Heidenstrom.
  4.  
  5.     Modified:
  6.  
  7.     KH.941231.001  (MODE 1.0.0)  First version
  8.     KH.950116.002  (MODE 1.0.2)  Added switchar documentation
  9.     KH.950520.003  (MODE 1.0.3)  No changes to functionality
  10.  
  11. 1.  LEGAL
  12.  
  13.     This program is Copyright 1994-1995 by K. Heidenstrom.    It was
  14.     written specifically for the Free-DOS project.    The author may
  15.     be reached at kheidens@actrix.gen.nz on the Internet or by snail
  16.     mail: K. Heidenstrom c/- P.O. Box 27-103, Wellington, New Zealand.
  17.  
  18.     This program is free software.    You may redistribute the source and
  19.     executable and/or modify the program under the terms of the GNU
  20.     General Public License as published by the Free Software Foundation;
  21.     either version 2 of the License, or (at your option) any later version.
  22.  
  23.     This program is distributed in the hope that it will be useful,
  24.     but is provided "as-is", without any warranty of any kind, including
  25.     the implied warranty of merchantability or fitness for a particular
  26.     purpose.  In no event will the author be liable for any damages of
  27.     any kind related to the use of this program.  See the GNU General
  28.     Public License for more details.
  29.  
  30.     You should have received a copy of the GNU General Public License
  31.     along with this program; if not, write to the Free Software
  32.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  33.  
  34. 2.  FUNCTION AND USAGE SYNTAX
  35.  
  36.     The MODE program performs six separate functions, which are
  37.     described separately below.
  38.  
  39. 2.1.  SET VIDEO MODE AND NUMBER OF SCREEN LINES
  40.  
  41.     MODE allows the video mode to be set to one of five modes.  The
  42.     syntax is:
  43.  
  44.     MODE Videomode[,Lines]
  45.  
  46.     The modes are:
  47.  
  48.     MONO    Monochrome mode, as used with the MDA and Hercules adapter
  49.         cards, and also emulated on EGA and VGA cards.    This mode
  50.         is the only mode which has the ability to underline
  51.         characters on the screen by default.  This mode cannot be
  52.         selected on the CGA video card.
  53.  
  54.     BW40    40-column color-suppressed mode.  This mode is specific to
  55.         the CGA adapter, and gives a display of 40 columns by 25
  56.         lines.    The color information of the composite video signal
  57.         from the CGA card is turned off, so that the display is in
  58.         black and white on a composite color monitor, with sixteen
  59.         shades of grey.
  60.         If this mode is selected on an EGA or VGA card, or a CGA card
  61.         that is not connected to a television set or a composite color
  62.         monitor, it will appear the same as the CO40 mode (i.e. the
  63.         color will not be suppressed).    This mode cannot be selected
  64.         on MDA and Hercules video cards.
  65.  
  66.     BW80    80-column color-suppressed mode.  This mode is also specific
  67.         to the CGA adapter and is the same as BW40 except that there
  68.         are 80 columns.
  69.         If this mode is selected on an EGA or VGA card, or a CGA card
  70.         that is not connected to a television set or a composite color
  71.         monitor, it will appear the same as the CO40 mode (i.e. the
  72.         color will not be suppressed).    This mode cannot be selected
  73.         on MDA and Hercules video cards.
  74.  
  75.     CO40    40-column color mode.  This mode gives 40 columns by 25 lines
  76.         color display.    It is supported by CGA, EGA, and VGA adapters
  77.         but not by MDA and Hercules cards.
  78.  
  79.     CO80    80-column color mode.  This mode gives an 80 column by 25 line
  80.         display and is the normal display mode for CGA, EGA and VGA
  81.         cards.    It is not supported by MDA and Hercules cards.    On EGA
  82.         cards, this mode also supports a 43-line variant, and on VGA
  83.         cards, the 43-line variant and a 50-line variant are supported.
  84.  
  85.         The 43-line and 50-line modes can be selected by specifying
  86.         ",43" or ",50" after the CO80 on the MODE command line.  If
  87.         this parameter is not specified, the default of 25 lines will
  88.         be used.
  89.  
  90.     Once set, the video mode will remain in effect until changed by
  91.     a MODE command or by a program.  The video mode is not locked
  92.     permanently - programs are free to change video modes as they
  93.     require.
  94.  
  95. 2.2.  CONFIGURE SERIAL PORT PARAMETERS
  96.  
  97.     MODE allows the communication parameters of a serial port to be
  98.     configured.  The syntax is:
  99.  
  100.     MODE COMn:r,p,d,s
  101.  
  102.     n    Specifies which serial port is to be configured, in the range
  103.         1 to 4.  If the serial port does not exist, MODE will report
  104.         an error.
  105.  
  106.     r    Specifies the baud rate in bits per second.  Values are:
  107.         50, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 14400,
  108.         19200, 28800, 38400, 57600, and 115200.
  109.  
  110.         1200, 2400, 4800, and 9600 may be abbreviated to 12, 24,
  111.         48 and 96 respectively.  14400, 19200, 28800, 38400, and
  112.         57600 may be abbreviated to their first two or three digits.
  113.         115200 may be abbreviated to 115 or 1152.
  114.  
  115.     p    Specifies the type of parity generated and checked on
  116.         the data bytes.  Values are:
  117.  
  118.         E = Even parity
  119.         O = Odd parity
  120.         N = No parity
  121.  
  122.     d    Specifies the number of data bits that will be transmitted
  123.         and received.  The allowable values are 5, 6, 7, and 8.
  124.  
  125.     s    Specifies the number of stop bits that will be transmitted
  126.         and expected.  This may be 1 or 2.  If 2 stop bits are
  127.         used in conjunction with 5 data bits, the serial port will
  128.         actually generate and check 1 1/2 stop bits.
  129.  
  130.     Once set, the serial port parameters will remain in effect until
  131.     changed by a MODE command or by a program.  The serial port settings
  132.     are not locked permanently - programs are free to change them as
  133.     they require.
  134.  
  135. 2.3.  PARALLEL PORT REDIRECTION AND INFINITE RETRIES
  136.  
  137.     MODE allows parallel (LPT) port output to be redirected to a serial
  138.     (COM) port, to NUL (i.e. nothing), and also can retry indefinitely
  139.     if the peripheral fails to respond.
  140.  
  141.     These functions are performed by the resident portion of MODE, which
  142.     will be automatically installed if necessary when the function is
  143.     requested.
  144.  
  145.     The syntax is:
  146.  
  147.     MODE LPTn:P        Infinite timeout on parallel port
  148.     MODE LPTn:=COMx        Redirect printer output to COM port
  149.     MODE LPTn:=NUL:        Redirect printer output to NUL
  150.     MODE LPTn:        Remove redirection and infinite timeout
  151.  
  152.     The LPTn:P function specifies infinite retries on timeout.  If
  153.     this is enabled, MODE will retry continuously if the printer
  154.     fails to respond.  If this is not enabled, and the printer fails
  155.     to respond within a certain length of time (typically about half
  156.     a minute), a write fault error will be reported.
  157.  
  158.     The LPTn:=COMx and LPTn:=NUL: functions specify redirection of
  159.     printer output.  Any parallel port (whether it exists or not) may
  160.     be redirected to any existing serial port, or to NUL.  More than
  161.     one parallel port may be redirected to the same serial port or
  162.     to NUL.  These functions are useful if you have a serial printer,
  163.     or if you have no printer and want to avoid locking up the computer
  164.     if a program attempts to print to a nonexistent printer.
  165.  
  166.     The LPTn: function removes any redirection and infinite timeout
  167.     that may be configured for the specified port, and returns it to
  168.     normal operation.
  169.  
  170. 2.4.  HARD DISK PARK FUNCTIONS
  171.  
  172.     MODE will park the hard disk or hard disks (only the first two
  173.     physical hard disks in the system), either immediately, or after
  174.     the disk has been idle for a period of time.
  175.  
  176.     The timed park function is performed by the resident portion of MODE,
  177.     which will be automatically installed if necessary when the function
  178.     is requested.
  179.  
  180.     The syntax is:
  181.  
  182.     MODE PARK            Park now
  183.     MODE PARK,minutes[:seconds]    Park after hard disk has been idle
  184.  
  185.     The PARK function parks the hard disk(s) immediately and waits for
  186.     you to switch off the computer.  You can also press Ctrl-C to quit
  187.     and return to DOS.
  188.  
  189.     The PARK,minutes[:seconds] function causes the hard disk(s) to be
  190.     parked after a certain period of inactivity, which may be up to
  191.     50 minutes.  If you have two physical hard disks, they are both
  192.     handled separately.
  193.  
  194.     Once set, you can change the time period by executing the command
  195.     again with a different time value.  The timed park function cannot
  196.     be turned off - you must reboot to remove it.
  197.  
  198.     These functions are generally only useful for older machines.
  199.     Modern hard drives park themselves automatically when switched
  200.     off.
  201.  
  202. 2.5.  TYPEMATIC FUNCTIONS
  203.  
  204.     MODE allows the typematic (auto-repeat) initial repeat delay and
  205.     repeat rate parameters to be set, and optionally locked.
  206.  
  207.     The typematic lock function is performed by the resident portion of
  208.     MODE, which will be automatically installed if necessary when the
  209.     function is requested.
  210.  
  211.     The syntax is:
  212.  
  213.     MODE DELAY=d RATE=r        Set typematic parameters
  214.     MODE DELAY=d RATE=r LOCK    Set and lock typematic parameters
  215.  
  216.     d    Specifies the initial delay, the range is 1 to 4 and the
  217.         delay is between 1/4 second (1) and one second (4).
  218.  
  219.     r    Specifies the auto-repeat rate.  The range is 1 to 32 and
  220.         the rate is between two repeats per second (1) and 30 repeats
  221.         per second (32).
  222.  
  223.     LOCK    Specifies that the typematic parameters should be locked.
  224.         Once this is done, the typematic parameters may be changed
  225.         by runing MODE again, but cannot be changed by most other
  226.         programs.  This can be useful, as some programs will change
  227.         the typematic parameters without your permission.  It is
  228.         not completely foolproof, however, and there are several
  229.         things that a program could do which will defeat the locking
  230.         feature of MODE.
  231.  
  232.     Note that both DELAY and REPEAT must be specified for these functions.
  233.  
  234.     MODE does not attempt to confirm that typematic setting is available
  235.     on the machine.  I tried to do this using int 15h function 0C0h and
  236.     int 16h function 9 but it seems that these are not fully supported
  237.     by enough machines to be a reliable indicator.    MODE will accept all
  238.     typematic commands, whether or not the machine actually supports them.
  239.  
  240. 2.6.  SWITCHAR FUNCTIONS
  241.  
  242.     MODE can display and set the DOS switch character (switchar).
  243.     The default switchar is the forward slash, '/'.  The switchar is the
  244.     character that is used to indicate the start of an option switch, e.g.
  245.     the /P switch to the DIR command.  Typically, the switchar may be
  246.     changed to '-'.  The switchar is an undocumented DOS feature that is
  247.     properly supported by few programs.
  248.  
  249.     The syntax is:
  250.  
  251.     MODE SWITCHAR            Display current switchar
  252.     MODE SWITCHAR=x            Set switchar to character
  253.     MODE SWITCHAR=n            Set switchar to ASCII value n
  254.  
  255.     The SWITCHAR parameter by itself causes MODE to display the current
  256.     switchar.  The SWITCHAR= usage sets the switchar.  The new switchar
  257.     may be specified as a character (e.g. 'MODE SWITCHAR=/') or as a
  258.     number (e.g. 'MODE SWITCHAR=45').
  259.  
  260. 3.  GENERAL
  261.  
  262.     Parameters to MODE are not case sensitive.
  263.  
  264.     MODE can only process one command on each invocation.  If you
  265.     want to redirect several LPT ports, you must use a separate
  266.     MODE command for each.    Commands of different types cannot be
  267.     combined on the command line.
  268.  
  269.     Error messages are always sent to StdErr, which is not redirected
  270.     by the DOS output redirection facilities.  Informational messages
  271.     are sent to standard output, and may be redirected to NUL: for
  272.     'quiet' operation.
  273.  
  274.     Errorlevels returned by MODE are as follows:
  275.  
  276.     0    No error
  277.     115    Serial port does not exist (either for COMn: or LPTn:=COMx)
  278.     117    No hard disk(s) found to park
  279.     118    Specified video mode is not supported on this machine
  280.     162    Insufficient memory (MODE requires about 6K of memory)
  281.     241    Parameter out of range (e.g. time value, LPT port number etc)
  282.     242    Cannot have 43-line or 50-line modes with modes other than CO80
  283.     243    Unknown baud rate
  284.     244    Must specify both DELAY= and RATE= for typematic setting
  285.     246    More than one command or command type was given
  286.     255    Incorrect usage syntax (all usage syntax errors)
  287.  
  288.     MODE is a TSR program.    If required, MODE will install part of itself
  289.     resident in the computer's memory.  This resident portion performs
  290.     printer redirection and timeout handling, automatic parking of the
  291.     hard drive, and locking of the typematic parameters, and cannot be
  292.     removed without rebooting (unless the public domain MARK and RELEASE
  293.     programs are used).  If additional resident functions are required
  294.     and the resident portion is installed, MODE will enable those
  295.     functions in the resident portion rather than installing another
  296.     resident portion.
  297.  
  298.     Because MODE is a TSR, it may be incompatible with applications
  299.     or other TSRs you may be using.  If problems occur, try to establish
  300.     which programs are conflicting.  It may be possible to avoid the
  301.     problem by installing the programs in a different order.
  302.  
  303.     If you find a bug in MODE, please inform the author.  The contact
  304.     details are given in section 1 of this document and in the source
  305.     code.
  306.  
  307. 4.  USAGE EXAMPLES
  308.  
  309.     Here is a sample of MODE's usage in AUTOEXEC.BAT, demonstrating all
  310.     features:
  311.  
  312.     mode co80,43            >nul:
  313.     mode com1:96,n,8,1        >nul:
  314.     mode com2:19,n,8,1        >nul:
  315.     mode com3:24,n,8,1        >nul:
  316.     mode lpt1:=com2            >nul:
  317.     mode lpt1:p            >nul:
  318.     mode lpt2:=nul:            >nul:
  319.     mode lpt3:=nul:            >nul:
  320.     mode park,0:30            >nul:
  321.     mode delay=1 rate=32 lock    >nul:
  322.     mode switchar=-            >nul:
  323.  
  324.     This sequence firsts selects 43-line color display mode, then
  325.     configures the serial port parameters for COM1, COM2 and COM3
  326.     (9600, 19200, and 2400 bps respectively, with no parity, eight
  327.     data bits and one stop bit).  These serial port parameters are
  328.     not locked permanently, and another MODE command or another
  329.     program may change these at any time.
  330.     Then, LPT1 output is redirected to COM2, so anything that is
  331.     printed to LPT1 will be sent out COM2 instead, at 19200 bps
  332.     (for example, to a serial laser printer), and LPT2 and LPT3
  333.     are redirected to NUL so that anything that is sent to them
  334.     will go nowhere.
  335.     Then a timed hard disk park is installed, which will park the
  336.     hard disk(s) after 30 seconds of no hard disk activity.
  337.     Finally, the shortest delay and fastest rate for the keyboard
  338.     typematic function is selected and locked, and the DOS switchar
  339.     is set to a hyphen ('-').
  340.  
  341.                    ----//----
  342.