home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / NetBSD / Tools / bffs1.3.lha / bffs1.3 / doc / user_manual < prev   
Text File  |  1994-02-02  |  33KB  |  715 lines

  1.                  BFFS 1.3
  2.         An AmigaDOS device to read UNIX filesystems
  3.                 (©) 1991 - 1994 by Chris Hooper
  4.  
  5.  
  6.              U S E R   M A N U A L
  7.  
  8.  
  9.               Documentation Index
  10. Section       Line #   Page #   Description
  11. ------------------------------------------------
  12. Index            9        1    This index
  13. Introduction    29        2    Preliminary Information
  14. Compatibility   62        3    Other systems with which BFFS is compatible
  15. MountList      111        4    Building a MountList entry
  16. HDToolBox      139        5    Using HDToolBox to mount your partitions
  17. Utilities      220        7    Programs to maintain and modify filesystems
  18. Quick Setup    309        9    Steps for experts to get running quickly
  19. Credits        327       10     Who helped with this project
  20. Known Bugs     353       11     Known problems which still exist with BFFS
  21. Appendix A:    371       12    MountList.BFFS information
  22. Appendix B:    446       14    Implementation Information
  23. Appendix C:    502       15    The BSD 4.2 File System
  24. Appendix D:    562       17    Differences between BFFS and the standard FFS
  25. Appendix F:    599       18     Information useful to programmers
  26. Appendix F:    651       19     Troubleshooting Suggestions
  27.  
  28.  
  29. INTRODUCTION:
  30.  
  31.     First, a definition is in order.  The major portion of this
  32. product consists of a piece of software which implements a disk
  33. filesystem.  A filesystem is simply a way of organizing multiple
  34. data files within the confines of a logical device.  Without a
  35. filesystem, that device would appear as nothing more than a single
  36. large file.  In order to store more than one file on a device, it
  37. is necessary to assert some organization in order to be able to
  38. locate and size the separate files. This is what a filesystem
  39. attempts to do.
  40.  
  41.     BFFS Stands for Berkeley Fast FileSystem, a reimplementation of
  42. the UNIX filesystem, as described in the 1983 CSRG paper, "A Fast
  43. File System for UNIX."  In the last ten years, the Berkeley Fast
  44. Filesystem has become the predominant disk organizer for most UNIX
  45. implementations.  Although there have been subtle changes made by
  46. various vendors since the original, the basic idea and organization
  47. of the filesystem has not changed.  If you would like more details,
  48. please see APPENDIX B for implementation information or consult the
  49. CSRG paper mentioned above.  Please note that Linux currently does
  50. not support the Berkeley Fast Filesystem.
  51.  
  52. This package contains an implementation of the Berkeley Fast
  53. Filesystem for AmigaDOS 2.04 and higher.  The utility of a
  54. package such is this is that one may seamlessly use the same
  55. logical media while running AmigaDOS as one would use running
  56. UNIX.  It can also be used for data migration.  For instance,
  57. you can write a floppy on a UNIX machine at work (or school),
  58. then use the file stored on that disk directly on your machine
  59. at home.  This packages does not allow you to execute the
  60. applications intended for other platforms on your Amiga.
  61.  
  62. COMPATIBILITY:
  63.  
  64. The BFFS filesystem attempts to attain compatibility with the
  65. Berkeley 4.2 BSD filesystem.  Since other UNIX (and compatible)
  66. producers base their system's filesystem on the BSD 4.2 FFS,
  67. this product may be useful with filesystems created by those
  68. other systems.  The tested filesystem types follow:
  69.     SunOS 4.1 and 4.1.1
  70.     BFFS should be highly compatible with this release
  71.     of the BSD filesystem, as BFFS was created against it.
  72.     In order to write a floppy, you need to do the following:
  73.        1. Make sure you have a floppy drive on the Sun
  74.        2. Format the floppy
  75.         I recommend "fdformat -lv"
  76.        3. Create a filesystem on the floppy
  77.         I recommend "newfs -i 16384 -c 80 -t 2 -m 0 /dev/rfd0c"
  78.         as this seems to give the best capacity
  79.        4. Mount the floppy on a directory (you MUST be root)
  80.         ie: "mount /dev/fd0c /mnt"
  81.        5. Copy your files to the floppy
  82.        6. Unmount the floppy
  83.         ie: "umount /dev/fd0c"
  84.     SunOS 4.1.2 (Solaris 1.0.1) and SunOS 4.1.3
  85.     BFFS should be able to at least read filesystems created
  86.     with this OS.  I have done quiet a few read and write tests.
  87.     BFFS did not corrupt the filesystem, as far as I could tell.
  88.     Amiga UNIX (SVR4)
  89.     Did minimal testing, but read/write seems stable
  90.     BSD 4.3 filesystems
  91.     newfs and fsck included in this distribution are
  92.     ports of the Berkeley utilities dated 6/29/90 and
  93.     7/27/90 respectively.  fsck has been used extensively
  94.     throughout the testing process of BFFS.  Since the
  95.     above filesystems (with some exceptions) seem
  96.     compliant to fsck, I would assume that BSD 4.3 and
  97.     BSD 4.4 FFS should not have a problem reading
  98.     BFFS-written filesystems.
  99.  
  100.     NOTE:  BFFS is NOT compatible with filesystems created on
  101.        machines such as the Sun 386i because of byte-ordering.
  102.        I plan on eventually releasing a different BFFS which
  103.        will be compatible with those filesystems.
  104.  
  105.     NOTE ALSO: BFFS is NOT compatible with NeXT's version of the
  106.        BSD filesystem.  This is something I hope to fix in the
  107.        near future.
  108.  
  109.     See Appendix A for information on selecting an Amiga device driver.
  110.  
  111. BUILDING A MOUNTLIST ENTRY:
  112.  
  113.     I suggest you use the sample MountList entry (MountList.BFFS) as a
  114. prototype for creating your own MountList entry.  You can find line-by-line
  115. documentation in the MountList.BFFS file.  For the generic case, it should
  116. be (at most) necessary to check the following MountList fields:
  117.     FileSystem, Device, Unit, BlocksPerTrack, Surfaces, LowCyl, and HighCyl
  118.  
  119.     You can add this new MountList entry to your system's MountList
  120. (Devs:MountList) or put it in a separate file.  If you kept the same device
  121. name as the example MountList, you would type:
  122.     Mount BFFS: from MountList.BFFS
  123.     Say you chose instead to call your BFFS partition BSDA and add it to
  124. your Devs:MountList.  In that case, you would type:
  125.     Mount BSDA:
  126.  
  127.     If you are mounting a filesystem which already has a UNIX BSD file
  128. system on it, then you should be able to CD to that device, just like any
  129. other AmigaDOS file system device.  If you want to create a new BFFS
  130. file system, you must first use newfs to create a filesystem on that
  131. partition for BFFSFileSystem to mount.
  132.  
  133.     Once you have the filesystem working, you might try tweaking some of
  134. the following fields:
  135.     Mount, Priority, Buffers, Reserved, and PreAlloc
  136.  
  137. Please see Appendix A for descriptions of the MountList fields.
  138.  
  139. USING HDTOOLBOX TO AUTOMATICALLY MOUNT YOUR PARTITIONS:
  140.  
  141.     Before you follow the below procedure, I recommend you first
  142. try mounting the filesystem using a MountList entry.  A filesystem
  143. compatibility problem before the machine even boots could be a
  144. major headache!  If this happens to you, see Appendix F.
  145.  
  146.     If you are using a hard disk, you most likely already have a
  147. partition set aside for the UNIX filesystem.  If not, you need to
  148. first set up the disk and partition using HDToolBox.  Consult your
  149. AmigaDOS manual for help.
  150.  
  151.     Get into HDToolBox and select "Partition Drive."  Choose the
  152. partition you want to make a BFFS partition, then select the
  153. "Advanced Options" button.  Pick the "Change File System for
  154. Partition" button.
  155.  
  156.     If this is an Amiga UNIX partition, then the File System type
  157. is probably "Reserved Partition."  Otherwise, the most likely case
  158. is "Fast File System."  Be careful in your selections!  If you
  159. didn't watch what you were doing, you might have accidentally
  160. picked a partition with AmigaDOS data you wanted to keep.  If the
  161. File System Type is "Custom File System," make especially sure
  162. you know what's going on there.  If you're at all unsure, click
  163. the "Cancel" button and start over.
  164.  
  165.     Select the "Custom File System" button and fill in the
  166. "Identifier =" field.  I recommend the value 0x42464653 ('BFFS'),
  167. but you can use and filesystem type you want.  The NetBSD people
  168. are partial to 'BSDx' - where x would be 'R', 'S', 'D', 'E', 'F',
  169. 'G', 'H', etc depending on how NetBSD is using the partition.
  170. The disadvantage to this scheme is that for every UNIQUE file
  171. system Identifier you want to mount as a BFFS filesystem, you
  172. have to add the BFFS filesystem to the RDB with that Identifier.
  173.  
  174.     "Use custom boot code?" should be set to "No, " unless it is
  175. required by NetBSD to boot (not currently).
  176.  
  177.     Set the "beginning:" and "end:" fields as you would if those
  178. were the "Reserved" and "PreAlloc" fields of the MountList.  Then,
  179. Click on the "Ok" button.
  180.  
  181.     Click on the "Add/Update File Systems" button.  This screen
  182. allows you to update the RDB on the disk with the new version of
  183. BFFS. Every time you assign a different Identifier to one of your
  184. partitions, you need to "Add New File System" with that same
  185. Identifier.
  186.  
  187.     Click on the "Add New File System" button now.  Change the
  188. "Enter Filename of File System" to point to the file where you
  189. have the new BFFSFileSystem.  Change the "DosType for File System"
  190. to be the same as you entered as the Identifier for the Custom
  191. File System. The "Version" of the filesystem does not matter.
  192. Click on "Ok" when you are done.  Then click "Ok" on the "File
  193. Systems" screen.
  194.  
  195.     If you have more partitions to add as BFFS filesystems, do
  196. those in the same manner as above.  Note that if you use the same
  197. Identifier for all filesystems, you do not need to "Add New File
  198. System" more than once.  This is not an option for NetBSD users.
  199.  
  200.     When done, Click "Ok" on the "Partitioning Drive" screen.  Then
  201. Click on "Save Changes to Drive."  After that operation is complete,
  202. you will need to reboot for the machine to mount the filesystem.
  203.  
  204.     The Reserved and PreAlloc fields of a MountList entry may be changed
  205. in HDToolBox by clicking on "Partition Drive."  From there, you need to
  206. select the partition by clicking on the appropriate partition in the bar
  207. graph.  Select the "Advanced Options" button, then the "Change File
  208. System for Partition" button.  The Reserved field is "beginning" under
  209. "Reserved blocks at."  The PreAlloc field is "end" under "Reserved
  210. blocks at."
  211.  
  212. ** SPECIAL NOTE **
  213.     The PreAlloc and Reserved fields are treated as unsigned longwords
  214. by HDToolBox.  They are specified as signed longwords when using the
  215. MountList.  This basically means that when you want to specify a value
  216. such as -1 in HDToolBox, you must use 4GB - value.  Thus, 4GB - 1 =
  217. 4294967295.  To tell the filesystem not to attempt to read a disk
  218. label, put 4294967295 in the box "reserved blocks at the beginning."
  219.  
  220. MAINTENANCE UTILITIES
  221.  
  222.     There are several support programs included in this distribution
  223. of the BFFS system package.  These programs were very helpful during
  224. the development of the BFFSFileSystem and will hopefully be just as
  225. useful to you.  I intend to offer just an overview of the function
  226. of those programs here.  Read the documentation file associated with
  227. the utility if you need more information.
  228.  
  229. o  BFFSTool
  230.     This program is used to both monitor and modify the
  231.     operation of a running BFFS filesystem.  You are able to
  232.     change filesystem buffers, modify the write sync timers,
  233.     clear statistics, and change operating flags (auto symlink,
  234.     ignore case, dir comments, unix paths. and read only).
  235.  
  236. o  dumpfs
  237.     Most users will probably never need to use this program.
  238.     It prints out information on the disk label and superblock,
  239.     as organized by newfs and modified by the filesystem.
  240.  
  241. o  dcp
  242.     Dcp is a program that can copy to/from devices and files.
  243.     You can specify either the physical device and partition
  244.     or the AmigaDOS device.  This program was originally
  245.     distributed separately.  It is a replacement for the
  246.     filetodev and devtofile programs distributed in version 1.1
  247.     of BFFS.  This is the latest version of dcp and is included
  248.     here mainly for completeness.
  249.  
  250. o  ln
  251.     This program can create a hard or soft link using the BFFS
  252.     filesystem.  I wrote it because I couldn't get MakeLink
  253.     under AmigaDOS 2.04 to create soft links.  Command line
  254.     syntax is identical to the Unix command of the same name,
  255.     except this version can accept multiple names which will
  256.     point to a single destination.
  257.  
  258. o  chown
  259.     Change ownership (user id / group id) of a file per the
  260.     AmigaDOS 3.0 packet.
  261.  
  262. o  els
  263.     Very primitive directory lister, but shows the extended
  264.     AmigaDOS 3.0 information for file ownership and permissions.
  265.  
  266. o  rdb
  267.     Edit the rdb area of most manufacturers' disk devices.
  268.     This is a crude command-line program, but can do most things
  269.     HDToolBox can do (and a few it can't).  I wrote it because
  270.     my IVS Trumpcard wouldn't talk to HDToolBox and I wanted to
  271.     have more than *one* automount partition.
  272.     
  273. o  mknod
  274.     Create Unix device nodes (block and character special)
  275.     using a mouned BFFS filesystem.  This program uses a new
  276.     packet assigned by Randell Jesup (ACTION_CREATE_OBJECT),
  277.     which may be used to create an arbitrary file type.
  278.  
  279. o  fsck
  280.     This program will check your filesystem for inconsistencies.
  281.     It is a port of the 4.3 BSD program of the same name.  One
  282.     item you should note.  This program doesn't seem to like
  283.     SunOS filesystems as well as it does BSD filesystems.  If
  284.     fsck tells you the disk requires a label for a SunOS disk,
  285.     supply the location of the superblock: "fsck -b 16 DEVICE:"
  286.     Otherwise, you should be able to just type: "fsck DEVICE:"
  287.     See the manual page for more information.
  288.  
  289. o  diskpart
  290.     This program will let you assign multiple BSD partitions
  291.     within a single AmigaDOS partition.  WARNING:  These
  292.     partitions are not compatible with the way NetBSD partitions
  293.     were implemented on the Amiga.  This /might/ change in the
  294.     future.  This program is a port of the 4.3 BSD program of the
  295.     same name.  See the manual page for more information.
  296.  
  297. o  newfs
  298.     This program will create a new filesystem on top of the
  299.     specified device.  If diskpart was not first run on the
  300.     partition, the size of the entire partition will be used
  301.     for the filesystem.  Warning: This program unmercifully
  302.     writes over an existing filesystem if you specify the
  303.     wrong device.  This is a port of the 4.3 BSD program of
  304.     the same name.  See the manual page for more information.
  305.  
  306.  
  307. A UNIXish chmod program will probably be included in BFFS 1.4.
  308.  
  309. QUICK SETUP
  310.  
  311. For those with previous experience with setting up this (or other)
  312. AmigaDOS filesystems, here are the things you need to do:
  313.  
  314. o   Copy BFFSFilesystem to L:
  315. o   Create a MountList entry for the filesystem.  You must specify:
  316.     FileSystem, Device, Flags, StackSize, Priority, Globvec,
  317.     LowCyl, HighCyl, Surfaces, BlocksPerTrack, Buffers,
  318.     Reserved, Prealloc, and DosType.  If you have any questions,
  319.     please consult the sample MountList.BFFS file (in APPENDIX A)
  320.     or the section on building a MountList entry.
  321. o   Mount the filesystem
  322. o   If all went well, you should be able to CD to the filesystem,
  323.     as you've named in the MountList.  If all did not go well,
  324.     hopefully your Amiga did not crash.  Consult the Appendices
  325.     to ensure you've configured everything correctly.
  326.  
  327. CREDITS
  328.  
  329.     Arthur Hoffmann    Beta Tester, no matter how stable, he'll find
  330.                        some problem.  :)
  331.     Bill Moore         Original DOS interface Author, program concept
  332.     Chris Hooper       Main Author, program concept and design
  333.     Dominic Giampaolo  Beta Tester, if it's a bug, he's seen it
  334.     Ken Dyke           Assembly Author (stack and diskchange), always
  335.                        the quickest reference for my needs!!  :)
  336.     Lutz Vieweg        Beta Tester, reported many fixable bugs and
  337.                        submitted HD_Raw_Sun_Floppy_Label
  338.     Randell Jesup      Gave AmigaDOS filesystem insight, helpful hits,
  339.                        and new packets throughout!
  340.     Stefan Sticht      Beta Tester, found hits in 1.25
  341.     Tero Manninen      Beta Tester, the fastest enforcer hit finder,
  342.                        and has been helping out since BFFS 1.2!!
  343.     Thomas Kroener     Beta Tester, tried quite a few combinations
  344.     Ty Sarna           Beta Tester, not only does he find bugs, he
  345.                        also suggests cool improvements!
  346.  
  347.  
  348. Please remember that this software is freeware and these people
  349. have volunteered their time for this package to become a reality.
  350. Everyone above deserves pat on the back for making our lives a
  351. little nicer on the Amiga.
  352.  
  353. KNOWN BUGS
  354.  
  355. There are a number of problems which still remain with the current
  356. implementation of BFFS.
  357.  
  358. The READLINK packet is not supported yet.  This means that AmigaDOS
  359. will not be able to resolve soft links.  The filesystem is able to
  360. automatically resolve links local to the disk filesystem.  The
  361. problem is that symbolic (soft) links across devices will not work
  362. as expected.
  363.  
  364. Disk volume nodes aren't fully supported.  This mainly affects
  365. removable media.  Basically, if you intend on removing the disk,
  366. make SURE there are no AmigaDOS locks on that volume.  This will
  367. probably change in the future as the handler's support of multiple
  368. volumes improves.
  369.  
  370.  
  371. APPENDIX A:  MountList.BFFS information
  372.     FileSystem entry has to change if you don't put BFFSFileSystem in l:
  373.     Device depends on the device in which your filesystem resides:
  374.     For 2090 controllers, use hddisk.device.
  375.     For 2091 controllers, use scsi.device.
  376.     For IVS controllers, use IVS_SCSI.device.
  377.     For filesystems in a file, use fmsdisk.device (©) Matt Dillon.
  378.     For floppies, use newer mfm.device from Commodore (Consultron)
  379.             [ or messydisk.device from MessyDOS (©) ]
  380.     Unit entry changes depending on device.
  381.     Quick notes:
  382.         IVS SCSI addresses begin at 1, not 0
  383.         2090(A) SCSI addresses begin at 3; MFM is at 1 and 2
  384.     Mount entry should be set to your preference, with 0 meaning mount
  385.     at first access and 1 meaning mount immediately.
  386.     StackSize should be left at 1024.  It must be at least 600 bytes.
  387.     Priority should be left at 5.  Should you have a need to change it,
  388.     the filesystem will not really care.
  389.     GlobVec should be left at -1.
  390.     LowCyl should be set to the beginning cylinder of the filesystem.
  391.     For Sun-formatted disks, this is best set at 0.
  392.     For AmigaDOS disks with Amiga partitions and Unix partitions,
  393.         set this to the starting cylinder number for the partition.
  394.         If you do not know this, you should be able to find this
  395.         out using HDToolBox.  Look at the starting cylinder for
  396.         the partition under advanced options.
  397.     HighCyl should be set to the ending cylinder of the filesystem.
  398.     It is used to determine the maximum block which may be read
  399.     from or written to within the filesystem.  Failure to set
  400.     this parameter correctly may result in symptoms such as the
  401.     filesystem not being read, the machine crashing, or data
  402.     loss in other disk partitions.
  403.     Surfaces should be set per your drive's geometry [number of heads].
  404.     This information may be acquired from HDToolBox.
  405.     BlocksPerTrack should be set per your drive's geometry [may be
  406.     specified as sectors per track]. This information may be
  407.     acquired from HDToolBox.
  408.     Buffers should be set to the number of 512-byte blocks of system
  409.     memory you want to devote to the cache.  A minimum of six is
  410.     required for proper operation of the filesystem.
  411.  
  412.     Reserved is the Unix partition on the media you want to access.
  413.     It can also specify that no disk label is present:
  414.         -1 = no disk label
  415.      0 = access first partition
  416.      1 = access second partition
  417.      2 = access third partition
  418.      3 = access fourth partition
  419.      4 = access fifth partition
  420.      5 = access sixth partition
  421.      6 = access seventh partition
  422.      7 = access eighth partition
  423.      8 = do not scan for a Sun disk label
  424.     16 = do not scan for a BSD disk label
  425.     ** You may combine the 8 or 16 with 0-7
  426.        to achieve a combination of parameters.
  427.     PreAlloc is used to modify the startup defaults for the filesystem
  428.      1 = Turn off automatic symlink resolution
  429.         WARNING: The cooperation between AmigaDOS and BFFS
  430.              isn't quite to the point where turning OFF
  431.              automatic resolution is wise.
  432.      2 = Turn off case independence
  433.      4 = Make filesystem respect AmigaDOS paths and not UNIX paths
  434.      8 = Turn on directory comments (symlink destinations)
  435.     16 = Turn on directory comments (inode, perms, user, grp, etc)
  436.     32 = Invert the definition of the other/group permission bits
  437.     64 = Report space free relative to minfree (instead of actual)
  438.     Bits 8-15 represent a signed byte which is the GMT offset for
  439.         the filesystem when dealing with file times.  I recommended
  440.         you use BFFSTool to get the settings you want, then put the
  441.         PreAlloc number it gives you into your MountList.
  442.     You may combine any of the above to alter multiple parameters.
  443.     DosType should be left as 0x42464653 ("BFFS"), unless you have a
  444.     specific need for a different DosType.
  445.  
  446. APPENDIX B: Implementation Information
  447.  
  448.     There are a few points where this implementation of the
  449. Berkeley Fast Filesystem differs substantially from the original
  450. product described in the 1983 CSRG paper, "A Fast File System for
  451. UNIX."
  452.  
  453.     It is recommended you read the above paper before the
  454. following information.  If you do not have that paper, APPENDIX C
  455. provides some quick detail on the BSD 4.2 Fast File System.
  456.  
  457.     Files which have been opened and written to at least once are
  458. automatically extended in allocation to the size of an entire
  459. filesystem block.  When the file is closed, if it only requires
  460. allocation within the direct blocks of the inode, it will be
  461. trimmed down to the size specified in the inode.  Fragment blocks
  462. will be moved near others to conserve full filesystem blocks. By
  463. using this system, only full filesystem blocks need be found and
  464. allocated.  This reduces the overhead and complexity of file block
  465. allocation when writing to files.
  466.  
  467.     This program ignores superblock parameters such as interleave
  468. and maxcontig and always strives to locate the next block
  469. allocation contiguous with the previous disk block allocation.
  470. The read and write routines will then batch up as large a transfer
  471. as possible when requesting data to be read from or written to the
  472. media.  This should improve the transfer rate for large files.
  473.  
  474.     New files have a preference for the nearest cylinder group
  475. (cg) to that of the parent directory.  New directories are located
  476. in cgs having the most free inodes (and data blocks available).
  477.  
  478.     Files will continue to grow in the same cylinder group until
  479. all available filesystem blocks have been allocated.  At that
  480. point, the cg with the largest number of available blocks is
  481. chosen to continue allocation.
  482.  
  483.     It is recommended a BSD 4.2 filesystem be kept at most 90%
  484. full in order for the block layout policies to remain effective.
  485. This is true for the BFFSFileSystem as well.  One thing you might
  486. want to note is that the filesystem requires at least one empty
  487. filesystem block in order to deal with any file allocation.
  488. Because of this, the Info command is only told the number of
  489. complete filesystem blocks which are still available on the disk.
  490. So, you might find that creating a small may not induce an
  491. apparent increase in disk utilization.  In that case, the file was
  492. able to be allocated in a fragment block from the disk.  If you
  493. need to know, BFFSTool can provide the exact information from the
  494. superblock.
  495.  
  496.     When performing file reads or writes, the filesystem strives
  497. to combine as many contiguous disk fragments together as possible
  498. when a disk transfer is necessary.  The smallest disk transfer
  499. possible will always be the fragment size.  Any read or write
  500. request smaller will be buffered through the cache.
  501.  
  502. APPENDIX C: The BSD 4.2 File System
  503.  
  504.     The original AT&T System 7 filesystem organized data on the
  505. disk as follows:
  506.     [  Superblock  |  Inode Area  |  Data Area  ]
  507.  
  508.     The Superblock describes the parameters which make up the
  509. filesystem.  These include the number of blocks in the file
  510. system, the number of inodes, and a pointer to a list of free
  511. blocks.
  512.  
  513.     A file is made up of an inode and some number of data blocks
  514. from the data area of the disk.  The inode is the center of
  515. activity in the Berkeley filesystem.  It contains information such
  516. as file block locations, file ownership, access permissions, and
  517. file type.
  518.  
  519.     The problem with this system comes as the disk got larger and
  520. transfer rates faster.  When accessing a typical file, the inode is
  521. first read, then some data from the file is typically transferred.
  522. The distance between the inode and its data blocks will typically
  523. incur a long seek across the disk.  This seek is time intensive, and
  524. the file data may not be retrieved or written before the disk head
  525. can physically get there.
  526.  
  527.     The BSD 4.2 Fast File System gets around this problem by
  528. breaking the disk up into smaller chunks called cylinder groups.
  529. Each cylinder group contains an inode area and a data area.  The
  530. idea is to place data related to an inode within the same or near
  531. cylinder group to reduce the disk head movement.  This also tends
  532. to reduce file fragmentation as the disk blocks for the file are
  533. located closer together.
  534.  
  535.     Another optimization made in the BSD filesystem was the
  536. introduction of filesystem blocks which are made of up smaller
  537. fragment blocks. File blocks are allocated in units of filesystem
  538. blocks, with the remainder allocated to fragment blocks.  This
  539. scheme guarantees to localize filesystem size blocks of file data
  540. together, achieve greater disk throughput by minimizing seek time
  541. and maximizing the transfer block size.
  542.  
  543. So, a BSD 4.2 filesystem may be organized on the disk as follows:
  544.     [  cg 0  |  cg 1  |  cg 2  |  cg 3  |  ... ...  ]
  545.  
  546. Where each cg is organized as:
  547.     [  Data Area | Superblock | Inode Area | Data Area  ]
  548.  
  549.     You may wonder why the inode area is located inside the data
  550. area. The reason is another goal in the development of BFFS.  To
  551. improve reliability.  You will notice the superblock is replicated
  552. for every cylinder group on the disk.  The first cg contains the
  553. only working superblock, the others contain a static copy of the
  554. superblock, which are not usually referenced after filesystem
  555. creation. The inode area floats to a different fixed location
  556. inside each cylinder group. This reduces the possibility that a
  557. single head or cylinder loss could jeopardize all data on the disk.
  558.  
  559.     The above additions make for a much more complex
  560. implementation, consuming fast CPU time in place of slow disk time.
  561.  
  562. APPENDIX D: Differences between BFFS and the standard Amiga FFS
  563.  
  564.     When executing directory listings, you should notice less disk
  565. head movement with BFFS than with FFS.  This is mainly due to the
  566. required localization of inodes.  What will typically happen is:
  567.     A seek to read the directory inode if it is not already cached
  568.     A seek to read the directory's filenames and inode numbers
  569.     Multiple seeks in the inode area to read file inodes
  570. ** Up to 72 inodes can be stored in a single cylinder of a floppy
  571.  
  572.     The hidden bit is used by BFFS to represent a soft link.  This is
  573. only a temporary measure until more Amiga programs become aware of soft
  574. links.  You will notice that that most "list" programs show soft links
  575. as directories.  This is a fault of the list program and not the
  576. filesystem.  Currently, most applications do not work correctly with
  577. soft links.  Hopefully more will work correctly in the future (OS 3.0).
  578.  
  579.     Permissions for files are as expected.  Except that Write
  580. permission and Delete permission are currently identical.  In future
  581. releases of BFFS, a file's Delete permission may take on the Write
  582. permission of the parent directory.  OS 3.0 extended information is
  583. supported for a file's group and other permissions.
  584.  
  585.     Permissions for directories are currently ignored.  This will
  586. change in a future release to be:  
  587.   The Execute bit will determine if a directory may be accessed.
  588.      The Read bit will determine if the entries in a directory are visible.
  589.     The Write bit will determine if files may be created in the directory.
  590.      The Pure bit will determine if special files in a directory are seen.
  591.  
  592.     Directory comments are used to BFFS to provide additional
  593. information about the file listing.  BFFS does not allow the user to
  594. change the directory comments like FFS does.  These comments must be
  595. enabled using BFFStool.  There are two types of comments (which may
  596. be combined).  The first is symlink and char/block device information.
  597. The second is inode information not presented by the OS 2.0 FileInfoBlock.
  598.  
  599. APPENDIX E: Information useful to programmers
  600.  
  601. BFFS supports the following packets (ACTIONs):
  602.     IS_FILESYSTEM        LOCATE_OBJECT        EXAMINE_OBJECT
  603.     READ            WRITE            EXAMINE_NEXT
  604.     FINDINPUT        FINDOUTPUT        FINDUPDATE
  605.     END            FREE_LOCK        SEEK
  606.     DELETE_OBJECT        RENAME_OBJECT        RENAME_DISK
  607.     CREATE_DIR        COPY_DIR        PARENT
  608.     DISK_INFO        SAME_LOCK        SET_PROTECT
  609.     INFO            WRITE_PROTECT        MORE_CACHE
  610.     DISK_CHANGE        INHIBIT            FLUSH
  611.     DIE            CURRENT_VOLUME        MAKE_LINK
  612.                 EXAMINE_FH
  613.  
  614. I intend on (eventually) supporting:
  615.     SET_FILE_SIZE        READ_LINK        COPY_DIR_FH
  616.                 FH_FROM_LOCK        ADD_NOTIFY
  617.     PARENT_FH        EXAMINE_ALL        REMOVE_NOTIFY
  618.  
  619.  
  620. Sending the filesystem an ACTION_DIE will put the filesystem in a
  621. quiescent state and deallocate all dynamic memory.  Querying system
  622. statistics (ie: by using BFFSTool) will reactivate the filesystem.
  623. I've ran into problems with messydisk.device supporting the
  624. TD_REMCHANGEINT packet correctly.  Because of this, the filesystem
  625. will look for this name and substitute trackdisk.device for the
  626. disk change information.  I've also had a problem with the older
  627. version of mfm.device (2.0).  Apparently it cannot handle reading
  628. a chunk of data across a cylinder boundary.  I know this is fixed
  629. in version 40.9, and most likely earlier versions as well.
  630.  
  631. There is an additional packet type the filesystem supports:
  632. ACTION_FS_STATS (value 2999, unofficial) is used by BFFSTool to
  633. get a pointer to the statistics data structures.  Once BFFSTool
  634. has that pointer, it has immediate access to many of
  635. BFFSFileSystem's internal variables.
  636.  
  637. BFFS supports some additional EntryTypes in the FileInfoBlock of
  638. Examined file locks.  Specifically:
  639.     ST_BDEVICE   -10          ST_LIFO   -13
  640.     ST_CDEVICE   -11          ST_FIFO   -14
  641.     ST_SOCKET    -12
  642.  
  643. Per the AmigaDOS 3.0 extensions to the FileInfoBlock, OwnerID
  644. and GroupID, as well as the group and other permissions are now
  645. available in the FileInfoBlock.
  646.  
  647. Packets also implemented:
  648.     ACTION_CREATE_OBJECT   2346    (published packet)
  649.     ACTION_SET_DATES       2998    (unofficial)
  650.  
  651. APPENDIX F: Troubleshooting Suggestions
  652.  
  653. Situation:  You went against my advice of testing with a MountList
  654.         entry first and now you are whimpering, your head on the
  655.         keyboard, the machine at a "Software Failure".  In other
  656.         words, The machine crashes on boot, with no escape.
  657. Suggestion: Pull out a gun...no...  Well, obviously, you don't want
  658.         the machine to try to automount the disk.  Your hard
  659.         drive controller may have a jumper that you can pull or
  660.         set to disable autoboot.  If so, do this.  If not, you
  661.         might try unplugging your drive from the bus on powerup,
  662.         then back in after the machine has booted (off floppy,
  663.         or if you're lucky another drive).  Then use your handy
  664.         dandy disk partitioner thing (HDToolBox for Commodore
  665.         controllers) to remove that partition.  If that doesn't
  666.         work, you might try using my rdb editor to manually
  667.         remove the entry for that partition from the RDB.
  668.  
  669.  
  670. Situation: The machine does not read any BFFS floppies and you are
  671.        using mfm.device.  It seems to (almost) work, as the drive
  672.        grinds back and forth several times before giving you an
  673.        error (when you set Reserved=0 in MountList).
  674.  
  675. Possible Problem: You are using an old version of mfm.device.  Get
  676.        a newer version.  I know version 40.9 works ok.
  677.  
  678. Possible Problem: The floppy has an incompatible superblock.  If it's
  679.        a 386BSD floppy (or any other floppy written with an Intel
  680.        processor), forget it for now.
  681.  
  682.  
  683. Situation: The floppy is not accessed at all, and you get nothing
  684.        when you try to access bf0:
  685.  
  686. Possible Problem: The filesystem handler does not exist where the
  687.        MountList tells AmigaDOS to find it.  The example
  688.        MountList.BFFS requires BFFSFileSystem be put in L:
  689.  
  690. Possible Problem: The device specified in the MountList does not
  691.        exist in the expected location.  If no path is specified,
  692.        AmigaDOS checks the Devs: directory.
  693.  
  694. Possible Problem: The wrong Unit was specified in the MountList.
  695.        This can actually cause a lot of programs to crash
  696.        unexpectedly for some reason.
  697.  
  698.  
  699. Situation: Filesystem GURUs when disk is changed
  700.  
  701. Possible Problem: You're using an older version of messydisk.device
  702.           which doesn't support disk change ints correctly.
  703.           Upgrade messydisk or get the new mfm.device from
  704.           Consultron or Commodore.
  705.  
  706.  
  707. Situation: Filesystem GURUs at some seemingly random point.
  708.  
  709. Suggestion: Drop some email to Chris.Hooper@gdls.com describing your
  710.         problem and what I can do to duplicate it.  If I can't
  711.         duplicate it (or find it relatively easy), it's not in
  712.         there.  ;)
  713.  
  714. Solution: Disassemble; fix; reassemble yourself.  :)
  715.