home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / AHDI / TTFHDX / BSL.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  1.5 KB  |  47 lines

  1. /*
  2.  * BSL.H
  3.  *    Constants defined for routines associate with the Bad Sector List.
  4.  */
  5.  
  6. /* portions of BSL */ 
  7. #define    VENDOR 0    /* vendor BSL */
  8. #define    USER 1        /* user BSL */
  9. #define    MEDIA 2     /* media (vendor + user) BSL */
  10. #define    UNUSED 3    /* unused part of BSL */
  11.  
  12. /* magic sum (byte-wise) of a valid BSL */
  13. #define    BSLMAGIC 0xa5
  14.  
  15. /* BSL info */
  16. #define    STBSL 1L    /* BSL STarts at physical sector 1 */
  17. #define BPE 3        /* Bytes Per Entry */
  18. #define RENT 2        /* num Reserved ENTries */
  19. #define    EPS (512/BPE)    /* Entries Per Sector */
  20.  
  21. /* kind of BSL to be created */
  22. #define    NEW 0        /* create a totally new BSL */
  23. #define    EXPAND 1    /* expand an existing BSL */
  24.  
  25. /* Maximum number of bad sectors that can be added to BSL at one time */
  26. #define    MAXADD 128
  27.  
  28. /* Maximum number of entries allowed for USER bad sectors in BSL */
  29. #define WARNBADSECTS    128
  30.  
  31. /* error numbers returned by rountines manipulating the BSL and defects */
  32. #define    INVALID  (-3)    /* BSL does not checksum to BSLMAGIC */
  33. #define    NOMEM (-4)    /* not enough memory to read in BSL */
  34. #define NOTADDED (-5)    /* no entry is added to BSL */
  35. #define    USRFULL (-6)    /* user list is full */
  36.  
  37. /* structure that stores the head number, cylinder number and sector
  38.    number of a bad sector. */
  39. #define BSLINFO struct _bslinfo
  40. BSLINFO {
  41.     unsigned int num;        /* count */
  42.     unsigned int head;        /* head number */
  43.     unsigned int cylndr;    /* cylinder number */
  44.     long sectnum;        /* sector number */
  45.     unsigned int freq;        /* frequency of this bad sector */
  46. };
  47.