home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / dos / lread10.exe / README.TXT < prev    next >
Encoding:
Text File  |  1995-05-24  |  3.2 KB  |  82 lines

  1. Welcome to lread/ldir!
  2.  
  3. This program was written for an Operating Systems class at Willamette
  4. University in Salem, Oregon, USA.  It is a DOS program (though it has
  5. been shown to work under Linux) which reads the Linux ext2 filesystem.
  6.  
  7.  
  8. USAGE
  9.  
  10. The usage is as follows:
  11.  
  12. ldir /any/Linux/path
  13.           and
  14. lread /any/Linux/path[/filename] [savefile]
  15.  
  16. where bracketed items are optional.
  17.  
  18. Ldir will printout something akin to a "ls -l" for the given directory.  It
  19. always outputs to stdout.  Lread will print actual files.  It will print to
  20. stdout unless a savefile is given in which case it will save that file on
  21. the DOS filesystem.  If lread is given a directory name instead of a file
  22. name, it will display or save a dump of the directory.  We consider the
  23. capability to both "dir" and "read" a directory a feature.
  24.  
  25.  
  26. LDIR/LREAD DIFFERENCES
  27.  
  28. As you can tell by viewing the code, the only difference between ldir and
  29. lread is the filename.  The program does a quick check of argv[0] and reacts
  30. based on the name of the called program.  Under Linux you can simply link
  31. ldir to lread, but under DOS you must make a full copy of the file.  So 
  32. compile the code to be either lread or ldir and copy the other.
  33.  
  34.  
  35. COMPILING TIPS
  36.  
  37. When you compile the code under DOS be sure to use the Compact memory model
  38. or larger.  64K of data space is not enough for parsing large directories. 
  39. Super-large directories still cause problems under DOS.
  40.  
  41.  
  42. PROGRAM OPERATION
  43.  
  44. The program works by first reading the data about the hard drive in the
  45. partition table.  It finds the first Linux partition on the first hard drive
  46. (if you have more than one, change the code... we're graduating and done
  47. with this at least for a while!).  It uses the drive specifications it finds
  48. in the table to enable DOS to use BIOS calls to read outside the DOS
  49. partition.
  50.  
  51. Using this capability, the program finds the inode of the first parameter
  52. (kind of like performing a mini "stat" under DOS).  It chases down the path
  53. piece by piece to find the inode of the last part.  It begins at the rood
  54. directory (inode 2), loads that directory, and then scans it for the inode
  55. corresponding to the next piece of the path.  It stops when it has resolved
  56. the full path or hits a softlink or filename in the middle of the path.  (If
  57. you care to allow it to follow softlinks, be my guest.  Please see my email
  58. address below as a contact point.)
  59.  
  60. With this inode the program can follow the file block by block--through the
  61. single indirect, double indirect, and triple indirect pointers.  After
  62. reading each block it either displays it or writes it to a file.
  63.  
  64. When everything has finished the program reports any errors encountered or
  65. the fact that no errors were found.  On ldir it only reports problems.
  66.  
  67. There is a list of problems and things to work on in main.c.  If you have
  68. skills and interest, feel free to tackle some code modifications.  For at
  69. least the near future work is keeping me too busy to continue working on
  70. this.  Please report bugs and comments to the addresses below.
  71.  
  72.  
  73. THE GOOD-BYE
  74.  
  75. Keep in touch on email!
  76.  
  77. jhunter@willamette.edu
  78. jhunter@engr.sgi.com
  79. dlutz@willamette.edu
  80.  
  81. Jason and Dave
  82.