Archimedes Disc Rescue Documentation (v1.00)
------------------------------------
copyright  LOOKsystems 1991

All rights reserved.  Neither the whole nor any part of the documentation 
contained on this disc may be adapted or reproduced by any means 
electronic, mechanical, or otherwise except with prior written permission 
from the publisher, LOOKsystems.
 
Recovering a file or directory
------------------------------

A corrupted file or directory can easily be recovered using the !Recover 
application.  Once the Recover application has been run, drag the ailing 
file or directory onto the Recover icon on the right hand side of the 
iconbar.  A save window will then open.  To start the recovery process, 
just save the file or directory from this window onto a fresh disc (cf. pp 
47-48 of the RISC OS User Guide). Single floppy disc owners should save
their recovered files onto a RAM disc. (cf. pp 43-44 of the RISC OS User
Guide).

Undeleting a file or directory
------------------------------

Undeleting a file (or directory) on the Archimedes is not as easy as on MS-
DOS based machines.  This is because the information which locates the file 
on the disc is removed when it is deleted.  Therefore, to undelete a file 
you must first discover where the file is on the disc.  This can be done 
using the !DiscEd application, either by searching through the disc 
manually or by using the find facility to locate a distinctive piece of 
text or hexadecimal contained in the file (These functions are described 
later).

Having found the file on the disc, you can easily extract it onto a fresh 
disc by using the !Recover application.  Once the application has been run, 
click on the Recover icon on the right hand side of the icon bar.  A window 
will then open.

First, choose the appropriate filing system from the menu that will appear 
when you click on the filing system box and then type the appropriate drive 
number followed by <return>.  At this point the Archimedes will attempt to 
access the specified drive to find out whether there is a disc present or 
not.

If this is successful, you should then type (in hexadecimal) the start 
address and the end address (or the file length).  If a valid set of 
address have been given then the save icon and filename will be unshaded 
and the deleted file can then be saved from the Recover window onto a fresh 
disc. Single floppy disc owners should save their recovered files onto a
RAM disc. (cf. pp 43-44 of the RISC OS User Guide).

The process described above can be a little more complicated if you are 
undeleting a file on an E format disc.  This is because files stored on E 
format discs can sometimes be fragmented, although this does not happen 
very often.  If this is the case, you will have to search for the 
individual pieces of the file and recover them separately.

It is also possible to set the file type of the file that is being 
recovered.  Just click in the file type box and enter the appropriate file 
type e.g. 'FFF' or 'Data', 'Sprite', etc.  An additional file type has been 
added to indicate that the 'file' to be recovered is in fact a directory.  
In which case you can type either 'dir' or 'directory'.

Because of the way that E format discs work, it is not possible to extract 
deleted directories from them.  Instead you must recover each of the 
individual files contained in the deleted directory.

Fixing a broken or corrupt directory
------------------------------------

A broken or corrupt directory can be quickly fixed using the !RepairDir 
application.  Once this application has been run, just drag the ailing 
directory onto the RepairDir icon on the right hand side of the iconbar.  
The root directory can be repaired by choosing the appropriate filing 
system and drive number from the RepairDir iconbar menu ie. click the MENU 
button on the RepairDir icon. A window will then open.

The window displays the first entry in the directory.  You can scan through 
the other entries by clicking on the raised arrows in the bottom left hand 
corner of the window.  You can also alter any entry's details should they 
be incorrect  just click on the appropriate box, type in the alteration 
and then press <return>.

Discs that support new format directories (D & E format) often keep two 
copies of the directory entries (so long as there is less than 38 entries 
in a directory).  The RepairDir will sift through both copies of the 
directory entries.  If the copy is different from the original, both copies 
of the entry will be included for editing in the RepairDir window.  Often 
only one copy will be corrupt, in which case you should remove the corrupt 
entry by choosing the 'Delete' option from the RepairDir window menu ie. 
click the MENU button over the RepairDir window.

Once you are satisfied that all the directory entries are correct you can 
write the repaired version of the directory to the disc by choosing the 
'Repair' option from the RepairDir window menu.

PLEASE NOTE: This process is not reversable!  You should be absolutely sure 
that all the entries are correct before writing to the disc. It would be 
best to recover as much data using !Recover application before attempting 
to repair a directory.  You can cancel a directory repair by choosing the 
'Abort' option from the RepairDir window menu.

Fixing a bad disc map
---------------------

