Automatic Drive

Les Ellingham

 

Issue 6

Nov/Dec 83

Next Article >>

<< Prev Article

 

 

 

When you boot-up a commercial disk, it normally goes straight to a title sequence to give you something to look at while the main program loads. You might consider that the programming that goes into the boot-up process too complicated to attempt but you can in fact create your own AUTORUN.SYS file quite easily which is a program that causes the computer to automatically boot-up a program of your choice.

Let's look first at what happens when you boot-up DOS. When you switch on the computer, it is pre-programmed to run through an initialisation process which sets various parameters to enable proper operation of the system. One of the things it tries to do is load the Disk Operating System into memory, providing of course a disk drive is connected and is switched on. If it is successful in loading DOS, one of the next steps in the initialisation is to search the disk used for a file named AUTORUN.SYS and then load bytes from that file into memory culminating with some bytes loaded into addresses $2E0 and $2E1 (736,737). These bytes will give the starting address of the routine contained in the AUTORUN.SYS file. Normally control is passed to Basic, if a Basic Cartridge is present, otherwise to DOS, but you can specify any address in these locations and control will automatically pass to that address. If the address is that of the routine in your AUTORUN.SYS file, then your instructions will be automatically executed. It's as simple as that.

So, all you have to do is write a short Basic program, name it AUTORUN.SYS and put it on your disk? Unfortunately it is not as simple as that, for the AUTORUN.SYS file must be a binary file to be loaded. All is not lost however for those of you who do not understand machine language, for Listing 1 is a Basic program which will create a binary AUTORUN.SYS file for you.

 

AtariLister - requires Java

 

Once you have typed in the program, insert a disk into your drive with DOS.SYS on it and RUN the program. You will be asked for the command you wish to have executed when the disk is booted. Just type RUN "D:MENU" or RUN 'whatever you wish' and press return. The AUTORUN.SYS file will be written on the disk in drive 1 and the next time you boot-up using this disk, the program you have chosen will RUN automatically (provided of course it is on the disk!).

So, what can you use it for? Well, you can have a disk with just one program on it and RUN that program, or a title screen that will then RUN another program, but the most common use is to RUN a Menu which allows you to look through several programs on a disk and RUN the one of your choice by pressing just one key. There are several Menu programs around but most of these use Graphics 0 and some have trouble in squeezing several programs onto the screen. The Menu program presented with this article, uses Graphics 2 for a very pleasing display and is one of the best Menu programs I have seen. It is rather long for a simple Menu, but if you type it in, you will not be disappointed and can upgrade your disks to "automatic drive".

 

One final tip. if you make the first fine of each program on the disk POKE 580,1, the Menu will be booted-up each time you press System Reset.

 

AtariLister - requires Java

 

The Autorun program has appeared in several U.S. user group newsletters, but the author is not specified. The Menu program comes from a disk of Public Domain programs from A.B.A.C.U.S. of California and again the author is not shown.

 

top