[comp.sys.ibm.pc] 16-bit FAT

jca@pnet01.cts.com (John C. Archambeau) (10/29/89)

Could somedy please inform me of the necessary changes I have to make to the
BIOS parameter block in the boot sector of a DOS paition to transform it into
a 16-bit FAT?  I did this several times with an ST225, but apparently (not too
surprising actually) changing the FAT from 12 to 16 bits is totally dependant
upon the drive parameters.  The drive I want to do this with is a Seagate
ST151.  I know it can be done since I have done it with an ST225, but I don't
have access to the MS-DOS 3.x technical reference manual.  I just made a note
of the changes to do this on 4 headed 10 Mb or 20 Mb drives.  Anyway, the
parameters of an ST151 are as follows; 5 heads, 977 cylinders.  I only want to
give 10 Mb to MS-DOS and leave the rest for Minix and/or SCO Xenix when I get
around to buying the 286 version.

 /*--------------------------------------------------------------------------*
  * Flames: /dev/null (on my Minix partition)
  *--------------------------------------------------------------------------*
  * ARPA  : crash!pnet01!jca@nosc.mil
  * INET  : jca@pnet01.cts.com
  * UUCP  : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
  *--------------------------------------------------------------------------*
  * Note  : My opinions are that...mine.  My boss doesn't pay me enough to
  *         speak in the best interests of the company (yet).
  *--------------------------------------------------------------------------*/

unkydave@shumv1.uucp (David Bank) (10/31/89)

In article <611@crash.cts.com> jca@pnet01.cts.com (John C. Archambeau) writes:
>Could somedy please inform me of the necessary changes I have to make to the
>BIOS parameter block in the boot sector of a DOS paition to transform it into
>a 16-bit FAT?  I did this several times with an ST225, but apparently (not too
>surprising actually) changing the FAT from 12 to 16 bits is totally dependant
>upon the drive parameters.  The drive I want to do this with is a Seagate
>ST151.  I know it can be done since I have done it with an ST225, but I don't
>have access to the MS-DOS 3.x technical reference manual.  I just made a note
>of the changes to do this on 4 headed 10 Mb or 20 Mb drives.  Anyway, the
>parameters of an ST151 are as follows; 5 heads, 977 cylinders.  I only want to
>give 10 Mb to MS-DOS and leave the rest for Minix and/or SCO Xenix when I get

>around to buying the 286 version


     Hmmm...this certainly is an interesting question. Grabbing my IBM
PC-DOS TEch Reference, I think I'll look in Chapter 5 and try to answer
it.

     Paraphrasing, the Tech Ref has several things to say:

       1) The FAT consists of a 12-bit entry (1.5 bytes) for each
          cluster ... or a 16-bit entry (2 bytes) when a fixed disk
          is larger than 10 MB (# sectors > approx. 20K)

       2) The FAT can be 12-bit or 16-bit format. DOS determines
          which one a given disk is by looking at the total # of
          allocation units on the disk. For  all diskettes and
          fixed disk partitions of < 20740 sectors, the FAT uses
          12-bit entries; 16-bit entries are used in all other
          cases.

     I am not able to find a "descriptor byte" or similar construct that
tells DOS in one fell swoop what size FAT it is dealing with. Perhaps I
am overlooking something, but I don't think so.

     It does not seem to me to be immediately feasible to "convert" a
FAT from 12-bit to 16-bit. I would seem to me that such an operation
would destroy the FAT's information unless one took measures to copy
the information and then re-enter it in a converted form (I shudder to
think of the mapping algorithm).
     Also, remember that DOS maintains TWO copies of the FAT. Both would
have to be converted.

     Anyway, to me it seems that the only way to do what you want is to
record the present FAT and then re-write it byte-by-byte, remapping as
you go. At least, that's what I get from the Tech Ref. Howintheheck you
did it previously I really can't imagine.

DISCLAIMER: The information and opinions presented above constitute an
            honest effort to impart information the author knows or
            reasonably knows to be true. All other interpretations of
            this text are erroneous.

Unky Dave
unkydave@shumv1.ncsu.edu

 P.S. You could, of course, just backup the drive, reformat it and
      using FDISK only give 10 MB of it to DOS.

