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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
SetPatch >NIL: AddBuffers df0: 30 Echo "*NAmiga Startup by *e[033mGiuseppe Portelli*e[0m*N" BindDrivers FF >NIL: -0 ; Speed up text Resident CLI L:Shell-Seg SYSTEM PURE ADD ; Activate Shell Resident C:Execute PURE Resident C:Resident PURE Resident C:List PURE Resident C:cd PURE Resident C:dir PURE MakeDir RAM:T Assign T: RAM:T MakeDir RAM:clipboards MakeDir RAM:env copy S:env RAM:env QUIET Assign CLIPS: RAM:clipboards Assign ENV: RAM:env Path System s Utilities Tools add Echo "Setting *e[0;33mItalian*e[0m Keyboard..." SetMap i Mount NEWCON: DMouse >NIL: -A0 -a1 -w1 FKeys.NewWSH ; window switcher ; Remove the CON: device Assign CON: REMOVE ; Mount the DisplayHandler DHOpts CON:0/0/640/256/New/CLOSE PIP: ; Path completion FComp >NIL: ; Use WShell for execute SetExecute NewWSH "CON://640/256/WShell/CLOSE" FROM S:selector-script QUIET EndCLI >NIL: |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
Execute WShell-startup Echo "Select action:*N" Echo " 1 - Load Workbench" Echo " 2 - Init Lattice C V5.0 enviroment" Echo " 3 - Init Lattice C++ V5.1 enviroment" Echo " 4 - Init SAS C v6.5 enviroment" Echo " Enter - Continue*N" UserChoice Echo "" If Exists ENV:user_selection_1 Echo "Loading Workbench..." LoadWB DELAY EndCli Quit EndIf If Exists ENV:user_selection_2 x DATA:s/lattice-init Echo "" Quit EndIf If Exists ENV:user_selection_3 x DATA:s/lattice-cpp-init Echo "" Quit EndIf If Exists ENV:user_selection_4 x DATA:s/sasc-init Echo "" Quit EndIf |
On line 1 the WShell-startup script is executed which sets a short alias for the Execute command and the prompt format:
1 2 |
Alias x C:Execute prompt "%1R(%r) %3%c%1> " |
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#include <stdio.h> #include <proto/dos.h> int main() { char c; char command[50]; // Clears all the environment variables Execute("delete env:user_selection_? Q", NULL, NULL); while(1) { printf("> "); c = getchar(); if(c == '\n') return 0; if(c < '0' || c > '9') { while(c != '\n') c = getchar(); } else break; } sprintf(command, "SetEnv user_selection_%c %c", c, c); Execute(command, NULL, NULL); return 0; } |
Here is a video showing the boot sequence, some script execution, autocompletion and window switching:
Hi,
Just getting back into Amiga finally after serving for couple decades… Yea been that long.. 🙂
Anyhow, I ran across three commands that I don’t know what they do…
.key DEST
.bra {
.ket }
and they appear at the top of SOME startup-sequences but I have no idea why or what they do.. Can anyone help on this?