WHAT HAPPENS WHEN YOUR AMIGA STARTS UP   ======================================   by Paul Hayter Ed: This is a terrifically useful piece by the author of Whizzo_II (MD26) and ZShell a tiny, full-featured CLI Shell on MD25 and other hand-crafted software. This will clarify all those wonderings about screen colour changes, what files you need on a Workbench disk, what happens during a startup-sequence, and much more. Required reading for all but experts!  (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) Ever wondered what your Amiga does after you reset it? Maybe you just want to know what files and directories the Amiga needs to have on a bootable disk. Well, that's what this article is about. I don't claim to have all the answers or that all my answers are absolutely correct since I'm not working from any official documentation. But I think this should help a lot of users out. Note, all this information pertains to V1.2 and V1.3 of the operating system as I do not have access to V2.0. 1. You've just pressed RESET (Ctrl-A-A). There is no disk in DF0:. The workbench hand is sitting there. So you insert a BOOTABLE disk. The next thing the Amiga does is read the BOOTBLOCK. These are the first two SECTORS on Track zero (furthest away from the centre). Each sector holds 512 bytes, so the bootblock is 1024 bytes long. What the normal bootblock contains is some header information followed by a small program which initiates the booting of the system. This program is only about 30 bytes long which partly explains how programmers can fit diskcopiers, scrolling messages, and utilities like my WhizzoBoot into a bootblock. You can also get bootblocks which do not have any code at all. And these are your DATA disks which do not boot at all. 2. The bootblock has been read. The drive light goes off momentarily followed by some drive activity and then the initial CLI window appears. So what is the Amiga doing before the CLI window appears? Firstly, (I think) the first sector on track 40 (block 880 decimal) is checked. This is called the ROOT BLOCK. It is called this as it is the root of the disk's directory structure. It contains the name of the disk, the creation date, a (partial) list of where to find the rest of the directory and file information, and (like all blocks) a CHECKSUM. If this checksum is incorrect, or the Amiga is unable to read track 40 (read/write error?) you will get a SYSTEM REQUESTER which says something like "Block 880 corrupt " followed by a requester which tells you to use DISKDOCTOR (which probably wouldn't work anyway). OK, let's say block 880 reads OK. 3. Now we get to the stage where the Amiga needs to read specific files off the disk. But before this happens, various LOGICAL ASSIGNMENTS are made (like the ASSIGN command). If there is a C directory in the root of DF0: then this gets assigned to the logical device C:. If there is a DF0:L directory, then that gets assigned to L:. This continues for DF0:DEVS -> DEVS: , DF0:LIBS -> LIBS: , DF0: -> SYS: DF0:S -> S: and DF0:FONTS -> FONTS:. If any of these directories are missing, the assignment is made to DF0: (ie. If there is no DF0:FONTS then DF0: -> FONTS:). The files to read in are taken from these assignments. I don't have a clue as to what order this happens in but L:DISK-VALIDATOR, DEVS:SYSTEM-CONFIGURATION and eventually S:STARTUP-SEQUENCE is loaded.  So what does each of these do? The DISK VALIDATOR is an Amiga task which hangs around checking that the structure of a disk is OK. It is usually invoked (automatically) after a file is written to a disk. I think it may even be optionally loaded at startup. But if you are going to do anything that involves writing to a disk then you should have the disk-validator in L. The SYSTEM-CONFIGURATION is a small file which contains important information about how you want your system configured. It contains the screen colour settings, screen placement, the design for the mouse pointer, printer settings etc. It contains everything that you can set from the Preferences program on your WorkBench disk. In fact when you select save from Preferences, it just saves the file DEVS:SYSTEM-CONFIGURATION. I have noticed on some disks that the SYSTEM-CONFIGURATION sits in the root directory. This is only possible if there is no DF0:DEVS directory for the Amiga to make the initial DEVS: assignment to. The system-configuration is also optional. If it is not on your bootdisk, then a DEFAULT system-configuration is used. This translates to 60 column text mode, with the standard white text on a blue background. The STARTUP-SEQUENCE is a standard ASCII text file which contains a sequence of commands you would like executed at startup. Most of these commands will sit in the C: directory. This is possible because the default Amiga SEARCH PATH is the current directory followed by C:. You can, of course, prefix a command name with a directory specification if it is not in the current search path. eg. df0:bin/dmouse (rather than just dmouse) Speed-up In fact, by prefixing all commands in your startup-sequence with their proper directory specification you can startup faster. The theory is that if all your commands are in C:, the Amiga will try to find them in DF0: first (wasting time) before it checks C:. eg. C:ADDBUFFERS DF0: 25 C:ADDBUFFERS DF1: 25 The startup-sequence is also optional. The CLI prompt will just pop up waiting for your commands, if it's not there. There is one important command to put in a startup-sequence if you intend to use the Amiga from the WorkBench (as opposed to the CLI). This is the LOADWB command. In fact you could have this as the only line in your startup-sequence, and have a perfectly useable WorkBench. LOADWB Of course, it is more typical to have the ENDCLI command following LOADWB so that the CLI window is closed. If there is no ENDCLI you will always have the CLI window active at the end of the startup-sequence. However, with the one line startup-sequence above, all you have to do is RESIZE the CLI window to get access to the icons (and you have a CLI window available all the time). 4. OK, you've now booted up successfully. There are still a whole bunch of files on your bootdisk which may be loaded depending on what you do. L:RAM-HANDLER. This will only be loaded when you make your FIRST reference to RAM:. And as RAM: is very useful I would recommend that you keep this on your bootdisk. You may have noticed the line: DIR RAM: in the standard startup-sequence (The one on your original Workbench disk). Logically, when the Amiga boots there is nothing in RAM: (RAM: is erased on reset), so what's the point? Firstly, it makes sure L:RAM-HANDLER is loaded in, and an offshoot of this is that it allows you to see a RAM: disk icon on the WorkBench. DEVS:SERIAL.DEVICE. This is only used when a (well-behaved) program uses the serial port on the Amiga. If you do not use the serial port then there is no point in having it. However, if you use a MODEM or serial printer then you will definitely use it. DEVS:PARALLEL.DEVICE. This is only used if your program uses the the parallel port. Again if you never use it, you don't need it. DEVS:PRINTER.DEVICE. This is only used if you use a printer on your Amiga. It will also need either the PARALLEL.DEVICE or SERIAL.DEVICE depending on whether your printer plugs into the parallel or serial port. And if you do have a printer, you will also need a suitable printer driver for it in the DEVS:PRINTERS directory. L:PORT-HANDLER. You probably don't need this. It is only loaded when you use the SER: or PAR: or PRT: devices from AmigaDOS. eg. Say you have a terminal connected to your serial port and you type: copy paul.doc ser: Of course you will also need the corresponding DEVICES in the DEVS: directory for these to work. LIBRARIES There are heaps of these and they live in the LIBS: directory. You will also find programs which require you to install their own custom library in LIBS:. In fact, this is an area, where a lot of users will become frustrated simply because a program will not run due to a library being unavailable. NB: These libraries will only be loaded when a program asks for them, and they will usually sit in memory such that any further calls to the library do not require the reloading of the library. COMMODORE-AMIGA LIBRARIES LIBS:DISKFONT.LIBRARY. This will only be used if a program requires access to disk based fonts (eg. Wordprocessors, Paint programs). LIBS:ICON.LIBRARY. If you use workbench, you need this. It handles a lot of icon related stuff, such as an icon parameters. LIBS:INFO.LIBRARY. This is only loaded when you select INFO from the WorkBench main menu. LIBS:MATHTRANS.LIBRARY. This library and all the other math libraries are only used by programs which use floating point arithmetic. Generally, these are ray-tracers, spreadsheets, calculators or anything requiring complex arithmetic. LIBS:TRANSLATOR.LIBRARY. This is only used for programs which make the Amiga talk. THIRD PARTY LIBRARIES There are heaps of these. Usually, the library will come with the program you want to use, so all you have to do is install it in the LIBS directory. I hope all this helps. If you have any comments or criticisms, please send them to Megadisc or to myself at the address below. Paul Hayter PO Box 331 Ballina 2478 Australia.  (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 )) (( 27 ))