Amstrad DDI-1 manual Changing Discs, Store requirements

Page 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

Image 84
Contents Page Amstrad Disc Drive & Interface DDI-1 Amstrad Contents Contents Page Foundations 1 Setting Up Connecting the Mains LeadConnecting the DDI-1 to the Computer Computer Interface Unit Main Disc Drive Drive a Computer Foundations 2 About Discs Write ProtectionOpen Closed When Your Disc Is Indicator Lamp Eject ButtonDrive a disc missing Retry, Ignore or Cancel? Foundations Loading Software/GamesRun rolcave ROLCAVE. not foundBad command Syntax errorDrive a read fail Retry, Ignore or Cancel? Type mismatchFoundations Introducing Amsdos and CP/M Drive B disc missing Retry, Ignore or Cancel Load filenameDisc Tape.inFirst Steps Using The CP/M Disc Storing Data Onto DiscCpm CLS? Back to Amsdos BewareSaving a Program in Memory onto Disc Catalog Loading From DiscEXAMPLE.BAS Copying Programs From Disc to Disc Copying Programs From Cassette to DiscCopying Programs From Disc to Cassette Copying Using the CP/M System Disc Copying Using DisccopyCopying Using Copydisc Copying started Reading track 0 toWriting track 0 to Do you want to copy another disc Y/NChecking Discs AbortingDiscchk ChkdiscInstallation Amstrad Disc Drive & Interface DDI-1 Manual Backup Master Disc Making Working DiscsWorking SYSTEM/UTILITY disc Basic only discTurnkey Amstrad Basic discs DISCCOPY.COMTurnkey Basic using disc supplied Turnkey CP/M DiscsTurnkey Basic onto your Working disc Creating a Turnkey CP/M System discConfiguring a CP/M Program Configuring the Output from the packageAmbiguous filename Confirm individual files Y/N ? Configuring the Input to the package Starting a Turnkey CP/M PackagePayroll Autostarting a Turnkey CP/M Package Amsdos Primer IntroductionDisc Directory Amsdos filenames and filetypesConstruction of Filenames Amsdos headers Filenames on two drivesSave PROG.BAS a Save Bprog .BAS Examples of Using Amsdos Commands in a program Wild cardsSaving variables and performing a Screen Dump BERT.BAS FRED1.BAS FRED2.BAS FRED3.BAK FRED3.BAS FINISH.BASNeat CloseoutReference guide to Amsdos commands Pre-empting a Garbage CollectionWhile not EOF Wend CloseinSummary of Basic commands Summary of Amsdos external commandsSave OPENOUT, Print #9, Write #9, List #9, Closeout CATCPM DIRDisc DISC.INERA RENTape TAPE.INFile Copying procedures Copying FilesAmsdos files with headers Ascii filesFile has a header Amstrad Reference guide to Amsdos Error Messages Drive Drive disc missing Drive Drive disc is write protectedDrive Drive read fail Drive Drive write failCP/M Primer Operating with CP/MCP/M system tracks Configuration Sector Console control codesLogging in a disc Direct Console Commands Switching default drivesDIR command ERA commandTransient commands REN commandType command Peripheral ManagementFile and disc copying Single file copyingWhole disc copiers and checkers Cassette filesSystem Management StatSetup Do you want to update your system disc Y/NStat SECRET.BAS $DIR Is this correct Y/NDisc Generation AmsdosFormat Format D Format I FormatBootgen Advanced programmingMovcpm SysgenAmstrad Disc Drive & Interface DDI-1 Manual What is Logo Introduction to LogoDr. Logo Getting StartedProcedures with parameters Repeat 4 fd 60 rtTo square Repeat 4 fd 60 rt 90 end To squareanysize side repeat 4 fd side rt 90 endUsing Variables to remember values Editing programs and proceduresCs squareanysize 100 rt 45 squareanysize To triangle Repeat 3 fd edge rt 120 endOperating hints Summary of Dr. Logo primitivesWord and List Processing AsciiChar CountEmptyp FirstFput ListArithmetic Operations Logical Operations Not ?= Logo LogoProcedures VariablesEditing Text ScreenSetsplit ShowClean Graphic ScreenType DotPal SetpalWindow Turtle Graphics WrapSeth SetpcWorkspace Management SetposErn NodesRecycle GlistGprop PlistDisc Files Dir LoadSave KEYBOARD, Joystick buttonpPaddle ?paddle 0?make key rc ?keySound EnvEnt ReleaseLabel RepeatRun StopError CatchPause ThrowSystem Properties Technical information for the user Firmware HeadersChanging Discs Store requirementsError Messages Bios messagesAmsdos messages Failed to load boot sector Disc Organisation Common to ALL FormatsJump Block Interception by Amsdos Jump Block Re-Interception by the UserReturn Parameters Intercepted Firmware Calls 132 #BC8C 133 #BC8F 134 #BC92 135 #BC95 #BC98137 #BC9B Page Appendix Glossary of Terms CP/M Dr.Logo Primitives TPA Amstrad Disc Drive & Interface DDI-1 Manual Appendix Term Limitations of Remedies Amstrad Disc Drive & Interface DDI-1 Manual Appendix Index ERA Setpos