home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1035 / pbb.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  1.4 KB  |  47 lines

  1. /*
  2. **      pbb.h
  3. **              Partition Boot Block
  4. **      This block holds both the unix boot code and the disk geometry
  5. **      for SV/AT 286 version 2.3 and beyond.
  6. **
  7. **      $Header: pbb.h,v 1.2 87/09/16 02:12:51 root Exp $
  8. **
  9. **      The layout of the PBB is:
  10. **
  11. **              +--------------------+
  12. **        0x000 |   Unix Boot Code   |
  13. **              |        ...         |
  14. **              |           ...      |
  15. **              |              ...   |
  16. **        .. -1 | 0x90               |
  17. ** BOOTDRTBLOFF | ROM-type diskinfo  |  16 bytes long  ( see romtable.h )
  18. **        0x1FD | 0x00               |
  19. **        0x1FE | 0xAA55             |
  20. **              +--------------------+
  21. */
  22.  
  23. #ifndef PBB_H
  24. #define PBB_H
  25.  
  26. #include "romtable.h"
  27.  
  28. typedef char pbb_t[512];
  29.  
  30. /* the BOOT record DRiveTaBLeOFFset into the partition boot block */
  31. #define BOOTDRTBLOFF    0x1ee
  32.  
  33. #define ROMTABLE( pbbp )        ((romtable *)((pbbp)+BOOTDRTBLOFF))
  34.  
  35. #define VALID_PBB( pbbp ) (*((int *) (pbbp)+0x1FE) == 0xAA55 && \
  36.                            *((pbbp)+0x1FD) == 0              || \
  37.                            *((pbbp)+(BOOTDRTBLOFF-1)) == 0x90)
  38.  
  39. #define VALIDATE_PBB( pbbp ) {                                      \
  40.     *((int *) &pbbp[0x1FE]) = 0xAA55;   /* ... and magic PBB sig */ \
  41.     pbbp[0x1FD] = 0;                    /* .. more sig info */      \
  42.     pbbp[BOOTDRTBLOFF-1] = 0x90;        /* ... */                   \
  43. }
  44.  
  45.  
  46. #endif /* PBB_H */
  47.