home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 206.img / SCO386N3.TD0 / usr / sys / io / partition.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-26  |  2.0 KB  |  65 lines

  1. /*
  2.  *    %Z% %M% %I% %D% %Q%
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1985, 1986, 1987.
  5.  *    This Module contains Proprietary Information of
  6.  *    The Santa Cruz Operation and should be treated as Confidential.
  7.  *
  8.  */
  9.  
  10. /* The boot block partition table 
  11.  *
  12.  * Note: High two bits of the sector field are the high order two bits
  13.  *       of the the cylinder number
  14.  */
  15.  
  16. #define BOOTBLK        ((daddr_t)0)    /* Block number of boot block */
  17. #define PT_OFFSET    0x1BE        /* Partition table offset in bootblk */
  18. #define PT_ACTIVE    0x80        /* Indicates partition is active */
  19. #define PT_SIGNATURE    0xAA55        /* Boot block signature */
  20.  
  21.  
  22. struct partition {
  23.     unsigned char pt_bootind;    /* Bootable partition indicator */
  24.     unsigned char pt_bhead;        /* Beginning head */
  25.     unsigned char pt_bsector;    /* Beginning sector */
  26.     unsigned char pt_bcyl;        /* Beginning cylinder */
  27.     unsigned char pt_sysind;    /* Operating system indicator */
  28.     unsigned char pt_ehead;        /* Ending head */
  29.     unsigned char pt_esector;    /* Ending sector */
  30.     unsigned char pt_ecyl;        /* Ending cylinder */
  31.     unsigned short pt_lowoff; /* Lo word of partition offset in sectors */
  32.     unsigned short pt_hioff;  /* Hi word of partition offset in sectors */
  33.     unsigned short pt_lowsz;  /* Lo word of partition size in sectors */
  34.     unsigned short pt_hisz;   /* Hi word of partition size in sectors */
  35. };
  36.  
  37. #ifdef M_I386
  38. #pragma pack(2)
  39. #endif
  40.  
  41. /* The actual 4 partitions in the table */
  42.  
  43. struct parttbl {
  44.     struct partition part[4];
  45.     unsigned short pt_signature;
  46. };
  47.  
  48. #ifdef M_I386
  49. #pragma pack()
  50. #endif
  51.  
  52. /* Text size of the new masterboot code up to the disk partition table    */
  53.  
  54. #define PT_CODESZ    (PT_OFFSET - 2*sizeof(char) - 3*sizeof(unsigned short))
  55. #define    PT_TBLSZ    (sizeof(struct parttbl))
  56.  
  57. struct masterboot {            /* New masterboot sector    */
  58.     char        jmpcode[2];    /* Jump to code start        */
  59.     unsigned short     tbladdr0;    /* Drive 0 disk table address    */
  60.     unsigned short     tbladdr1;    /* Drive 1 disk table address    */
  61.     unsigned short     ctrlrtype;    /* Disk controller type        */
  62.     char        code[PT_CODESZ];  /* Masterboot procedures    */
  63.     char        parttbl[PT_TBLSZ]; /* fdisk partition table    */
  64. };
  65.