title: How to read blocks from a floppy with sectors?
body: <p>I need to read a floppy from a pre OS state and I have a function to read, but it cannot seem to read past the 4th sector...</p>
  
  <pre><code>void get_block(blk, buf) int blk; char buf[]
  {
     int cyl, head, sector;
  
     cyl = ((blk*2) / 18) / 2;
     head = ((blk*2) / 18) % 2;
     sector = (blk*2) % 18;
  
     // Read first sector &lt;&lt;Dies here if blk &gt; 2&gt;&gt;
     diskr(cyl, head, sector, buf);
  
     // Increment
     if ((sector = (++sector % 18)) == 0)
        if ((head = (++head % 2)) == 0)
           cyl++;
  
     // Read second sector &lt;&lt;Dies here if blk == 2&gt;&gt;
     diskr(cyl, head, sector, buf+512);
  }
  </code></pre>
  
  <p>Any idea why? Am I converting from blocks incorrectly?</p>