A bad disc map can be easily fixed using the !FixMap application.  Once the 
application has been run, just choose the appropriate filing system and 
drive number from the FixMap iconbar menu ie. click the MENU button on the 
FixMap icon on the right hand side of the iconbar.

There are two types of disc map available on the Archimedes.  The !FixMap 
application will attempt to repair both of these.  It will try to 
reconstruct old free space maps (L & D format discs) from the directory 
structure and will force the second copy of a new disc maps (E format 
discs) to be used instead of the first  unfortunately if both copies of a 
new map are corrupt it is not possible to repair them.

Using the disc editor
---------------------

MOUNTING A DISC

To mount a disc for the first time, just click on the DiscEd icon on the 
left hand side of the iconbar with the with the SELECT button.  The first 
sector of the disc held in the default filing system and drive will be 
read, and the contents of the sector will be displayed in a window for 
editing.  This window is called the 'display window'.  Whenever the display 
window is opened, it is accompanied by a second window which is called the 
'control window'.

Clicking on the DiscEd icon with the SELECT button for a second time will 
only bring the display window to the front or open it again if it has been 
closed.  To mount another disc in the same drive you must click on the 
DiscEd icon with the ADJUST button.

THE CONTROL WINDOW

This window provides the basic facilities required to move around a disc.  
It displays and allows you to edit the current filing system, drive number, 
and the address of the sector/byte that is being edited  this is in both 
the 'track, heads, sectors' format and as an eight digit hexadecimal 
number.

The value of the byte that is being edited is also displayed and can edited 
in  a number of formats ie. decimal, hexadecimal, binary, and ASCII.

Selecting a new filing system or drive

The current filing system can chosen from the list of available filing 
systems that is displayed when you click on the boxed arrow (in the control 
window window) with the SELECT button.

The current drive number can be changed either by clicking on the raised 
arrows either side of the drive number or by clicking on the box that 
contains the drive number and then typing in a new drive number followed by 
the <return> key.

If either the current filing system or drive is altered then the disc in 
the specified drive will be mounted as described above.

Moving around the disc

You can move around the disc by changing the current track, head, or 
sector.  As with the drive number, this can be done either by clicking on 
the raised arrows or by clicking on the appropriate box and typing in the 
new value, followed by the <return> key.

Alternatively, you can alter the disc address by clicking on the address 
box and typing the new value, followed by the <return> key.

Editing a byte

If a new 'value' is entered, by clicking on the value box and then typing 
in the required change and then pressing the <return> key, the display 
window will updated and the next byte will be offered for alteration.  To 
stop the next byte being displayed in the value box, you can click on the 
'off' box.  This is useful when entering several values at a time.

Since the value box will only alter on byte at a time, if a value larger 
than 256 is entered then the extra information will be ignored. For 
example:

 decimal:           256 AND 255 = 9
 hexadecimal:     &1265 AND &FF = &65
 ASCII:           'asd' AND 255 = 'a' ie. the left most character

The exception to this rule is eight digit hexadecimal figures.  These are 
entered into the displayed sector as a hexadecimal word (four bytes) and 
the byte following this word is then offered for alteration.

ASCII values that cannot be entered from the keyboard are displayed and can 
be entered by typing the decimal value enclosed in angle brackets.  For 
example:

 ASCII 9   (tab)        would be represented by <9>
 ASCII 127 (backspace)  would be represented by <127>

THE DISPLAY WINDOW

The display window shows a single sector of a disc in both the HEX and 
ASCII formats.  You may click with the SELECT button in either the HEX or 
ASCII area to enter data directly.  When this function is selected, the 
byte being edited will be highlighted with a red background and the display 
window frame will turn from grey to a pale yellow.

The display window menu options

If you click on the MENU button over the display window, a menu will 
appear.  Here is a summary of the functions that are available:

 MISC    info     displays various information about the current disc
         find     searches for a hexadecimal or ASCII string
         display  alters the size of the display window
         check    checks boot, map and directory CRCs
         recalc   recalculates and writes boot, map and directory CRCs
         repair   repairs boot sectors, maps and directories

 SAVE    sector   saves the current sector as either data or a hex dump
         marked   saves a marked block of sectors as above
         record   saves the current disc record (can be loaded into !Edit)

 SECTOR  read     forces the disc editor to read a sector
         write    forces the disc editor to write a sector

 MARKER  set      sets the markers related to the 'save marked' option
         unset    unsets markers as above

 MEMORY  recall   recalls the sector data stored in the memory 
         store    stores one sector of data

 GOTO    file     sets disc address to a specified file on the disc
         sin                           a specified internal disc address
         root                          the root directory address
         map                           the disc map address
         boot                          the boot sector (hard discs only)
         marker                        any markers that have been set

