⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 evms_os2.h

📁 unxi下共享内存的使用
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * *   Copyright (c) International Business Machines  Corp., 2000 * *   This program is free software;  you can redistribute it and/or modify *   it under the terms of the GNU General Public License as published by *   the Free Software Foundation; either version 2 of the License, or *   (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY;  without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See *   the GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with this program;  if not, write to the Free Software *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Module: linux/include/linux/evms_os2.h *//* * Change History: * *//* * Description:  This module defines the disk structures used by the OS/2 *               Logical Volume Manager, including that of the Master *               Boot Record (MBR) and Extended Boot Records (EBR). * * Notes: LVM Drive Letter Assignment Tables (DLA_Tables) appear on the *        last sector of each track containing a valid MBR or EBR.  Since *        partitions must be track aligned, any track containing an MBR or *        EBR will be almost all empty sectors.  We will grab the last *        of these empty sectors for our DLT_Tables. * */#ifndef OS2LVM_INCLUDED__#define OS2LVM_INCLUDED__/* The following define the values used to indicate that a partition table entry is for an EBR, not a partition. */#define EBR_BOOT_INDICATOR     0#define EBR_FORMAT_INDICATOR   5/* The following define is used as the default Format_Indicator for new non-primary partitions. */#define NEW_LOGICAL_DRIVE_FORMAT_INDICATOR   0x6/* The following define is used as the default Format_Indicator for a new non-active primary partitions. */#define NEW_PRIMARY_PARTITION_FORMAT_INDICATOR   0x16/* The following define is used as the default Format_Indicator for a new active primary partition. */#define NEW_ACTIVE_PRIMARY_PARTITION_FORMAT_INDICATOR  0x06/* The following define is used to hold the value of the Boot_Indicator for active partitions. */#define ACTIVE_PARTITION   0x80/* Define the size of a Partition Name.  Partition Names are user defined names given to a partition. */#define PARTITION_NAME_SIZE  20/* Define the size of a volume name.  Volume Names are user defined names given to a volume. */#define VOLUME_NAME_SIZE  20/* Define the size of a disk name.  Disk Names are user defined names given to physical disk drives in the system. */#define DISK_NAME_SIZE    20/* The name of the filesystem in use on a partition.  This name may be up to 12 ( + NULL terminator) characters long. */#define FILESYSTEM_NAME_SIZE 20/* The comment field is reserved but is not currently used.  This is for future expansion and use. */#define COMMENT_SIZE 81/* Define the minimum number of sectors to reserve on the disk for Boot Manager. */#define BOOT_MANAGER_SIZE     2048#define OS2_BYTES_PER_SECTOR  512#define OS2_SECTOR_SHIFT      9/*-------------------------------------------------- * Type definitions --------------------------------------------------*//* The following definitions define the drive letter assignment table used by LVM.   For each partition table on the disk, there will be a drive letter assignment table in the last sector   of the track containing the partition table. *//* NOTE: DLA stands for Drive Letter Assignment. */#define DLA_TABLE_SIGNATURE1  0x424D5202L#define DLA_TABLE_SIGNATURE2  0x44464D50Ltypedef struct _DLA_Entry { /* DE */        u_int32_t      Volume_Serial_Number;                 /* The serial number of the volume that this partition belongs to. */        u_int32_t      Partition_Serial_Number;              /* The serial number of this partition. */        u_int32_t      Partition_Size;                       /* The size of the partition, in sectors. */        u_int32_t      Partition_Start;                      /* The starting sector of the partition. */        unsigned char  On_Boot_Manager_Menu;                 /* Set to TRUE if this volume/partition is on the Boot Manager Menu. */        unsigned char  Installable;                          /* Set to TRUE if this volume is the one to install the operating system on. */        char           Drive_Letter;                         /* The drive letter assigned to the partition. */        unsigned char  Reserved;        char           Volume_Name[VOLUME_NAME_SIZE];        /* The name assigned to the volume by the user. */        char           Partition_Name[PARTITION_NAME_SIZE];  /* The name assigned to the partition. */} DLA_Entry;typedef struct _DLA_Table_Sector { /* DTS */        u_int32_t  DLA_Signature1;             /* The magic signature (part 1) of a Drive Letter Assignment Table. */        u_int32_t  DLA_Signature2;             /* The magic signature (part 2) of a Drive Letter Assignment Table. */        u_int32_t  DLA_CRC;                    /* The 32 bit CRC for this sector.  Calculated assuming that this field and all unused space in the sector is 0. */        u_int32_t  Disk_Serial_Number;         /* The serial number assigned to this disk. */        u_int32_t  Boot_Disk_Serial_Number;    /* The serial number of the disk used to boot the system.  This is for conflict resolution when multiple volumes                                                  want the same drive letter.  Since LVM.EXE will not let this situation happen, the only way to get this situation                                                  is for the disk to have been altered by something other than LVM.EXE, or if a disk drive has been moved from one                                                  machine to another.  If the drive has been moved, then it should have a different Boot_Disk_Serial_Number.  Thus,                                                  we can tell which disk drive is the "foreign" drive and therefore reject its claim for the drive letter in question.                                                  If we find that all of the claimaints have the same Boot_Disk_Serial_Number, then we must assign drive letters on                                                  a first come, first serve basis.*/        u_int32_t  Install_Flags;              /* Used by the Install program. */        u_int32_t  Cylinders;        u_int32_t  Heads_Per_Cylinder;        u_int32_t  Sectors_Per_Track;        char           Disk_Name[DISK_NAME_SIZE];  /* The name assigned to the disk containing this sector. */        unsigned char  Reboot;                     /* For use by Install.  Used to keep track of reboots initiated by install. */        unsigned char  Reserved[3];                /* Alignment. */        DLA_Entry      DLA_Array[4];               /* These are the four entries which correspond to the entries in the partition table. */} DLA_Table_Sector;/* The following definitions define the LVM signature sector which will appear as the last sector in an LVM partition. */#define  OS2LVM_PRIMARY_SIGNATURE   0x4A435332L#define  OS2LVM_SECONDARY_SIGNATURE 0x4252444BL#define  CURRENT_OS2LVM_MAJOR_VERSION_NUMBER   2        /* Define as appropriate. */#define  CURRENT_OS2LVM_MINOR_VERSION_NUMBER   0        /* Define as appropriate. *//* The following definitions limit the number of LVM features that can be applied to a volume, as well as defining a "NULL" feature for use in feature table entries that are not being used. */#define  OS2LVM_MAX_FEATURES_PER_VOLUME  10     /* The maximum number of LVM features that can be applied to a volume. */#define  OS2LVM_NULL_FEATURE              0     /* No feature.  Used in all unused entries of the feature array in the LVM Signature sector. *//* The following structure is used to hold the location of the feature specific data for LVM features. */typedef struct _LVM_Feature_Data { /* LFD */        u_int32_t      Feature_ID;                            /* The ID of the feature. */        u_int32_t      Location_Of_Primary_Feature_Data;      /* The u_int32_t of the starting sector of the private data for this feature. */        u_int32_t      Location_Of_Secondary_Feature_Data;    /* The u_int32_t of the starting sector of the backup copy of the private data for this feature. */        u_int32_t      Feature_Data_Size;                     /* The number of sectors used by this feature for its private data. */        u_int16_t      Feature_Major_Version_Number;          /* The integer portion of the version number of this feature. */        u_int16_t      Feature_Minor_Version_Number;          /* The decimal portion of the version number of this feature. */        unsigned char  Feature_Active;                        /* TRUE if this feature is active on this partition/volume, FALSE otherwise. */        unsigned char  Reserved[3];                           /* Alignment. */} LVM_Feature_Data;/* The following structure defines the LVM Signature Sector.  This is the last sector of every partition which is part of an LVM volume.  It gives vital   information about the version of LVM used to create the LVM volume that it is a part of, as well as which LVM features (BBR, drive linking, etc.) are   active on the volume that this partition is a part of.                                                                                                   */typedef struct _LVM_Signature_Sector { /* LSS */        u_int32_t         LVM_Signature1;                       /* The first part of the magic LVM signature. */        u_int32_t         LVM_Signature2;                       /* The second part of the magic LVM signature. */        u_int32_t         Signature_Sector_CRC;                 /* 32 bit CRC for this sector.  Calculated using 0 for this field. */        u_int32_t         Partition_Serial_Number;              /* The LVM assigned serial number for this partition.  */        u_int32_t         Partition_Start;                      /* u_int32_t of the first sector of this partition. */        u_int32_t         Partition_End;                        /* u_int32_t of the last sector of this partition. */        u_int32_t         Partition_Sector_Count;               /* The number of sectors in this partition. */        u_int32_t         LVM_Reserved_Sector_Count;            /* The number of sectors reserved for use by LVM. */        u_int32_t         Partition_Size_To_Report_To_User;     /* The size of the partition as the user sees it - i.e. (the actual size of the partition - LVM reserved sectors) rounded to a track boundary. */        u_int32_t         Boot_Disk_Serial_Number;              /* The serial number of the boot disk for the system.  If the system contains Boot Manager, then this is the serial number of the disk containing the active copy of Boot Manager. */        u_int32_t         Volume_Serial_Number;                 /* The serial number of the volume that this partition belongs to. */        u_int32_t         Fake_EBR_Location;                    /* The location, on disk, of a Fake EBR, if one has been allocated. */        u_int16_t         LVM_Major_Version_Number;             /* Major version number of the LVM that created this partition. */        u_int16_t         LVM_Minor_Version_Number;             /* Minor version number of the LVM that created this partition. */        char              Partition_Name[PARTITION_NAME_SIZE];  /* User defined partition name. */        char              Volume_Name[VOLUME_NAME_SIZE];        /* The name of the volume that this partition belongs to. */        LVM_Feature_Data  LVM_Feature_Array[OS2LVM_MAX_FEATURES_PER_VOLUME]; /* The feature array.  This indicates which LVM features, if any, are active on this volume                                                                         and what order they should be applied in.                                                  */        char              Drive_Letter;                         /* The drive letter assigned to the volume that this partition is part of. */        unsigned char     Fake_EBR_Allocated;                   /* If TRUE, then a fake EBR has been allocated. */        char              Comment[COMMENT_SIZE];                /* User comment. */        char              Disk_Name[DISK_NAME_SIZE];            /* Added to allow BBR to report the name of a disk when bad sectors are encountered on that disk. */        u_int32_t         Sequence_Number;                      /* This indicates the order that partitions within a volume are used.  This number is 1 based.  A 0 here indicates that the volume was made by LVM Ver. 1. */        u_int32_t         Next_Aggregate_Number;                /* Used during volume creation and expansion when creating unique names for aggregates. */        /* The remainder of the sector is reserved for future use and should be all zero or else the CRC will not come out correctly. */} LVM_Signature_Sector;/* The following definitions define the format of a partition table and the Master Boot Record (MBR). */typedef struct _Partition_Record { /* PR */        unsigned char  Boot_Indicator;    /* 80h = active partition. */        unsigned char  Starting_Head;        unsigned char  Starting_Sector;   /* Bits 0-5 are the sector.  Bits 6 and 7 are the high order bits of the starting cylinder. */        unsigned char  Starting_Cylinder; /* The cylinder number is a 10 bit value.  The high order bits of the 10 bit value come from bits 6 & 7 of the Starting_Sector field. */        unsigned char  Format_Indicator;  /* An indicator of the format/operation system on this partition. */        unsigned char  Ending_Head;        unsigned char  Ending_Sector;        unsigned char  Ending_Cylinder;        u_int32_t      Sector_Offset;     /* The number of sectors on the disk which are prior to the start of this partition. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -