Amstrad DDI-1 manual Changing Discs, Store requirements

Models: DDI-1

1 103
Download 103 pages 20.5 Kb
Page 84
Image 84

Unprotected ASCII files do not have headers. All other AMSDOS files have a single header in the first 128 bytes of the file, the header record. These headers are detected by checksumming the first 67 bytes of the record. If the checksum is as expected then a header is present, if not, there is no header. Thus it is unlikely, but possible, that a file without a header could be mistaken for one with a header.

5.2 Changing Discs

Under AMSDOS a disc may be changed, or removed, whenever the drive is not being accessed and neither the input nor output files are open on that drive. Unlike CP/M there is no need to 'log in' a disc.

Changing a disc while it is still being written to may corrupt the data on the disc. If a disc is changed while there are still files open on it then, as soon as AMSDOS detects this, all the open files on the drive will be abandoned and an error message produced. Any data yet to be written will be lost and the latest directory entry will not be written to disc. However, AMSDOS can only detect this change when it reads the directory, which it does every 16k of the file and whenever a file is opened or closed. Thus, potentially, 16k of data could be corrupted by changing a disc while there are still files open on it.

5.3 Store requirements

When initialised, AMSDOS reserves #500 bytes of memory from the memory pool. No change in this value is envisaged.

When loading a machine code program from disc into store using AMSDOS's CAS IN DIRECT routine it is important that AMSDOS's variables are not overwritten. This presents a problem since in general it is not possible to discover where these variables are! This is because variables for external ROMs are allocated dynamically. Note that this problem does not arise when loading from the cassette since the cassette manager's variables are in the firmware variable area.

AMSDOS reserves store from the top of the memory pool so the simplest solution is to always load machine code programs into the bottom of store. The program can then relocate itself to a higher address if required.

Alternatively the machine code program could be loaded in two stages: first load and run a small loader in the bottom of store. The action of MC BOOT PROGRAM will have shut down all RSXs and extension ROMS. The loader program should now initialise AMSDOS using KL INIT BACK thus forcing the AMSDOS variables to be wherever you so wish. The loader can now load the machine code program using the AMSDOS routines CAS OPEN IN, CAS IN DIRECT and CAS IN CLOSE together with MC START PROGRAM.

In order to initialise AMSDOS using KL INIT BACK, AMSDOS's ROM number is required. To determine AMSDOS's ROM number look at any of the intercepted cassette jumpblock entries with the DISC routines selected. Each entry is a far call, the address part of which points at a three byte far address, the third byte of the far address is the ROM number. This must obviously be done before AMSDOS is shut down.

AMSTRAD Disc Drive & Interface DDI-1 Manual

Chapter 5.2

Page 84
Image 84
Amstrad DDI-1 manual Changing Discs, Store requirements