home *** CD-ROM | disk | FTP | other *** search
/ hobbes.nmsu.edu / 2008-06-02_hobbes.nmsu.edu.zip / dos / hpfs4dos.zip / HPFS4DOS.DOC < prev    next >
Text File  |  1995-10-10  |  28KB  |  636 lines

  1.                           ┌────────────────┐
  2.                           │  HPFS4DOS.doc  │
  3.                           └────────────────┘
  4.  
  5.              ┌──────────────────────────────────────────┐
  6.              │                Access to                 │
  7.              ├──────────────────────────────────────────┤
  8.              │    HPFS partitions using DOS drivers     │
  9.              └──────────────────────────────────────────┘
  10.  
  11.  
  12.                             Adolfo Di Mare
  13.                      <adimare@cariari.ucr.ac.cr>
  14.  
  15.  
  16.         ┌─────────┐                                ┌─────────┐
  17.         │   FAT   │──────────────────────────────»>│  HPFS   │
  18.         │=■=======│                                │=======■=│
  19.         └─────────┘<«──────────────────────────────└─────────┘
  20.  
  21.            iHPFS                                   HPFS Access
  22.         Marcus Better                            Andreas Kinzler
  23.  
  24.  
  25.  
  26.  
  27.                                 Index
  28.                                 ─────
  29.  
  30.           1.- Disclaimer
  31.           2.- Why an HPFS driver?
  32.           3.- Finding a copy of the drivers
  33.           4.- Using an HPFS driver for DOS
  34.           5.- Mixing and matching drive letters
  35.           6.- CD-Rom and RamDisk
  36.           7.- Further explanations
  37.           8.- Switching HPFS drivers
  38.           9.- REhpfs.bat
  39.          10.- Further Reading
  40.  
  41.  
  42.    This document is based on the work done by:
  43.    ──────────────────────────────────────────
  44.        Marcus Better   <Marcus.Better@abc.se>
  45.        Andreas Kinzler <akinzler@rbg.informatik.th-darmstadt.de>
  46.  
  47.  
  48. 1.- Disclaimer  Use the included information at your own risk.
  49. ──────────────  - Blame only yourself if anything goes wrong.
  50.                 - Don't blame me.
  51.                 - Please understand that I didn't do much thinkering 
  52.                   to write this up.
  53.  
  54.                  Remember: it's your disk, you're on your own!
  55.  
  56.  
  57.  
  58. 2.- Why an HPFS driver?
  59. ───────────────────────
  60.  
  61. People who work with OS/2 know that HPFS is a far better file system, 
  62. basically for three reasons:
  63.      1) HPFS disk partitions fit more data than equally sized FAT 
  64.         partitions.
  65.      2) HPFS disk access is faster than FAT access.
  66.      3) HPFS partitions are more robust.
  67.  
  68. When a partition is formated using FAT what happens is that an array 
  69. of pointers, called the File Allocation Table [FAT] is created. Each 
  70. of the entries in the FAT array points to a File Allocation Unit, or 
  71. cluster as CHKDSK calls it, which is the minimum size of disk storage 
  72. that the FAT file system will assign to a file.
  73.  
  74. The main problem with FAT is its 16-bit restriction, because the FAT 
  75. array can have no more than 64k entries. This means that if a disk is 
  76. very large, the mininum size for the file allocation unit grows also 
  77. very large.
  78.  
  79. A decade ago disks where not really big. A very fat disk will have 100 
  80. Megs of storage, which means that its cluster size would be quite 
  81. small: only 2k. However, with current disk sizes going over the one 
  82. Gig barrier, cluster sizes of 16k and 32k are now common.
  83.  
  84. Why is a 32k cluster size bad? Well, if a file is to be stored in the 
  85. disk, then it will occupy at least one cluster. Most files are small, 
  86. which means that in the long run the vast mayority of stored files 
  87. will occupy big clusters, wasting a lot of space. For example, if your 
  88. AUTOEXEC.bat file is 2,000 bytes longs (which is quite big), then you 
  89. will be be wasting 32k-2k=30k to store it! This shocking shortcomming 
  90. of the FAT file system is called External File Fragmentation.
  91.  
  92. Furthermore, when the operating system access a FAT disks it must read 
  93. a whole cluster regardless of the file size. For the above example, 
  94. this means that eventhough only 2k worth of data is stored in your 
  95. AUTOEXEC.bat, the file system will nevertheless read in 32k: 16 times 
  96. more resources will be used than what it's required!
  97.  
  98. This explains why the FAT file system will die soon. HPFS, and other 
  99. file systems, have no 16-bit limits and use clusters that are only 512 
  100. bytes long. That's one of the main reason why people have turned to 
  101. OS/2. Besides this, FAT has other technical problems.
  102.  
  103. The following table shows the cut points where the cluster duplicates 
  104. its size as the partition gets bigger. The percentage in the third 
  105. column is an estimate of the efficiency of the file system, this is, 
  106. it shows how much of the storage is wasted to big clusters due to 
  107. external fragmentation (I extracted this data from the article by Jeff 
  108. Prosise in PC Magazine).
  109.  
  110.                             FAT Efficiency
  111.                             ══════════════
  112.  
  113.           ┌────────────────┬────────────────┬──────────────┐
  114.           │  Biggest disk  │    Required    │  Efficiency  │
  115.           │      size      │  Cluster Size  │              │
  116.           ├────────────────┼────────────────┼──────────────┤
  117.           │     32 Megas   │   512 bytes    │      99%     │
  118.           │     64 Megas   │ 1,024 bytes    │      99%     │
  119.           │    128 Megas   │       2K       │      98%     │
  120.           │    256 Megas   │       4K       │      96%     │
  121.           ├────────────────┼────────────────┼──────────────┤
  122.           │    512 Megas   │       8K       │      92%     │
  123.           │  1,024 Megas   │      16K       │      83%     │
  124.           │      2 Gigas   │      32K       │      70%     │
  125.           │      4 Gigas   │      64K       │      52%     │
  126.           └────────────────┴────────────────┴──────────────┘
  127.  
  128. The meaning of the numbers in the above table is the following. If you 
  129. have a partition bigger than 512 Megabytes, then when you format using 
  130. FAT you will get 16K clusters, which means that your file efficiency 
  131. will drop down to 83%. This means that due to FAT limitations you will 
  132. be wasting 17% of your disk. For example, for your new 1.0 Giga disk 
  133. FAT uses 16k clusters, which means that you put to waste 170 Megs! If 
  134. you happen to have a 4 Giga disk then half of it will be wasted by 
  135. FAT. This figures presume an average file size of 3K: your milleage 
  136. will vary depending on your disk usage.
  137.  
  138. This explains why some people argue that OS/2 deletes their files when 
  139. they move them to an HPFS partition: as HPFS is nearly 100% efficient, 
  140. they think that not all the data got copied! What really happened is 
  141. that all the disk space lost to external fragmentation didn't get 
  142. copied, and the HPFS file system simple reclaimed that wasted space. 
  143. FAT is a waste!
  144.  
  145. Now that I convinced you to use HPFS on partitions bigger than 128 
  146. Megs, let me tell you how can you access that data from MS-DOS.
  147.  
  148.  
  149. 3.- Finding a copy of the drivers
  150. ─────────────────────────────────
  151.  
  152. The first thing you need to do is to get one of the available drivers 
  153. to access your HPFS partitions from DOS. I found the following in the 
  154. Hobbes OS/2 archives (their also available at Simtel):
  155.  
  156. hpfsa02b.zip 165,254 Aug-95 HPFS driver for DOS, read & write, 8k mem
  157. ihpfs121.zip  14,295 Sep-95 iHPFS v1.21, DOS installable HPFS driver
  158.  
  159. amos320.zip   41,402 Jan-95 TSR for mounting HPFS drives from DOS
  160. hpfsds10.zip 106,367 Jan-95 HPFSDOS 1.00 - HPFS from DOS (read only)
  161. hpfsr16e.zip  20,615   1993 Read HPFS-partitions under plain DOS
  162.  
  163. To get these files, ftp to hobbes.nmsu.edu or to any of its mirrors 
  164. and change directory to /dos. In there you will find the files, or 
  165. their newer versions.
  166.  
  167. After getting the zipped files, unzip them into a directory. I set up 
  168. all of them in my C:\BIN\HPFS4DOS subdirectory. C: is the drive from 
  169. where I boot MS-DOS, and it's formated under FAT.
  170.  
  171.  
  172. 4.- Using an HPFS driver for DOS
  173. ────────────────────────────────
  174.  
  175. The drivers I have tried are iHPFS and HPFS_access (by Marcus Better 
  176. and Andreas Kinzler respectively). Both drivers load as TSR programs 
  177. (Terminate and Stay Resident), and assign to each HPFS partition a 
  178. drive letter. After this, each HPFS partition looks to DOS as a 
  179. regular (network) drive, and files in the HPFS partitions can be 
  180. accessed from any DOS program.
  181.  
  182. iHPFS is freeware in the sense that you may copy it for free and 
  183. upload it everywhere (as long as you include the docs and don't alter 
  184. anything). However, iHPFS will not let you write into an HPFS 
  185. partition. HPFS_access can write into HPFS partitions, but after 
  186. writting 16 Megabytes or 20 minutes, whatever comes first, it will set 
  187. to READ-ONLY the HPFS partition. This, I think, encourages users to 
  188. register their copies.
  189.  
  190. A neat feature in both drivers is that they can be unloaded from 
  191. memory. I have been playing around with both of them, and I can swap 
  192. one for the other. To do this, I wrote a batch file called REhpfs.bat, 
  193. which I also include in this document.
  194.  
  195. I have found that when I install HPFS_access from my AUTOEXEC.bat file 
  196. afterwards it will refuse to unload (it complains about interrupt 
  197. vector $2 being already superseeded). But if I install iHPFS first 
  198. then I can swap one for the other as many times as I want. However, 
  199. every time I swap iHPFS out it will leave a small TSR stub.
  200.  
  201. I contacted Marcus Better about this, and he sent me the following 
  202. explanation:
  203.  
  204.      iHPFS uses some software interrupts. In DOS, this is done by 
  205.      hooking onto a chain of interrupt service routines. When iHPFS is 
  206.      uninstalled, it needs to remove itself from this chain. If, in 
  207.      the meantime, another TSR is installed that uses the same 
  208.      interrupt, just restoring the chain to the state it was in prior 
  209.      to the installation of iHPFS may damage the chain.
  210.  
  211.      The only proper way to remove a TSR without doing any damage is 
  212.      to leave the interrupt chain as it is, and just deactivate the 
  213.      service routine, so that it passes all interrupts to the next TSR 
  214.      in the chain. This requires that a small piece of the program's 
  215.      code is left in memory, and that is why the stub of 320 bytes or 
  216.      so remains after iHPFS is uninstalled. Except for passing on 
  217.      interrupts, this stub is completely inactive.
  218.  
  219.      If the TSR is written so that to uninstall it instead tries to 
  220.      restore the interrupt vector to its original state, then when 
  221.      another TSR program is installed after the driver it won't be 
  222.      able to uninstall without damaging the other TSR, and so the 
  223.      driver (quite correctly) must refuse to uninstall. This is what 
  224.      happens with iHPFS, but other TSRs like MSCDEX should also cause 
  225.      the same behaviour.
  226.  
  227. To me, what this says is that DOS sucks, and that there's no way to do 
  228. things right. You can always reboot if you want to clean things up, or 
  229. if you don't like the memory map that MEM /C gets you from the DOS 
  230. command prompt.
  231.  
  232.  
  233. 5.- Mixing and matching drive letters
  234. ─────────────────────────────────────
  235.  
  236. As it was probably the case for most OS/2 users, most of my software 
  237. runs in the DOS platform. And as it also happened to you, I installed 
  238. OS/2 when I got my 1.2 Gig hard drive. Previously, I had only a 322 
  239. Meg drive, formated with FAT using 8k clusters (and wasting almost 10% 
  240. of my storage capacity!). My setup was the following:
  241.  
  242.      DRIVE #1
  243.      Letter: C:
  244.      322 Megs
  245.      FAT
  246.      DOS v6.2
  247.  
  248. When I got my newer drive, I decided to use my older drive as the 
  249. second drive. I was carefull to get a same-brand drive, which probably 
  250. saved me quite some hours of pain, as oftentimes different brand 
  251. drives won't talk to each other. My configuration would look like 
  252. this:
  253.  
  254.      DRIVE #1       DRIVE #2
  255.      Letter: C:     Letter: D:
  256.      1.2 Gigs       322 Megs
  257.      FAT            FAT
  258.      30% waste      8% waste
  259.  
  260.  
  261. After I installed the newer drive, I found that I could not format it 
  262. to be bigger than 528 Megs! My machine is not that new, which means 
  263. that its BIOS has a restriction that will not let it see disk 
  264. cylinders beyond 1,024. There's a fix for this, developed by Ontrack. 
  265. (The Ontrack driver to access big disks came in the newer disk, but 
  266. I'm using one that I downloaded from the net).
  267.  
  268. What the Ontrack driver does is to install itself in the MBR, or 
  269. Master Boot Record, so that when the computer boots the first thing 
  270. that will load is the Ontrack driver. This driver patches the BIOS and 
  271. does away with the 1,024 cylinder limitation: after that DOS can read 
  272. bigger disks (the same goes for any other operating system that uses 
  273. the BIOS to access disks). With this Ontrack software I was able to 
  274. format my Hard Drive #1 to its 1.2 Gig full capacity.
  275.  
  276. Latter I learned that the newer disk drivers for OS/2 can handle big 
  277. disks with no problem, but you must use the newer versions of the OS/2 
  278. drivers (you can get these at Hobbes too):
  279.  
  280.      IBM1S506 add    28,328  15-Jan-95  21:21:26
  281.      OS2DASD  dmd    33,578  04-Jan-95  20:52:32
  282.      IBMIDECD flt    20,490  10-Jan-95  20:47:00
  283.  
  284. What all these means is that if you will never use DOS, then you don't 
  285. need to have Ontrack patch you BIOS because the IBM1S506.add and 
  286. OS2DASD.dmd will handle big disk from OS/2 directly. However, if you 
  287. are like me, then you will want to be able to boot from DOS from time 
  288. to time, and for this you will probably install Boot Manager [BM] to 
  289. launch both DOS and OS/2.
  290.  
  291. Boot Manager is a small program that lets you select the operating 
  292. system that will boot in your computer. For this, it tries to install 
  293. itself into the MBR to intercept the boot process. If you already 
  294. installed the Ontrack driver, then BM will be the second in chain, and 
  295. the third will be your operating system.
  296.  
  297. The reason I didn't get rid of Ontrack from my 1.2 Gig disk is that it 
  298. let me install BM at the END of my disk, instead of forcing me to put 
  299. it at the beginning. I never liked BM to be in the first partition, 
  300. because some operating systems (like Linux, they tell me) mess it up 
  301. if it's at the beginning of the disk (see OS/2 Warp Unleashed pp 14).
  302.  
  303. After some thinking, I decided that my new 1.2 Gig drive would have 
  304. three partitions. The first one would be drive C:, the DOS bootable 
  305. partition using 127 Megs, formated in FAT with a cluster size of 2K. 
  306. The second one would be the OS/2 partition, with a total of 561 Megs 
  307. and the last one I reserved to install in 511 Megs a third operating 
  308. systems (like Win95): this I formated under FAT with 8k clusters. The 
  309. second drive became drive letter D:, and I installed OS/2 to boot from 
  310. drive E: in the first disk drive. I also have a CD-Rom (G:) and use a 
  311. RamDisk (H:). My setup looks as follows:
  312.  
  313.         ┌──────────────────────────────────────────────────────────┐
  314.         │ Name     Status        Access      FS Type        MBytes │
  315.         ├──────────────────────────────────────────────────────────┤
  316. Disk #1 │ DOS      Bootable    C: Primary    FAT-->2K         127  │
  317. 1.2 Gig │ OS/2     Bootable    E: Logical    HPFS             561  │
  318.         │          None        F: Logical    FAT-->8K         511  │
  319.         │          Startable    : Primary    BOOT MANAGER       2  │
  320.         ├──────────────────────────────────────────────────────────┤
  321. Disk #2 │          None        D: Primary    FAT-->8K         321  │
  322.         ├──────────────────────────────────────────────────────────┤
  323. CR-Rom  │          None        G: Primary    CD-Rom           640  │
  324.         ├──────────────────────────────────────────────────────────┤
  325. RamDisk │          None        H: Primary    FAT                3  │
  326.         └──────────────────────────────────────────────────────────┘
  327.  
  328. My friends tried to convince me to leave a big 561+511 HPFS partition 
  329. instead of using drives E:+F:, but I want to thinker with other 
  330. operating systems so I'm keeping my F: FAT partition. I can always 
  331. reformat it, and there are programs to make my E: partition bigger 
  332. without losing the data in it (look into FIPS, by Arno Schaefer 
  333. <schaefer@rbg.informatik.th-darmstadt.de>, or buy PartitionMagic).
  334.  
  335. After I had OS/2 up and running I tried to install the iHPFS driver to 
  336. access my E: partition from DOS. There I found two problems. First, 
  337. upon boot DOS will not recognize my E: partition, and will name my 511 
  338. Meg F: partition as drive E:. And second, when I finally managed to 
  339. have DOS recognize my HPFS partition, the drive letters will come up 
  340. backwards: OS/2 drive E: will be drive F: in DOS, and OS/2 drive F: 
  341. will be E: in DOS.
  342.  
  343. To solve my first problem I installed in my DOS CONFIG.sys a dummy 
  344. driver, called DUMBDRV.sys, which simply reserves a drive letter.  
  345. Marcus Better, the author of iHPFS, is also the person who wrote 
  346. DUMBDRV.sys, and he distributes it as freeware in the same package 
  347. where iHPFS can be found. After DUMBDRV.sys reserves a drive letter it 
  348. must be released before it can be used. This is what the program 
  349. KILLDRV.exe does. To sum it put, what I did to access my OS/2 
  350. partition was to include the following lines in my DOS startup files:
  351.  
  352.      Added to CONFIG.sys
  353.      ===================================
  354.      DEVICE=C:\BIN\HPFS4DOS\DUMBDRV.sys   ==> Reserve letter F:
  355.  
  356.      Added to AUTOEXEC.bat:
  357.      ===================================
  358.      C:\BIN\HPFS4DOS\KILLDRV F:           ==> Release Drive F:
  359.      C:\BIN\HPFS4DOS\IHPFS /L F:1 /C=512  ==> Install iHPFS
  360.                                               as drive F:
  361.  
  362. At this point in time, the HPFS drive is F:, and the FAT drive is E:, 
  363. exactly backwards as I use them in OS/2. To swap them back to their 
  364. right names I wanted to use the ASSIGN.com command. However, I 
  365. discovered that beginning with version 6.0, Microsoft removed the 
  366. ASSIGN.com from MS-DOS. Looking into my DOS manual I found that there 
  367. is something called the "Supplemental Disk", which has the missing 
  368. commands. After some fishing in the Internet, here is where I found 
  369. ASSIGN for each of the current MS-DOS versions.
  370.  
  371. Site: ftp.microsoft.com       Directory: /Softlib/MSLFILES
  372. =======================       ============================
  373.  
  374. FileName      Size     Date      Description
  375. ------------ -------  --------  -----------------------------------
  376. DOS6SUPP.EXE 537,136  Apr-1993  MS-DOS 6.0   Supplemental Files
  377. DOS62SP.EXE  763,182  Dec-1993  MS-DOS 6.2   Supplemental Disk Util
  378. SUP621.EXE   755,334  Jun-1994  MS-DOS 6.21  Supplemental Disk
  379. SUP622.EXE   781,125  Jun-1994  MS-DOS 6.22  Supplemental Disk
  380. MW6SUP.HQX   824,319  Sep-1994  Supplemental File Converters
  381.  
  382. The file /Softlib/index.txt @ ftp.microsoft.com contains the 
  383. description of all the service packs and software upgrades offered 
  384. freely by Microsoft through the Internet. The above file descriptions 
  385. were taken from this descriptor file. Use binary download to get these 
  386. files with ftp.
  387.  
  388. Don't forget to expand the ASSIGN.co_ file to obtain ASSIGN.com. For 
  389. this, you must use the MicroSoft provied EXPAND.exe command which come 
  390. with our MS-DOS diskettes. Be carefull: the OS/2 Expand command cannot 
  391. unpack ASSIGN.co_. You can also find EXPAND in the Supplemental Disk 
  392. that you can download from ftp.microsoft.com.
  393.  
  394. After all this, these are the lines that I added to my CONFIG.sys and 
  395. AUTOEXEC.bat files:
  396.  
  397.      Added to CONFIG.sys:
  398.      =======================================
  399.      DEVICEHIGH=C:\BIN\HPFS4DOS\DUMBDRV.sys   ==> Reserve F:
  400.  
  401.      Added to AUTOEXEC.bat:
  402.      =======================================
  403.      C:\BIN\HPFS4DOS\KILLDRV F:               ==> Release F:
  404.      C:\BIN\HPFS4DOS\IHPFS /L F:1 /C=512      ==> iHPFS is F:
  405.      C:\BIN\HPFS4DOS\ASSIGN E=F F=E           ==> Swap E: <==> F:
  406.  
  407. As I mentioned before, I maintain all my HPFS4DOS in my C:\BIN 
  408. subdirectory, and all these commands and drivers are invoked from 
  409. there.
  410.  
  411.  
  412. 6.- CD-Rom and RamDisk
  413. ──────────────────────
  414.  
  415. The couple [DUMBDRV.sys, KILLDRV.exe] can be used to install a RamDisk 
  416. in a higher drive letter than the one for the CD-Rom. The problem is 
  417. that to access the CD-Rom from DOS it is necesary to load MSCDEX.exe 
  418. in the AUTOEXEC.exe file, which is processed after CONFIG.sys.
  419.  
  420. The trick it to invoke DUMBDRV.sys in CONFIG.sys before creating the 
  421. RamDisk, to force the RamDisk to use a higher drive letter. Later on, 
  422. when AUTOEXEC.exe is being processed, the drive letter grabbed by 
  423. DUMBDRV.sys can be released for MSCDEX.exe to use, as it's shown in 
  424. the following code:
  425.  
  426.      Added to CONFIG.sys:
  427.      =========================================
  428.      DEVICEHIGH=C:\BIN\HPFS4DOS\DUMBDRV.sys    ==> Reserve F:
  429.      DEVICEHIGH=C:\BIN\HPFS4DOS\DUMBDRV.sys    ==> Reserve G:
  430.  
  431.      DEVICE=C:\BIN\SB16\CCD.SYS /D:MSCD001     ==> CD-Rom driver
  432.      DEVICE=C:\DOS\RAMDRIVE.SYS 3072 256 48 /E ==> RamDrive H:
  433.  
  434.  
  435.      Added to AUTOEXEC.bat:
  436.      =========================================
  437.      C:\BIN\HPFS4DOS\KILLDRV G:                ==> Release G:
  438.      C:\DOS\MSCDEX.EXE /D:MSCD001 /M:4 /L:G    ==> CD-Rom is G:
  439.  
  440.      C:\BIN\HPFS4DOS\KILLDRV F:                ==> Release F:
  441.      C:\BIN\HPFS4DOS\IHPFS /L F:1 /C=512       ==> F: is HPFS
  442.      C:\BIN\HPFS4DOS\ASSIGN E=F F=E            ==> Swap E: <==> F:
  443.  
  444.  
  445. 7.- Further explanations
  446. ────────────────────────
  447.  
  448. The following text comes from the documentation in the AMOS3.doc file 
  449. that accompanies the AMOS.exe HPFS driver, written by Allan Mertner 
  450. <mertner@login.dknet.dk>. AMOS v3 has capabilites similar to iHPFS and 
  451. HPFS_access. I transcribe his explanation here for your convenience.
  452.  
  453.    * In some cases, the drive letters AMOS v3 assigns to your partitions
  454.      differs from the ones you usually have under OS/2.  This is sad,
  455.      but there is not much I can do about it - and there is a workaround.
  456.  
  457.      The problem for AMOS v3 is, of course, that it cannot use a drive
  458.      letter which has already been used by DOS.  Let's have an example:
  459.  
  460.      Joe has a hard disk which is partitioned like this:
  461.  
  462.        C:  FAT    Dos Boot drive
  463.        D:  HPFS   OS/2 Boot drive
  464.        E:  HPFS   Lots of data
  465.  
  466.      In addition to this, Joe also has a CD-ROM assigned to drive letter F:.
  467.  
  468.      When Joe boots DOS, DOS assigns the following drive letters:
  469.  
  470.        C:  FAT    Dos Boot Drive
  471.        D:  CDROM
  472.  
  473.      - because DOS cannot see the HPFS drives.  When Joe now loads AMOS v3,
  474.      the first available drive letter is E:.  AMOS v3 cannot reassign
  475.      drive letters used by DOS, so the final drive lettering becomes
  476.  
  477.        C:  FAT    Dos Boot drive
  478.        D:  CDROM
  479.        E:  HPFS   OS/2 Boot drive
  480.        F:  HPFS   Lots of data
  481.  
  482.      This is the easy case!  Joe could either use the /L: parameter for
  483.      MSCDEX to load the CD-ROM as drive F:, or load AMOS v3 before loading
  484.      MSCDEX - this would give him his normal drive lettering.
  485.  
  486.  
  487.      Now Joe adds another hard disk, containing one single partition, which
  488.      he has formatted using the FAT file system.  His drive letters look
  489.      like this:
  490.  
  491.      OS/2  DOS
  492.        C:   C:   FAT    Dos Boot Drive
  493.        D:   F:   HPFS   OS/2 Boot Drive
  494.        E:   G:   HPFS   Lots of data
  495.        F:   D:   FAT    Joe's new disk
  496.        G:   E:   CD-ROM
  497.  
  498.      Everything is wrong!  And loading the drivers in a different way will
  499.      not change the fact, that Joe's new disk is occupying the D-Drive.  This
  500.      is a lesson learned: Try to avoid placing FAT drives AFTER HPFS drives.
  501.      Always, always, always keep FAT drives before the HPFS drives.  Since
  502.      this is not always possible in real life, fortunately there is a
  503.      solution that works in most cases: ASSIGN.
  504.  
  505.      The DOS ASSIGN utility can change the meaning of drive letters, and
  506.      can actually solve Joe's problems.  All he has to do is write
  507.  
  508.      ASSIGN D=F,F=D,E=G,G=E
  509.  
  510.      This effectively swaps the meaning of drive letters D-F, and E-G.  If
  511.      YOU find a program where this workaround does not work, please let me
  512.      know...
  513.  
  514.  
  515. 8.- Switching HPFS drivers
  516. ──────────────────────────
  517.  
  518. I wrote the REhpfs.bat command to change from iHPFS and HPFS_access. 
  519. To keep track of things, I create a file in the C:\ root directory 
  520. that tells which of the two drivers is currently in use:
  521.      C:\IHPFS        ==> File exists when iHPFS is loaded
  522.      C:\HPFSacc.ess  ==> File exists when HPFS_access is loaded
  523.  
  524. In my AUTOEXEC.bat file I always load iHPFS, and I can later swap it 
  525. out to use HPFS_access. If I go the other way around then HPFS_access 
  526. won't unload. Taking all this into account, these are the relevant 
  527. contents of my CONFIG.sys and AUTOEXEC.bat file:
  528.  
  529.      Added to CONFIG.sys:
  530.      =========================================
  531.      DEVICEHIGH=C:\BIN\HPFS4DOS\DUMBDRV.sys    ==> Reserve F:
  532.      DEVICEHIGH=C:\BIN\HPFS4DOS\DUMBDRV.sys    ==> Reserve G:
  533.  
  534.      DEVICE=C:\BIN\SB16\CCD.SYS /D:MSCD001     ==> CD-Rom driver
  535.      DEVICE=C:\DOS\RAMDRIVE.SYS 3072 256 48 /E ==> RamDrive H:
  536.  
  537.  
  538.      Added to AUTOEXEC.bat:
  539.      =========================================
  540.      C:\BIN\HPFS4DOS\KILLDRV G:                ==> Release G:
  541.      C:\DOS\MSCDEX.EXE /D:MSCD001 /M:4 /L:G    ==> CD-Rom is G:
  542.  
  543.      C:\BIN\HPFS4DOS\KILLDRV F:                ==> Release F:
  544.      C:\BIN\HPFS4DOS\IHPFS /L F:1 /C=512       ==> F: is iHPFS
  545.      C:\BIN\HPFS4DOS\ASSIGN E=F F=E            ==> Swap E: <==> F:
  546.  
  547.      IF EXIST C:\HPFS_acc.ess del C:\HPFS_acc.ess ==> Delete other
  548.      ECHO Using iHPFS>C:\iHPFS.                ==> Create C:\iHPFS.
  549.  
  550.  
  551. 9.- REhpfs.bat
  552. ──────────────
  553.  
  554. :: REhpfs.bat ==> Reload a new driver to access HPFS partitions from DOS
  555. ::                - /A Reloads Andreas Kinzler's HPFS_access
  556. ::                - /I Reloads Marcus Better's iHPFS
  557. ::                - swaps back E: and F: drive letters
  558. ::                - Reloads current driver if no arguments are issued.
  559. @echo off
  560.  
  561. :: Synchronize current ASSIGN.com version with MS-DOS's
  562. VER | FIND /I "6.20" >NUL
  563. IF ERRORLEVEL 1 echo REhpfs.bat: Works ONLY with MS-DOS v6.20
  564. IF ERRORLEVEL 1 goto _out
  565.  
  566. :: Change back drive letters to their original names
  567. CD E:\
  568. CD F:\
  569. SMARTDRV /c /r /q
  570.    C:\BIN\HPFS4DOS\ASSIGN E=E F=F
  571. :: C:\BIN\HPFS4DOS\ASSIGN
  572.  
  573. :: Remove the HPFS driver
  574. IF EXIST C:\iHPFS.       C:\BIN\HPFS4DOS\IHPFS   /u
  575. IF EXIST C:\HPFS_acc.ess C:\BIN\HPFS4DOS\WIN_ENG
  576.  
  577. :: When HPFS_access is installed at boot time, it CANNOT be uninstalled
  578. :: - That's the reason NOT to load it before any other HPFS driver
  579. MEM /C | FIND /I "HPFS" | FIND "8,048" >nul
  580. IF NOT ERRORLEVEL 1 echo ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  581. IF NOT ERRORLEVEL 1 echo █ CANNOT uninstall HPFS_access because it was loaded at boot █
  582. IF NOT ERRORLEVEL 1 echo ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  583.  
  584. :: This code looks for the following line in the MEM /c listing: 
  585. ::
  586. :: Name           Total       =   Conventional   +   Upper Memory
  587. :: --------  ----------------   ----------------   ----------------
  588. :: MSDOS       17,245   (17K)     17,245   (17K)          0    (0K)
  589. :: HPFS         8,048    (8K)      8,048    (8K)          0    (0K)
  590.  
  591. :: Reloads HPFS
  592. IF (%1)==(/a) goto _HPFS_access
  593. IF (%1)==(/A) goto _HPFS_access
  594. IF (%1)==(/i) goto _iHPFS
  595. IF (%1)==(/I) goto _iHPFS
  596. IF EXIST C:\iHPFS.       goto _iHPFS
  597. IF EXIST C:\HPFS_acc.ess goto _HPFS_access
  598. goto _iHPFS
  599.  
  600. :_HPFS_access
  601. IF EXIST C:\iHPFS.       del C:\iHPFS.
  602. ECHO Using HPFS_access>C:\HPFS_acc.ess 
  603. C:\BIN\HPFS4DOS\WIN_ENG F=1 1024b
  604. goto _swap
  605.  
  606. :_iHPFS
  607. IF EXIST C:\HPFS_acc.ess del C:\HPFS_acc.ess
  608. ECHO Using iHPFS>C:\iHPFS.
  609. C:\BIN\HPFS4DOS\IHPFS /L F:1 /C=512
  610. goto _swap
  611.  
  612. :_swap
  613. :: Swap again drive letters
  614. C:\BIN\HPFS4DOS\ASSIGN E=F F=E
  615.  
  616. :_out
  617. :: REhpfs.bat ==> End of file
  618.  
  619.  
  620. 10.- Further Reading
  621. ───────────────────
  622.  
  623.  
  624.   Prosise, Jeff:
  625.   ──────────────
  626.   Can VFAT handle large disks?
  627.   PC Magazine, Vol.14 No.17; October 10, 1995.
  628.   pages 345, 349, 350.
  629.  
  630.  
  631.   Moskowits, David; Kerr, David:
  632.   ──────────────────────────────
  633.   OS/2 Warp Unleashed, Deluxe Edition.
  634.   SAMS publishing, ISBN 0-672-30545-3.
  635.  
  636.