Disc Information

This option displays information about the shape and size of the disc being 
edited ie. the disc name, format (L, D & E), total size in bytes, number of 
tracks, heads & sectors, and the density (single, double, etc).

The Display Size

It is possible to increase the size of the display window so that it 
displays up to 2KBytes.  This will affect the save sector option, and the 
memory size.

Saving the contents of the display window

You can save a single sector (or the contents of the display window) by 
using the 'save sector' option from the display window menu (cf. pp 47-48 
of the RISC OS User Guide).

Using markers (exporting/importing files)

Once you have set the markers, you can save the data in between the two to 
a fresh disc by using the 'save marked' option from the display window 
menu.  This option can be used to recover deleted files or corrupt data 
from a disc.

The marker section could exported into the !Edit and the imported back onto 
the disc at a different location.  A file can be imported simply by 
selecting the address at which the file is to be imported onto and then 
saving the file onto the display window (cf. pp 47-48 of the RISC OS User 
Guide).  The imported file will be written directly to the disc and so 
caution should be exercised when using this facility.

Using the memory

The memory will store and recall the contents of the display window.  It is 
designed for those who are familiar with other disc sector editors.  A more 
sophisticated 'memory' function can be obtained by exporting and importing 
files (explained in the section above 'Using markers').

Navigating around a disc

You can use the 'goto' options to find your way easily around a disc.  This 
is not so important for floppy discs, but finding files, directories, etc 
on a large hard drive can very difficult without this facility.

Goto file: this option will attempt to find a specified file.  You should 
enter the file name without the filing system, drive name or drive number 
and without the root identifier ie. '$'.  For example: to find a file 
'scsi::scsi100.$.!Edit.!RunImage' can be found by specifying just 
'!Edit.!RunImage'.

Goto SIN: this option will attempt to find a specified file via its System 
Internal Name (SIN).  System Internal Numbers (or internal disc addresses) 
will be fully explained in the printed manual.

Using the find option

This option can be used to search for the occurrence of a specified piece 
of text or hexadecimal on the disc.  By default, you can search from the 
current disc address to the end of the disc.  This can be changed by 
clicking on the appropriate box and typing in the the new search addresses, 
followed by <return>.

The magic characters option allows wild card searching and non-keyboard 
characters to be accessed.  When this option is selected the following have 
special meanings:

\#    any character
\*    any string (up to 256 bytes long)
\xHH  a hex character eg. \x8F will insert a character of ASCII value &8F
\\    a single backslash ie. '\'

Checking CRCs bytes

The 'misc check' option will check the check bytes (CRCs) that are on the 
disc that is being edited.  This option will not take into account any 
unsaved alterations that have been made to the disc.

dir   this option will only be highlighted if you are editing a directory
      ie. bytes 1-5 of the display window contain either 'Hugo' or 'Nick'
      you can locate a directory by using the 'goto' option described above

map   this will check the check bytes on new and old disc maps.  Old disc
      maps have 2 check bytes where as new disc maps have a variable number
      of check bytes.  Both copies of the a new disc map are checked.

boot  this will check the defect list check list and the boot sector CRC     
      (only hard drives)


Recalculating CRC bytes

This will recalculate the check bytes of a directory, map and boot sector 
(as described above).  However, this option will take into account any 
relevant unsaved alterations to the disc and incorporate them into the CRC 
calculations and then save the alterations to the disc.  For example, you 
could alter a directory entry and then recalculate the directory CRC to 
prevent a 'broken directory'.

Repairing a directory

This option is a repeat of the !RepairDir functions described above.

Repairing a disc map

This option is a repeat of the !FixMap functions described above.

Exporting a disc record

You can save the shape and size of a disc (called the disc record) using 
the 'save record' option from the display window menu.  This is a 
precaution that can be taken to aid the recovery process.  This function 
will be expanded in the printed manual.

Repairing a boot sector

