FileCore disc check


Contents


Introduction and Overview

FileCore discs are generally resilient and secure. However, if the machine crashes, or is rebooted without safely being shut down, it is possible that data may not be written to the disc. This this happens, the disc may exhibit faults (for example 'Broken directory'). This is one reason why it is very important to ensure that the machine is shut down correctly.

FileCore disc check is performed through the utility Boot:Utils.FileCoreCk. This uses the system choices to determine the operations to perform when the machine has booted after an unclean shut down.

The actual operation of FileCoreCk is configurable, but defaults to running checkmap on each FileCore disc.


Technical Details

Invocation during bootup

When the machine is booted, a flag is set in the non-volatile memory (CMOS) to indicate that the system is in an indeterminate state. When shut down correctly, Task Manager will clear this flag.

During the boot sequence, this flag is read (by Boot:Utils.BootVars) and used to set the system variable Boot$ShutdownState. After the Choices environment has been set up, this is checked and if it indicates that an unclean shutdown had been performed, the Boot:Utils.FileCoreCk is run.

Configuration

FileCoreCk may be configured to function in a number of ways. The configuration file Choices:FileCoreCk is read if it exists. If this file does not exist, then the check is skipped.

This file takes the form of a colon separated list of tag/value pairs which determines how FileCoreCk should function.
TagMeaning
Enabled true indicates that the checks should be performed. Any other value will prevent the checks being run.
Command Declares a command to be executed for the drives being checked. The command should take the form of a substituted string, similar to that used for aliases (see OS_SubstituteArgs). Parameters passed to the command are :
ParameterContents
0FileCore filesystem to check. This is the name of the filesystem as provided by the FileCore instantiation name. It may not be the same as the SWI name interface.
1Drive number to check. Only harddiscs will be considered for automatic checks, therefore this is guarenteed to be 4 to 7.
<filesystem> ignore declares that the filing system specified should not be automatically checked. This allows specific filesystems to be excluded from the checks, for example, if it is a slow access system, or protected such that it may never be written to.
<filesystem>-<drive> ignore declares that the drive and filing system specified should not be automatically checked. This is a more specific version of the above. This might be useful if the drive specific is not likely to have been written to.

Execution order

FileCoreCk looks first at FileCore filesystems. Filesystems are examined in the order they appear in the instantiation list, which means that ADFS will come first, followed by podule filesystems from the lowest numbered podule upwards.

For each filesystem, it processes each drive starting at 4 and counting up.

Example configuration

The default configuration is as follows :

Enabled:true
Command:%0:CheckMap %1

This causes every drive present to have the *CheckMap issued for it.

User intervention

During execution of commands Escape is enabled. When the command completes, Escape is returned to its previous state. This means that during the boot sequence - where escape is normally disabled - the user may still terminate a check of a particular drive with Escape if they wish.

It follows from this that disc check commands should explicitly disable Escape around any critical sections whose interruption would cause a serious loss of data. Commands may also disable break actions for this period, and restored once the criticial section has been left. OS_Byte 229 can be used to disable Escape, and OS_Byte 246 can be used to disable the break key.


*Commands


*Boot:Utils.FileCoreCk

Initiate a check of all FileCore discs
Syntax
*Boot:Utils.FileCoreCk
Parameters
None
Use

This command is used to start an automated check of FileCore drives. It is not expected that this command be used by anything other than the Boot system.

Example
*/Boot:Utils.FileCoreCk
Related * commands
*CheckMap

Document information

Maintainer(s): RISCOS Ltd <developer@riscos.com>
History:
RevisionDateAuthorChanges
1ROLInitial version
Disclaimer:

Copyright © Pace Micro Technolgy plc, 2002.
Portions copyright © RISCOS Ltd, 2002.
Published by RISCOS Limited.
No part of this publication may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, or stored in any retrieval system of any nature, without the written permission of the copyright holder and the publisher, application for which shall be made to the publisher.