qxl_fschk
=========

Program to look for problems in SMSQ QWA (aka QXL) filesystems.
Strictly read-only at the moment.

syntax: qxl_fschk [-v level] name      (Unix)
        ex qxl_fschk;"[-v level] name"   (QDOS)

will test a QLWA (commonly called "QXL") filesystem for errors.

Options: -v level  : verbosity
	0  : don't ever print anything, just return  error code
	2  : print statistics, number of warnings and execution errors
	4  : display short info about each warning
	6  : display most verbose info on each warning
	8  : display name of each checked subdir.  DEFAULT level
	10 : display name of each checked file, also display
	     full list of lost blocks in case of trouble

 'name': QXL file or partition name. SEE QDOS notes below.

Returns: 0 or error code composed as addition of followng exit status info

	1	: program execution error if any (not qxl-fs related)
	2	: less serious warnings
	4	: serious errors, should not be used RW
	8	: very serious errors, might crash system

The classification which warning is considered serious is very
adhoc. Tools and operating system will differ in error tolerance.
Whenever any warning is encountered it is recommended to run the 
program with the highest available verbosity to get an idea
how serious the problem is.

The program is (c) GPL, see qxl_fschk.c for details.

QDOS Notes
----------

this version expects that the QXL file can be accessed in a linear
mode. This is afaik the normal case for QPC and QXL. The matter is 
more complicated for "real" hard disks though.. eg on a Q40 it is only 
possible to run the program from Linux currently. (It is installed on
the linux-ramdisk so you don't have to install Linux just to run this)

Diagnostic Output
-----------------

the program prints the following info, depending on verbosity
and problem:

	de_pos	: absolute (within partition) byte position of directory
		  entry for object. Special dummy values are
			0 - root directory
			1 - system map
			2 - free cluster list

		  eg using a hexeditor, moving to 'de_pos' will position 
		  directly at the directory entry. Directory entries are
		  the same like on floppies except that they contain an
		  me (map entry number).

	me	: number of first cluster (see cluster) allocated for 
		  object, this is what filenumber is for floppies and 
		  inode number for Unix.

	cluster : minimum allocation unit. Clusters are chained together
	          in the map, each map entry holds the number of next
	          block or 0 if last block in file.
		  Multiply cluster number with sect_per_cluster*512 to 
		  get absolute byte-pos of cluster within partition.



What Errors will qxl_fschk find?
--------------------------------

This is what qxl_fsck checks:

- list of free clusters

- all map entries

- for files: number of allocated clusters, length, name length
	     and cluster list integrity; 
	     for directories aditionally len%64 is checked

- multiple allocation of clusters

- check for sensible values in FS header (sector 0)

- overall statistics (lost blocks etc..)

- features not implemented by qxl_fschk

Checks are rather weak on following:

- (i)legal filenames

- (i)legal directory entries

It would be nice to have more things to check, but QXL filesystems
do have approximately 0 builtin redundancy ..

So if qxl_fschk ever complains, it is very likely to be a real
problem.
	
