|
|
1.1 ! root 1: /* (-lgl ! 2: * COHERENT Version 4.0 ! 3: * Copyright (c) 1982, 1992 by Mark Williams Company. ! 4: * All rights reserved. May not be copied without permission. ! 5: -lgl) */ ! 6: /* ! 7: * fdisk.h ! 8: * Fixed disk configuration. ! 9: * The first sector (boot block) of each hard disk ! 10: * should contain a fixed disk boot record (HDISK_S). ! 11: */ ! 12: ! 13: #ifndef FDISK_H ! 14: #define FDISK_H ! 15: ! 16: #define NPARTN 4 /* Partitions per drive */ ! 17: #define HDSIG 0xAA55 /* Signature word */ ! 18: #define SDEV 0x80 /* Special minor device */ ! 19: ! 20: /* ! 21: * System indicators. ! 22: * There is disagreement about some of these. ! 23: * Is there an official list? ! 24: */ ! 25: #define SYS_EMPTY 0 /* Empty */ ! 26: #define SYS_DOS_12 1 /* MS-DOS, 12-bit FAT */ ! 27: #define SYS_XENIX 2 /* Xenix */ ! 28: #define SYS_DOS_16 4 /* MS-DOS, 16-bit FAT */ ! 29: #define SYS_DOS_XP 5 /* MS-DOS, extended partition */ ! 30: #define SYS_DOS_LARGE 6 /* MS-DOS, large filesystem */ ! 31: #define SYS_COH 9 /* Coherent */ ! 32: #define SYS_SWAP 10 /* Coherent swap partition */ ! 33: ! 34: /* ! 35: * Be careful when using the FDISK_S or HDISK_S structure: ! 36: * the two high order bits of p_bsec and p_esec on the boot block ! 37: * provide the two high order bits of p_bcyl and p_ecyl, respectively. ! 38: */ ! 39: #define SECMASK 0x3F /* Mask for sector number bits of sector fields. */ ! 40: #define CYLMASK 0xC0 /* Mask for cylinder number bits of sector fields. */ ! 41: #define bcyl(p) ((((p)->p_bsec & CYLMASK) << 2) | ((p)->p_bcyl)) ! 42: #define bhd(p) ((p)->p_bhd) ! 43: #define bsec(p) ((p)->p_bsec & SECMASK) ! 44: #define ecyl(p) ((((p)->p_esec & CYLMASK) << 2) | ((p)->p_ecyl)) ! 45: #define ehd(p) ((p)->p_ehd) ! 46: #define esec(p) ((p)->p_esec & SECMASK) ! 47: ! 48: /* Per partition information. */ ! 49: /*#pragma align 1*/ ! 50: typedef struct fdisk_s { ! 51: unsigned char p_boot; /* Boot indicator */ ! 52: unsigned char p_bhd; /* Beginning head */ ! 53: unsigned char p_bsec; /* Beginning sector */ ! 54: unsigned char p_bcyl; /* Beginning cylinder */ ! 55: unsigned char p_sys; /* System indicator */ ! 56: unsigned char p_ehd; /* Ending head */ ! 57: unsigned char p_esec; /* Ending sector */ ! 58: unsigned char p_ecyl; /* Ending cylinder */ ! 59: unsigned long p_base; /* Base block number */ ! 60: unsigned long p_size; /* Size in blocks */ ! 61: } FDISK_S; ! 62: /* Hard disk master boot block. */ ! 63: typedef struct hdisk_s { ! 64: unsigned char hd_boot[446]; /* Bootstrap */ ! 65: /*#pragma align 2*/ ! 66: struct fdisk_s hd_partn[NPARTN]; /* Partition info*/ ! 67: /*#pragma align*/ ! 68: unsigned short hd_sig; /* Validating signature */ ! 69: } HDISK_S; ! 70: /*#pragma align*/ ! 71: ! 72: #ifdef INKERNEL ! 73: /* ! 74: * fdisk(dev_t sdev, FDISK_S pp[]) ! 75: * Read partition info from first block of a special device. ! 76: * If valid, update partition array and return 1. ! 77: */ ! 78: extern int fdisk(); ! 79: #endif ! 80: ! 81: #endif ! 82: ! 83: /* end of fdisk.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.