If you have exported the appropriate disc record, you can repair a hard 
drive boot sector by first loading the disc record (by dragging it from a 
filer window onto the display window cf. pp 47-48 of the RISC OS User 
Guide) and then selecting the 'misc repair boot' option from the display 
window menu.

Editing foreign disc formats

You can edit foreign disc formats by first selecting the appropriate filing 
system and drive and then dragging the required disc record eg. 'IBM720k' 
stored in the 'records' directory on the Archimedes Disc Rescue disc.

Your own disc records can be created to allow other foreign formats.  this 
can be done by saving a disc record into !Edit and making the appropriate 
changes.  The parameters used in a disc record are given below.  These will 
be more fully described in the printed manual.

 discname     <string>        disc name
 discsys      <fs>:[h|f|0-7]  filing system and drive type (hard, floppy)
 discformat   <?|L|D|E>       special/unknown, L, D, or E format

 discsize     <numeric>       disc size in bytes
 heads        <numeric>       number of heads per disc (1, old directories)
 secsperhead  <numeric>       sectors per head
 log2secsize  <numeric>       log base 2 of sector size
 density      <0-3>           n/a, single 256, double 512, quad 1024

 bootopts     <0-4>           boot options as per *Opt 4
 rootaddr     <numeric>       internal address of root directory
 rndskew      <numeric>       track to track skew for rnd file allocation

 zones        <numeric>       number of zones in the map
 idlen        <numeric>       number of bits per id
 log2bpmb     <numeric>       log base 2 of bytes represented per map bit
 sparebits    <numeric>       unused zone bits

 defect0,1,2 .. etc           defect list &address, &address, etc
 hardware0, 1, 2 .. etc       hardware parameters &address [!|?] value, etc

 secoff       [0|1]           ignore sector 0 of IBM discs (normal, IBM)
 headfix      <numeric>       forces only one disc head to be used

DISPLAY WINDOW KEYBOARD SUMMARY

plain key actions

 <delete> move caret left by a byte

cursor key actions

                       plain      shift                ctrl

 <left>   move left    by a byte  to next word         to previous 4 words
 <right>  move right   by a byte  to next word         to next 4 words
 <down>   move down    by a line  to next 4 lines      to end of sector
 <up>     move up      by a line  to previous 4 lines  to start of sector

ctrl/shift key actions

 <cursor left>   read previous sector
 <cursor right>  read next sector
 <cursor down>   read previous head
 <cursor up>     read previous sector

 R  read current sector
 W  write current sector

 G  goto ... F  next file fragment (by filename)
             S  next file fragment (by system internal name)
             R  root directory
             M  disc file allocation map
             B  hard disc boot sector
             X  next marker

 M  memory ... S  store sector
               R  recall sector

 S  set marker ... 1  set first marker to current address
                   2  set second marker to current address

 C clear marker ... 1  clear first marker
                    2  clear second marker

 F find text
function key actions

      action       plain       shift          ctrl

 f1                read        disc info
 f2                write
 f3   save         sector      marked         record
 f4                find
 f5   goto         filename    sin            marker
 f6   goto         root        map            boot
 f7   memory       store
 f8   memory       recall
 f9   marker 1     set         clear
 f10  marker 2     set         clear

CHANGING THE DEFAULTS

There are several options that may be selected from the iconbar menu which 
affects the operation of the disc editor.  These options can also be saved 
for subsequent sessions.

 Default FS       allows you to specify the filing system that is
                  first accessed by the disc editor

 Auto read        if this option is deselected then the disc editor
                  will only read a sector from the disc when it is
                  expressly told to ie. from the display window menu

                  this is useful for navigating corrupted discs

 Confirm write    when this option is selected the disc editor will ask
                  you to confirm any write operations to the disc

 Check modified   when this option is selected the disc editor will ask
                  you to confirm any actions that might loose any unsaved

 Check discname   when this option is selected the disc editor will check
                  that the disc in the drive has not been swapped

                  * this option is not effective when a non FileCore *
                  * disc record has been imported                    *

 Single sector    when this option is selected the disc editor will perform
                  any disc accesses in single sector chunks. This is useful
                  when editing discs with errors on them.

                  * this option is always selected when a non FileCore *
                  * disc record has been imported                      *

Finally
-------

If you have any further queries, please do not hesitate to contact us at:
LOOKsystems, 96a Vauxhall Street, Norwich, NR2 2SD or tel. (0603) 764114.
























If this file scrolls past
to quickly, load !Edit and
then double click on the file.

