home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / SD-81.ARK / SD-81.MSG < prev   
Text File  |  1989-09-27  |  2KB  |  40 lines

  1. 04/04/84 Sigi Kluger El Paso RCPM
  2.  
  3. First off... sorry for the mess-up in SD-80. Sometimes it helps if you
  4. know what you're doing!
  5.  
  6. Anyway, the bug is now fixed and that with an extra bonus... Seems like
  7. the way SD has been working right now, it would get mighty confused with
  8. extremely large files.  To backtrack a bit, filesize is stored in the
  9. directory as follows:
  10.  
  11. ENTRY+12    EX  (extent number 0..31)
  12. ENTRY+14    S2  (extent overflow 0..31)
  13. ENTRY+15    RC  (record count in last extent)
  14.  
  15. This means that the largest extent number is 1FH.  In order to allow
  16. files larger than 512k, the S2 byte is used.  S2 is incremented every
  17. time EX is incremented to 20H.  EX is then zeroed.  The highest number
  18. in S2 is 0F.  EX and S2, therefore, form a 9-bit number.  The least sig-
  19. nificant bits 0..4 being EX, the most significant bits 5..8 being S2.
  20. That 9-bit number is the total number of extents possible.  Multiplied
  21. by 16k, we get 8192k, the maximum file (and disk) size under CP/M 2.2.
  22.  
  23. (If I have bored you so far, please realize that many people out there
  24. don't know this)
  25.  
  26. In SD, the file size was stored as a 2-byte value, one byte being the
  27. total number of extents, the other being the number of sectors in the
  28. last extent.  From the previous explanation it should be easy to see
  29. that you can't fit a 9-bit value into a byte.  SD up to version 8.1
  30. therefore truncated all files over 4MB to 4096k.  In SD-81, the file
  31. size is stored as a normal (as opposed to byte-reversed) 16-bit integer
  32. in sector units (8192k = 65536 sectors).
  33.  
  34. Not feeling a desire to perform a major rewrite, I did not change the
  35. fact that SD loads and sorts ALL directory entries and then scans the
  36. list for the highest numbered extent and displays it.  The main reason
  37. for changing it would be to save space and to possibly speed the program
  38. up insignificantly.  Should anyone ever tackle this, please make SD re-
  39. port correct file sizes for random files with holes.  (One way of doing
  40. it would be to scan the directory and add up the RC