title: FAT12/FAT16 - what determines the sector counts?
body: <p>Currently i am reading the Ramdisk source code. And in a RamDiskFormatDisk function, i get a problem.</p>
  
  <p>A piece of code is as following:</p>
  
  <pre><code>if (fatEntries &gt; 4087) {
      fatType =  16;
      fatSectorCnt = (fatEntries * 2 + 511) / 512;
      fatEntries   = fatEntries + fatSectorCnt;
      fatSectorCnt = (fatEntries * 2 + 511) / 512;
  }
  else {
      fatType =  12;
      fatSectorCnt = (((fatEntries * 3 + 1) / 2) + 511) / 512;
      fatEntries   = fatEntries + fatSectorCnt;
      fatSectorCnt = (((fatEntries * 3 + 1) / 2) + 511) / 512;
  }
  </code></pre>
  
  <p>Can you explain what its meaning to me?</p>