AmigaDOS | Scripting

AmigaDOS Part II – Startup Sequences

Posted on by
Leave a reply

The Amiga startup-sequence is a script file located inside the S: logical device (usually SYS:s) and executed at boot time. This script is responsible for system initialization: patching the rom, adding disk buffers, loading drivers and mounting devices, launching services, making assigns, creating ram folders..

My 1.3 startup-sequence

For my Amiga 500 configuration (on WinUAE) I’m using two hard disks, one for workbench and the other for programs and data. The primary use of this setup is for coding and the main apps installed are the Lattice (C v5, C++ v5.1) and SAS/C (v 6.5) compilers. At the end of my custom startup-sequence I inserted a prompt where the user can make a choice: starting the workbench, initing the environment for one of the installed compilers (making the assigns and updating the path) or do nothing and continue with the shell.

Here is my 1.3 startup-sequence:

Let’s see the interesting lines:

Line 35:  DMouse >NIL: -A0 -a1 -w1 Here I’m launching DMouse v1.09[a], a mouse accelerator, auto window activator and much more.

Line 37:  FKeys.NewWSH ; window switcher Starting the FKeys v1.1[b], a sort of tab-switcher  which adds window and screen switching functions to the function keys in conjunction with the left Amiga key.

Lines 39-51: In these lines I’m launching the WShell 2.0[c] console handler and its tools. First I replace the CON: handler with the WShell DisplayHandler: in line 40  Assign CON: REMOVE I remove the CON: device, then in line 43 DHOpts CON:0/0/640/256/New/CLOSE PIP: I mount the WShell handler. In line 46 FComp >NIL: I start the Filename Completion tool and in line 49  SetExecute patches the AmigadDOS Execute command to use the WShell environment when invoking a shell script. Finally, in line 51  NewWSH "CON://640/256/WShell/CLOSE" FROM S:selector-script QUIET a new WShell is created using S:Selector-script as startup.

Let’s see the selector-script contents:

On line 1 the WShell-startup script is executed which sets a short alias for the Execute command and the prompt format:

On line 10 the UserChoice command is called. It’s a little C program that I wrote for user interaction inside a script. It reads a number (0-9) from the standard input and sets an environment variable (user_selection_<n>) according to the number written. Then in the selector-script I simply check the existence of the corresponding file for each environment variable in the ENV: folder.

Here is the source of the UserChoice command:

Here is a video showing the boot sequence, some script execution, autocompletion and window switching:

Notes

  1. DMouse v1.09 on Aminet (Fish disk 160) []
  2. FKeys v1.1 on Aminet (Fish disk 562) []
  3. WShell 2.0 description on Aminet (txt) – WShell 2.0 documentation (PDF)  []

Leave a Reply