home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / utility / strtup15.arc / STARTUP.DOC < prev    next >
Text File  |  1988-03-31  |  20KB  |  487 lines

  1.  .......................................................
  2. /                :                                      \
  3. :   STARTUP.PRG  :  Batch Startup Program Version 1.5   :
  4. :                :      by Murray Levine                :
  5. :                :      CIS # 74435,1015                :
  6. :                :      GENIE ID - MURRAY               :
  7. \................:....................................../
  8.  
  9.         STARTUP.PRG is a Batch Startup program that executes commands
  10. from the file startup.inf upon booting your ST.  STARTUP.PRG must be placed
  11. in the \AUTO\ folder the on boot drive (usually A).  STARTUP.PRG now loads
  12. and runs STARTUP.TOS in order keep the memory less fragmented when loading
  13. memory-resident programs like hard drive drivers and ram disks.  You'll notice
  14. about a 15K difference if using the FREERAM accessory.  It is also possible
  15. to run just the STARTUP.TOS program by changing it's name to STARTUP.PRG and
  16. renaming the original STARTUP.PRG program.  STARTUP first looks for the 
  17. file STARTUP.INF in the same directory and if it can't find it, it tries to
  18. locate it in the main directory (ex. A:STARTUP.INF).  From now on, these
  19. three files can be the only files you need in the AUTO directory because all
  20. other files to be executed can be located in their original drive and folder
  21. and can even have parameters past to them.  You no longer have to make sure
  22. of the order that you copied your files to the AUTO directory because
  23. STARTUP executes programs as they are listed in STARTUP.INF.
  24.  
  25.         The format for programs to be executes is to list the complete program
  26. name followed by any parameters to be passed.  any command or program name
  27. can be followed by a comment.  Any text on a line that follows a ';' will
  28. be treated as a comment.  For example,
  29.  
  30. a:\supboot.prg                  ; Supra Hard Drive driver program
  31. c:\bin\touch.prg a:startup.inf  ; Update time stamp for info file
  32.  
  33. would first load the hard drive driver program supboot,prg from drive A: and
  34. then update the time stamp for the file a:startup.inf.
  35.  
  36.         There are a few unix-like commands that are used in the STARTUP.INF
  37. file as well as some other special commands.  All commands must be in lower
  38. case, however, the file names may be in lower or upper case.  The allowable
  39. commands are as follows:
  40.  
  41. Copy Files:
  42.     cp file1 file2      - copy file1 to file2
  43.     cp file1 ... dir    - copy file1 and other files to the directory dir
  44.  
  45.     The cp command is useful for copying files to a ram disk.  Wildcards
  46.     are also accepted.
  47.  
  48.     cp b:\src\*.c c:\           ; Copy source files to ram disk c:
  49.  
  50.  
  51. Renaming files:
  52.     mv oldfile newfile
  53.  
  54.     The mv command renames the file oldfile to the name newfile.
  55.  
  56.  
  57. Remove files:
  58.     rm file ...
  59.  
  60.     The rm command removes the listed files.  As with cp, wild cards are
  61.     also accepted.  Be careful, though, about doing an   rm *.*
  62.     so you don't wipe out a disk by accident.
  63.  
  64.  
  65. Create directory
  66.     mkdir dir ...
  67.  
  68.     The mkdir command creates the subdirectory dir.
  69.  
  70.  
  71. Remove directories
  72.     rmdir dir ...
  73.  
  74.     The rmdir command removes the specifies subdirectories.  An error will
  75.     occur if the specified subdirectory is not empty or does not exist.
  76.  
  77.  
  78. Display files:
  79.     cat file ...
  80.  
  81.     The cat command displays the listed files on the console.  Useful for
  82.     displaying any title screen information.  Once again, wild cards are
  83.     accepted.  Pressing ctrl-C during the display of a file aborts displaying
  84.     that file and goes  on to the next file if there is one.
  85.  
  86.  
  87. Change directory:
  88.     cd dir
  89.  
  90.     The cd command changes the default directory to either a disk drive or
  91.     a subdirectory.
  92.  
  93.     cd b:       ; changes default drive to b:
  94.     cd b:\auto  ; change to drive b:, subdirectory auto
  95.  
  96.     The cd command is useful if when running programs you don't want to list
  97.     the complete file name (drive and directory) and if the program being
  98.     executed expects to find certain files (data files) in the default 
  99.     directory.
  100.  
  101.  
  102. Display text:
  103.     echo [-in] [-x xpos] [-y ypos] string
  104.  
  105.     The echo command displays the following string (list of words) on the
  106.     screen followed by a carriage return.  If the -n option is used, the
  107.     carriage return is not printed.  If the -i option is used, the string
  108.     is printed in inverse video.  The -x option will position the cursor at
  109.     column xpos and the -y option will position the cursor at line ypos. 
  110.     The echo command is useful for displaying what is happening at 
  111.     different points of the boot process.
  112.  
  113.     As an example, I use the following:
  114.  
  115.     echo -n The time is
  116.     c:\bin\date.prg             ; display the current time
  117.  
  118.     This will display:  The time is Sat Jan 24 1987 12:24pm
  119.  
  120.  
  121. Setting variables
  122.     set var = string    - set variable var to string
  123.     set var = $<        - set variable var to a string entered from keyboard
  124.     set var = $<<       - set variable var to one character from keyboard
  125.     set                 - display all variables
  126.  
  127.     The set command allows the user to set up to 20 variables whose variable
  128.     names can be up to 8 characters in length.  If string is to be more than
  129.     than one word then it should be in quotes, e.g. "This is a string".  If
  130.     the string is $<, then the variable waits for a string to be entered from
  131.     the keyboard.  If the string is $<<, then the variable waits for a single
  132.     key to be hit on the keyboard.  This string can then be tested later using
  133.     the if command.  Using set without any arguments will display all of the
  134.     variables and the string values associated with them.
  135.  
  136.  
  137. Accessing variables
  138.     To get the value of a string, a $ is placed in front of the name, for
  139.     example:
  140.         set test = "This is a test"
  141.         echo $test
  142.     This will display the value of variable test.
  143.  
  144.     Variables representing file names can also have suffixes.  The suffixes
  145.     supported by STARTUP are:
  146.                 :h      - head - returns path name of file
  147.                 :t      - tail - returns file name without path name
  148.                 :r      - root - returns file name without extension
  149.                 :e      - extension - returns file name extension
  150.  
  151.     For example:
  152.         set file=c:\startup\startup.prg
  153.         echo $file:h            => c:\startup
  154.         echo $file:t            => startup.prg
  155.         echo $file:r            => c:\startup\startup
  156.         echo $file:e            => prg
  157.  
  158.  
  159. Conditional statements
  160.     if (expression) then
  161.         commands
  162.     endif
  163.     if (expression) then
  164.         commands
  165.     else
  166.         commands
  167.     endif
  168.  
  169.     The if command is used to test the validity of the specified
  170.     expression.  If the expression is true, the commands following the
  171.     then statement will be executed.  An optional else statement can be
  172.     used if the expression is false.  The if command must end with the
  173.     endif statement.  There can be as many as 9 nested if statements,
  174.     however be sure that there are enough endif statements to match them.
  175.     The expression has two forms.  They are:
  176.  
  177.         (string1 condition string2)
  178.         (option file name)
  179.  
  180.     In the first form, string1 and string2 can be either strings or variables.
  181.     The possible conditions are as follows:
  182.  
  183.         ==      is equal to
  184.         !=      is not equal to
  185.         <       is less than
  186.         >       is greater than
  187.         <=      is less than or equal to
  188.         >=      is greater than or equal to
  189.  
  190.     An example of this form of the  if command would be:
  191.         echo -n Enter your name
  192.         set name = $<
  193.         if ($name == Murray) then
  194.             echo Sysop Murray is on-line
  195.         endif
  196.  
  197.     In the second form of the expression, option has the following values:
  198.  
  199.         -e      - existence - does the file exist?
  200.         -d      - directory - is the file a subdirectory?
  201.         -f      - normal    - is the file not a directory?
  202.         -w      - writeable - is the file writeable (not write protected)?
  203.         -z      - zerosize  - is the file size zero bytes (empty file)?
  204.  
  205.     An example of this form of expression is the following:
  206.  
  207.         if (-e startup.inf) then
  208.            echo startup data file exists
  209.         endif
  210.  
  211.  
  212. Exiting the command file
  213.     exit
  214.  
  215.     The exit command breaks out of the command file (startup.inf) and 
  216.     the Startup program itself.  This command is most likely used in
  217.     an if statement.
  218.  
  219.  
  220. Labels and branching
  221.     goto label
  222.  
  223.     The goto command branches control to the defined label.  A label is
  224.     represented by the first word and only word on a line and the last
  225.     character must be a colon (:).  A maximum of 10 labels can be defined.
  226.     Here's an example:
  227.  
  228.         echo Let's jump to a label
  229.         goto label1
  230.         echo This line should never get executed
  231.         label1:
  232.         echo control continues with this statement
  233.  
  234.  
  235. I/O redirection
  236.  
  237.     I/O can be redirected to or from any file or to the RS232 port or printer
  238.     port.  By placing a > at the end of the command line followed by a 
  239.     file name, output will be redirected to that file name erasing that file
  240.     if it previously existed.  By placing a >> at the end of the command line
  241.     followed by a file name, output will be appended to that file name if
  242.     the file exists or a new file will be created if it does not exist.
  243.     Input can also be redirected by placing a < at the end of the command
  244.     line followed by the name of the file to be used for input.  This can
  245.     be useful if you have Michtron't MDISK ram disk and want to set up a
  246.     specific size ram disk automatically without user interaction.  Just 
  247.     create a two line file with the ram disk size on the first line and an
  248.     empty line for the second line.  Both input and output redirection can
  249.     be used on the same line, for example:
  250.  
  251.         a:\mdisk.tos < mdisk.inp > mdiskout
  252.  
  253.     This will create a ram disk with the size specified in the file mdisk.inp
  254.     and send all output to the file mdisk.out so you don't have to see
  255.     everything that is happening.
  256.     Output can also be redirected to the RS232 port by using aux: as the
  257.     output file name or use prt: to redirect output to the printer port.
  258.     For example:
  259.  
  260.         echo ATL1 > aux:
  261.  
  262.     This will send the ATL! to a Hayse modem, for example, to initially set
  263.     the volume to low.
  264.  
  265.     
  266. The special commands used by Startup are as follows:
  267.  
  268. Use medium or low resolution:
  269.     res medium
  270.     res low
  271.  
  272.     The res command will set a color system to medium resolution or low
  273.     resolution during the boot process.  On monochrome systems this command
  274.     has no effect.
  275.  
  276.  
  277. Turn the cursor on or off:
  278.     cursor on
  279.     cursor off
  280.  
  281.     The cursor command turns the cursor on or off again.  Since during the
  282.     boot process TOS doesn't turn on the cursor, you can now see where the
  283.     cursor is for entering text.  You can even turn it back off again after
  284.     running a certain program if you wish.
  285.  
  286.  
  287. Turn the keyclick on or off:
  288.     keyclick on
  289.     keyclick off
  290.  
  291.     The keyclick command turns off the keyclick if you get annoyed by it
  292.     while entering input and let's you turn it back on if you want after
  293.     running a certain program.
  294.  
  295.  
  296. Turn disk write verify on or off
  297.     verify on
  298.     verify off
  299.  
  300.     The verify command turns on or off the disk write verify switch.  When
  301.     the switch is on, a verify the data being written to disk will be
  302.     verified to determine if it is valid.  When the verify switch is off,
  303.     the data being written to disk is not verified and speeds up disk
  304.     write time.
  305.  
  306.  
  307. Clear the screen:
  308.     clear [-a]
  309.  
  310.     The clear command clears the screen and places the cursor in the upper
  311.     left hand corner.  If graphics are on the screen, the screen is cleared
  312.     starting at the first text line and the cursor is also placed at the
  313.     the first text line.  This can be followed by the cat command to display
  314.     a title page.  If the -a option is used, all of the screen is cleared
  315.     including the graphics.
  316.  
  317.  
  318. Display of each line
  319.     display on
  320.     display off
  321.  
  322.     The display command turns on or of the display flag.  When the display
  323.     is on, the each line will be displayed in full including comments until
  324.     the display is turned off.  The default is display off.
  325.  
  326.  
  327. Ask if program should be run
  328.     ask file name [arg ...]
  329.  
  330.     The ask command asks the user if he wishes to run the program denoted
  331.     by file name.  The output is as follows:
  332.         Execute autotime.prg (Y/N)? 
  333.     Typing a Y will execute the program, any other key will skip the
  334.     execution of the program.  This can be useful for example if a user
  335.     does not wish to load GDOS when he boots up, but wishes to load GDOS
  336.     the next time he boots the system.
  337.  
  338.  
  339. Ask which desk accessories should be loaded
  340.     accask
  341.  
  342.     The accask command will go through all of the desk accessory programs
  343.     in the default directory and ask if each should be loaded.  For example:
  344.         Load accessory FREERAM (Y/N)? 
  345.     You are prompted for a single-key response being either Y or N.  If you
  346.     press Y, then the accessory will be loaded when the desktop is run.  If
  347.     you press N or any other key, the accessory will not be loaded.  
  348.     Remember that GEM has a maximum number of accessories that can be loaded
  349.     so it will only load as many as it can even if you specify to load more.
  350.  
  351.  
  352. Case sensitivity
  353.     upper varname       - force variable varname to upper case
  354.     lower varname       - force variable varname to lower case
  355.  
  356.     The upper and lower commands force the value of variable varname to
  357.     upper or lower case.  Varname must be an existing variable and must
  358.     not be preceded by a $ since we just want the name of the variable.
  359.  
  360.  
  361. Display graphics title screen
  362.     graphics lines file
  363.  
  364.     The graphics command will load an uncompressed Degas picture (file)
  365.     on the screen up to text line lines.  Lines represents the first line
  366.     on the screen to be used as text (0 - 23).  All text will scroll below
  367.     the picture so it will not be disturbed.  You won't be able to display a
  368.     full-screen picture because we have to have room for some text on the
  369.     screen (at least 2 lines).
  370.  
  371.  
  372. Setting the time and date
  373.     date
  374.     time
  375.  
  376.     The date and time commands are used to set the system time.  the date
  377.     command will display "Enter current date 00/00/00" with the cursor
  378.     positioned on the first 0.  The date is to be entered in mm/dd/yy format
  379.     and as soon as the last digit of the year has been entered, the date
  380.     is automatically set (no RETURN key is needed) so be sure your date is
  381.     in this exact format.  Teh time command will be the same except that
  382.     you enter the time in hh:mm format where the hours are in 24-hour format.
  383.     The seconds will be set 00.
  384.  
  385.  
  386. Changing colors
  387.     color n value
  388.  
  389.     The color command allows you to change the colors in the color registers
  390.     where n is the color to change (0-15) and value represents a 3-digit
  391.     value with each digit ranging from 0 to 7 representing in order the
  392.     amount of red, green, and blue to be used.  For example:
  393.         color 1 007     - sets color register 1 to all blue
  394.         color 0 777     - sets color register 0 to white
  395.         color 2 000     - sets color register 2 to black
  396.  
  397.  
  398. Selecting foreground and background color for text
  399.     foreground color
  400.     background color
  401.  
  402.     The foreground command sets the foreground color for all text to be
  403.     color register n while the background command sets the background
  404.     color for all text to be color register n.  Do not set both the
  405.     foreground and background colors to the same color or you will not
  406.     be able to see any text.
  407.  
  408.  
  409. Resetting colors
  410.     resetcolors
  411.  
  412.     The resetcolors command resets all the colors to their original values
  413.     and also resets the foreground and background colors.
  414.  
  415. SET Desktop File                                                         (new)
  416.     setdesktop
  417.  
  418.     The setdesktop command will allow multiple desktop files to be used
  419.     instead of the standard DESKTOP.INF file based on the screen resolution
  420.     at the time of exiting from startup.  If the computer is booted on a
  421.     monochrome system, the file DESKTOP.HI will be loaded instead of
  422.     DESKTOP.INF.  If booted in medium res, the file DESKTOP.MED is used, and
  423.     if booted in low res, DESKTOP.LOW will be used.  This command will only
  424.     work if the loader program (STARTUP.PRG) is used to load STARTUP.TOS.
  425.     If this command is not present, then the regular DESKTOP.INF file will
  426.     be used.
  427.  
  428. System variables
  429.     $res        - contains the screen resolution ("low","medium","high")
  430.     $desktop    - contains the screen resolution in the desktop.inf
  431.                   file ("low","medium","high").  If the desktop.inf
  432.                   file does not exist, the variable is set to "none". 
  433.     $cwd        - current working directory or path name
  434.     $date       - displays system date in format 01/01/87
  435.     $date1      - displays system date in format 01-Jan-87
  436.     $date2      - displays system date in format Jan 01 1987
  437.     $time       - displays system date in format 12:00:00
  438.     $time1      - displays system date in format 12:00 pm
  439.     $alt        - if the alternate key is pressed, the variable is set   (new)
  440.                   to "on", otherwise it is set to "off"
  441.     $shift      - if the shift key is pressed, the variable is set       (new)
  442.                   to "on", otherwise it is set to "off"
  443.     $control    - if the control key is pressed, the variable is set     (new)
  444.                   to "on", otherwise it is set to "off"
  445.  
  446. The following sample startup.inf file is the one I currently use during my
  447. boot process.
  448.  
  449. res medium                      ; Use medium res when booting in color
  450. if ($res == high) then
  451.   graphics 12 c:\auto\title.pi3 ; Display the Opening Screen
  452. else                            ; if color screen, set up colors
  453.   color 1 007                   ; set background to blue
  454.   foreground 0                  ; use white characters
  455.   background 1                  ; on a blue background
  456. endif
  457. cursor on
  458. display on
  459. d:\rtx\rtxboot.prg              ; Micro RTX kernal
  460. d:\utility\hdaccel.prg          ; Hard Disk Accellorator
  461. d:\utility\autotime.prg         ; Logikhron Clock Card time retriever
  462. display off
  463. if ($alt == "off") then         ; if alt key pressed, don't load laser driver
  464.   c:\laser\diab630.prg
  465. endif
  466. if ($res != $desktop) then
  467.   echo copying desktop.inf for $res resolution
  468.   if ($res == high) then
  469.     cp c:\desktop.hi c:\desktop.inf
  470.   else
  471.     cp c:\desktop.med c:\desktop.inf
  472.   endif
  473. endif
  474. echo The date is $date and the time is $time
  475. cat c:\lastdate                 ; show last time on system
  476. echo Last time on was $date2 at $time1 > c:\lastdate
  477.                                 ; update last time on system
  478. ask e:\degelite\auto\gdos.prg   ; GDOS 1.1 for Degas Elite
  479. c:\mdisk.tos < mdisk.inp > mdisk.out    ; set up predetermined size ram disk
  480.                                         ; and don't let me see it
  481. echo ATL1 > aux:                ; send initialize string to modem for volume
  482. accask                          ; which accessories to load?
  483.  
  484. Any comments or suggestions for a future version are welcome.
  485.  
  486.                 Murray Levine   CIS # 74435,1015
  487.