jca@pnet01.cts.com (John C. Archambeau) (11/02/89)

unkydave@shumv1.uucp (David Bank) writes:
>     Hmmm...this certainly is an interesting question. Grabbing my IBM
>PC-DOS TEch Reference, I think I'll look in Chapter 5 and try to answer
>it.
>
>     Paraphrasing, the Tech Ref has several things to say:
>
>       1) The FAT consists of a 12-bit entry (1.5 bytes) for each
>          cluster ... or a 16-bit entry (2 bytes) when a fixed disk
>          is larger than 10 MB (# sectors > approx. 20K)
>
>       2) The FAT can be 12-bit or 16-bit format. DOS determines
>          which one a given disk is by looking at the total # of
>          allocation units on the disk. For  all diskettes and
>          fixed disk partitions of < 20740 sectors, the FAT uses
>          12-bit entries; 16-bit entries are used in all other
>          cases.
>
>     I am not able to find a "descriptor byte" or similar construct that
>tells DOS in one fell swoop what size FAT it is dealing with. Perhaps I
>am overlooking something, but I don't think so.
>
>     It does not seem to me to be immediately feasible to "convert" a
>FAT from 12-bit to 16-bit. I would seem to me that such an operation
>would destroy the FAT's information unless one took measures to copy
>the information and then re-enter it in a converted form (I shudder to
>think of the mapping algorithm).
>     Also, remember that DOS maintains TWO copies of the FAT. Both would
>have to be converted.
>
>     Anyway, to me it seems that the only way to do what you want is to
>record the present FAT and then re-write it byte-by-byte, remapping as
>you go. At least, that's what I get from the Tech Ref. Howintheheck you
>did it previously I really can't imagine.
>
> P.S. You could, of course, just backup the drive, reformat it and
>      using FDISK only give 10 MB of it to DOS.


I know that I'd have to backup my data, reformat the drive, et. al.  In fact,
the process to convert a 10 Mb PC-DOS 3.30 partition is the following (with a
Seagate ST225 (or other 4 headed drive it seems):

1. Backup the drive/partition.
2. Cold boot DOS.
3. FDISK
4. Format partition using NO parameters.
5. Make the appropriate changes with Norton Utilities (or equivalent) to
   the partitions boot sector.
6. Exit Norton (or equivalent) and cold boot.  This is critical since the boot
   sector (and the BIOS parameter block) is read only once by PC-DOS
7. Reformat the drive using whatever parameters desired.  Reformating does
   NOT destory the work done in step 5.
8. Restore files prior to the 12-bit to 16-bit FAT conversion.

The idea is to have 2K clusters instead of the wasteful 4K clusters.  I know
this will work with MS/PC-DOS 3.1, 3.2, and 3.3.  I just don't know what
numbers to plug in step 5 to make it work with an ST151.  The BIOS Parameter
Block is hard drive parameter dependant (which is not surprising).  The
modifications for an ST225 do not work on an ST151.
 
Since I have a stockpile of DS/DD 3.5" disks and DS/HD 5.25" disks, backing up
is no big deal for me since I never will have any intention of giving more
than 10 Mb to MS/PC-DOS regardless of how big of a hard drive I get.
 
This process is very effective on Seagate ST225's and I know it will work
with ANY drive given the proper numbers are placed in the BIOS parameter block
of the DOS partition's boot sector.  The FAT is constructed at format time, so
that takes care of that mess.
 
In the ST225 boot sector editing, only two bytes need to be changed and that's
it.  Simple process, just a matter of knowing what bytes to change to what
values and DOS is fooled and creates a DOS file system with 2K clusters and a
16-bit FAT.

 /*--------------------------------------------------------------------------*
  * Flames: /dev/null (on my Minix partition)
  *--------------------------------------------------------------------------*
  * ARPA  : crash!pnet01!jca@nosc.mil
  * INET  : jca@pnet01.cts.com
  * UUCP  : {nosc ucsd hplabs!hd-sdd}!crash!pnet01!jca
  *--------------------------------------------------------------------------*
  * Note  : My opinions are that...mine.  My boss doesn't pay me enough to
  *         speak in the best interests of the company (yet).
  *--------------------------------------------------------------------------*/