The complete package contains the following files: -File- -CRC- -Description- CRC $DEDC902B Calculates the CRC-checksum of a file LFS $5D923F5E The 'file system' LFS.doc This document ReturnCodes.doc Return codes The checksums can be calculated with CRC. If some of the checksums is wrong, the file is corrupt. In that case you must not use it. These files are freeware and they may be freely spread and used as long as they are left unchanged. These programs are written in assembly. They are completely re-entrant (pure) and pc-relocatable. They should work on all Amiga models and configurations and they are carefully tested, but we are not responsible for any damage caused by them. Send bug reports, suggestions and other mail to: Markku Vähäaho or Terje Bergström Eerontie 17 Jukolanahde 4 D 15 02180 Espoo 02180 Espoo Finland Finland Usenet: terje.bergstrom@f500.n515.z2.fidonet.org Fidonet: Terje Bergstrom@2:515/500.14 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LFS (LightFileSystem) is a file system, but it isn't a file system. Hum... I mean that it isn't a REAL file system, but it is a control program. It is especially made for hard disk users, for others LFS is no use. Before using LFS, you must format an LFS-disk. LFS itself is a simple control program for LFS disks. You can copy files to LFS disks, copy files from them, rename files, delete files and repair LFS disks. <<< FEATURES >>> * VERY fast. Taking a directory takes max. ½ seconds, formatting a disk max. 2 seconds, copying 2-3 times faster than normal * Files are stored as one single packet, not spread all over the disk like with normal disks = no fragmentation. * Uses double-buffering, so reading and writing are as fast as they can be with the operating system routines. * An efficient repair-command. Repairs as much as possible ( = if there is a single byte left of a file on the damaged disk, that byte will be taken.) * Uses real 32-bit CRC checksums with both files and the header cylinder. * Disks don't have to be completely formatted. <<< WHAT IS IT? >>> The normal file system is rather slow, because the disks get fragmented when writing and deleting many files (ie. the files will spread all over the disk in small pieces) and disk access gets more and more slower. Another thing which slows disk access is that the operating system always reads a piece of the file, then jumps to the 'middle' of the disk (the file information is there) and reads where the next piece is and then jumps back and reads that piece. I made LFS to get FAST disk operation. It always writes files to contiguous tracks, so LFS disks never get fragmented. However, this causes that you can't delete a file which is in the 'middle' of the disk. The only file you can delete is the last file written. LFS stores all file information on the first cylinder, and therefore directory reading is VERY fast, but if the first cylinder is completely broken, there is no hope to get the files back. The third thing is that LFS uses blocks of 5632 bytes (one track), like Amiga hardware, not the operating system blocks of 512 bytes. The OS, when writing one block, has to read the track first, then change the block and write it back (two disk accesses). The hardware can't read/write smaller pieces than one track, so LFS 'blocks' are tracks, and when writing LFS needs only one disk access (write). Because LFS can use TD_FORMAT for writing, LFS disks don't have to be formatted! The only cylinder that must be formatted is the first one which contains the file information. Yet another thing which speeds LFS up: it uses asynchronous transfer. While copying to an LFS disk, for example, while reading more data it writes the previously read data at the same time! I use LFS disks as 'mail' disks. When I get a nice (PD, share- or freeware) program, I'll copy it to an LFS disk and give it to my friend. He'll copy it (or them) from the LFS disk. Here we need no complicated commands but a lot of time is saved. LFS is also usable as a storage place for large files. An example of an about 275000 bytes long file: LFS OFS (the normal file system) Write 18 sec. 57 sec. Read 17 sec. 26 sec. The file was copied from my hard drive and later copied back. As you see the difference is really amazing! To save disk space, LFS stores only filenames, their places on the disk and their lengths, no dates, protection flags etc. File names can be max. 59 chars long, directories/pathnames aren't supported, and a disk can contain max. 78 files. <<< USAGE >>> Usage: LFS [Source] [Destination] Drive: 0-3 Commands: cf (copy from LFS disk) ct (copy to LFS disk) dir (view LFS disk) ren (rename LFS file) del (delete last file from LFS disk) fmt (format LFS disk) rep (repair LFS disk) An example: "LFS 0 ct RAM:Whee" would copy the file "RAM:Whee" to the LFS disk in the drive DF0: Note that when using directory names as destinations, they must end with a ":" or a "/"! cf = copy from an LFS disk. The source must be defined, the destination is optional. Examples: LFS 0 cf Whee copies the file Whee to the current directory. LFS 0 cf Whee RAM:Hum copies Whee to RAM:Hum LFS 0 cf Whee DH0:Utils/ copies Whee to DH0:Utils/Whee LFS 0 cf Whee T: copies Whee to T:Whee ct = copy to an LFS disk. The source must be defined, the destination is optional (like cf). Examples: LFS 0 ct AR:DMouse.LZH Copies "AR:DMouse.LZH" to the LFS disk with the name "DMouse.LZH". LFS 0 ct T:Duu Hum Copies T:Duu to the LFS disk with the name "Hum" and so on. You'll learn how to use it quickly. dir = show the directory and space usage of an LFS disk. An example: LFS 0 dir ren = rename a file on an LFS disk. An example: LFS 0 ren Hum Duu renames "Hum" to "Duu" del = delete the last file from an LFS disk. An example: LFS 0 del Then LFS asks 'OK to delete file XXX (y/N)?' Answer 'y' or 'n'. If you answer 'y', the file will be deleted. It is almost impossible to get deleted files back! fmt = format an LFS disk. An example: LFS 0 fmt This command also asks you "do ya' know whatta ya' doin'?" rep = repair a damaged LFS disk. An example: LFS 0 rep Repairs everything that can be repaired. Note that you can't get deleted files back with this command! If you for example install an LFS disk by mistake, first you should clear the damaged parts of the disk with zeros (with a monitor-program). This will be explained later. Then use the rep-command. Note: after repairing badly damaged disks there might be some 'ghost' files, wrong filelengths etc. <<< A SAMPLE SESSION >>> "LFS 0 fmt" >We'll format an LFS disk first. "LFS 0 ct C:Format" >Then copy the format-command there. "LFS 0 ct T:MyDisk.LZH Workbench.LZH" >Write "T:MyDisk.LZH" there as >"Workbench.LZH". "LFS 0 dir" >Let's see what we've done. "LFS 0 ren Format Fmt" >Rename "Format" to a shorter form "Fmt". ------ "LFS 0 dir" >Show the directory "LFS 0 cf Fmt DH0:C/" or "LFS 0 cf Fmt C:" >Get the format-command back to "DH0:C/Fmt" "LFS 0 cf Workbench.LZH T:WBDisk.LZH" >Copy "Workbench.LZH" to "T:WBDisk.LZH" Not very difficult, is it? <<< TECHNICAL INFORMATION >>> The first cylinder contains the following information: Offset (bytes) Length (bytes) 0 4 "LFS1", an identification word 4 4 The number of files on the disk 8 4 The first free cylinder (byte-offset) 12 4 The CRC-checksum of the first cylinder Here starts the file information: 16 60 The name of the file 76 4 The CRC-checksum of the file 80 4 The first data cylinder of the file (bytes) 84 4 The length of the file 88 The next file... Every file information 'block' (like the upper one) is 72 bytes long. If something happens to the file information cylinder, clear the damaged bytes before using the rep-command. If you install an LFS disk by mistake, run Timo Rossi's "Amiga Monitor" and write the following commands: "< 7f000 0 0 2" Read the damaged blocks from DF0: "f 7f000 7f400 00" Fill them with zeros ($400 = 1024 bytes = 2 blocks) If only the first block is damaged, write "f 7f000 7f200 00" and so on. "> 7f000 0 0 2" And write them back After this you can use the rep-command safely. <<< FUTURE IMPROVEMENTS >>> - Wildcard support - Maybe I'll make LFS a 'real' file system some day If you need a specific feature, write to us! Markku Vähäaho, Lightning Inc.