home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / e2fltsrc.zip / e2data.h < prev    next >
C/C++ Source or Header  |  1995-07-25  |  6KB  |  129 lines

  1. /************************************************************************/
  2. /*  Linux partition filter (C) Deon van der Westhuysen.                 */
  3. /*                                                                      */
  4. /*  Dedicated to Jesus Christ, my Lord and Saviour.                     */
  5. /*                                                                      */
  6. /*  Permission is granted to freely use and modify this code for non-   */
  7. /*  profit use on the condition that this notice is not removed. All    */
  8. /*  other rights are reserved. No warranty, etc.                        */
  9. /*                                                                      */
  10. /*  This code is still under development; expect some rough edges.      */
  11. /*                                                                      */
  12. /************************************************************************/
  13.  
  14. #ifndef _E2DATA_H_
  15. #define _E2DATA_H_
  16.  
  17. #include "os2head.h"
  18.  
  19. #define FILTER_ADD_NAME        "LinuxPartitions"    /* Max 15 chars. */
  20. #define MAX_LINUX_PARTITIONS    16    /* Max number of virtual partitions */
  21.  
  22. #define    PARTITION_LINUX        0x83    /* Type of partition to convert */
  23. #define PARTITION_DOSSMALL    0x01    /* Dos partition <16MB */
  24. #define PARTITION_DOSMED    0x04    /* Dos partition >16MB <32MB */
  25. #define PARTITION_DOSLARGE    0x06    /* Dos partition >32MB */
  26. #define PARTITION_IFS        0x07    /* Type of virtual partitions */
  27. #define PARTITION_EXTENDED    0x05    /* Type for extended partition */
  28. #define PARTITION_HIDDEN    0x10    /* Hidden primary partition */
  29.  
  30. #define LINUX_VIRTUAL_SECS    1    /* Override boot sector */
  31.  
  32. #define MAX_DEVTABLE_SIZE    1024    /* Maximum size of device table */
  33. #define SECTOR_SIZE        512    /* Number of bytes in a sector */
  34.  
  35. #define    F_SERVER_ACTIVE        1    /* Flag: IORB queue being served */
  36. #define F_REQUEST_BUSY        2    /* Flag: Wait for request to finish */
  37.                     /* (Unit record is being used) */
  38. typedef struct
  39. {
  40.  PIORB    pHead;                /* Head of queue of IORBs */
  41.  PIORB    pTail;                 /* Tail of queue of IORBs */
  42.  int    Flags;                /* Flags for this queue */
  43. } TIORBQueue;                /* Structure to queue IORBs */
  44. typedef TIORBQueue *NPIORBQueue;
  45.  
  46. #define    F_ALLOCATED        1    /* Flag: unit is allocated */
  47. #define F_ALLOW_WRITE        2    /* Flag: unit is writeable */
  48.  
  49. typedef struct
  50. {
  51.  int        Flags;            /* Flags for unit (Alloc, Write) */
  52.  TIORBQueue    IORBQueue;        /* Queue to store waiting IORBs */
  53. } TRecHeader;                /* Header common to all unit records */
  54. typedef TRecHeader    *NPRecHeader;    /* Pointer type for record */
  55.  
  56.  
  57. /* The 'base unit' is the source of the data used to construct the virtual */
  58. /* units from. One virtual unit is constructed for each virtual partition. */
  59. typedef struct
  60. {
  61.  TRecHeader    Hdr;            /* Header for the unit record */
  62.  USHORT        UnitHandle;        /* Original UnitHandle for unit */
  63.  PADDEntryPoint    pADDEntry;        /* Original ADD entry point */
  64.  ADAPTERINFO    AdapterInfo;        /* Adapter information for unit */
  65.                     /* Also contains modified UnitInfo. */
  66.  USHORT        GeoNumHeads;        /* Number of heads for this unit */
  67.  USHORT        GeoTrackSec;        /* Number of sectors per track */
  68.  /* Fields that is saved to later restore the current IORB... */
  69.  USHORT        SaveReqCtrl;        /* Saved request control */
  70.  USHORT        SaveReserved;        /* Saved DM reserved field */
  71.  PNotifyAddr    SaveNotify;        /* Saved Notification address */
  72. } TBaseUnitRec;                /* Unit record for base units */
  73. typedef TBaseUnitRec    *NPBaseUnitRec;    /* Pointe type for record */
  74.  
  75. typedef struct
  76. {
  77.  TRecHeader    Hdr;            /* Header for the unit record */
  78.  NPBaseUnitRec    pSourceUnitRec;        /* Pointer to base unit record */
  79.                     /* This is also the UnitHandle */
  80.  PUNITINFO    pUnitInfo;        /* Pointer to modified UnitInfo */
  81.  USHORT        UnitInfoLen;        /* Length of the unit information */
  82.  UCHAR        PartSysIndicator;    /* System indicator in part table */
  83.  UCHAR        FSType;            /* What type of FS for this unit */
  84.  ULONG        StartRBA;        /* Start RBA of partiton source */
  85.  ULONG        NumSectors;        /* Number of sectors in partition */
  86.  ULONG        NumVirtualSectors;    /* Number of sectors to virtualize */
  87.  ULONG        NumExtraSectors;    /* Number of sectors we add to part */
  88.  /* Fields that is saved to later restore the current IORB... */
  89.  USHORT        SaveReqCtrl;        /* Saved request control */
  90.  USHORT        SaveReserved;        /* Saved DM reserved field */
  91.  PNotifyAddr    SaveNotify;        /* Saved Notification address */
  92.  USHORT        SavecSGList;        /* Saved cSGList field */
  93.  SCATGATENTRY    SaveSGEntry;        /* Saved copy of modified SG entry */
  94.  PSCATGATENTRY    SavepSGList;        /* Saved pSGList field */
  95.  ULONG        SaveppSGList;        /* Saved ppSGList field */
  96.  ULONG        SaveRBA;        /* Saved RBA field */
  97.  USHORT        SaveBlockCount;        /* Saved BlockCount field */
  98.  /* Fields to save informtion about virtual sectors allready transferred */
  99.  USHORT        SectorsDone;        /* Number virtual sectors transfered */
  100.  ULONG        SGOffset;        /* Offset to add to SG list */
  101.  /* Field to restore the hidden sector field in a FAT bootsector. */
  102.  ULONG        FATHiddenSectors;    /* Original number of hidden sectors */
  103. } TVirtUnitRec;                /* Unit record for virtual units */
  104. typedef TVirtUnitRec    *NPVirtUnitRec;    /* Pointe type for record */
  105.  
  106. #define FI_QUIET    1
  107. #define FI_VERBOSE    2
  108. #define FI_ALLPART    4
  109. #define FI_ALLOWWRITE    8
  110.  
  111. #define FS_UNKNOWN    0        /* FS type not determined */
  112. #define FS_DOSFAT    1        /* FS is FAT */
  113. #define FS_EXT2        2        /* FS is ext2 linux filesystem */
  114.  
  115. /* External references to data in e2data.h. */
  116.  
  117. extern int        InstallFlags;
  118. extern PFN        DevHelp;
  119. extern USHORT        ADDHandle;
  120. extern void far *    pDataSeg;
  121. extern ULONG        ppDataSeg;
  122. extern TBaseUnitRec    BaseUnits[MAX_LINUX_PARTITIONS];
  123. extern int        NumBaseUnits;
  124. extern TVirtUnitRec    VirtUnits[MAX_LINUX_PARTITIONS];
  125. extern int        NumVirtUnits;
  126. extern USHORT        MountTable[MAX_LINUX_PARTITIONS];
  127. extern int        MountCount;
  128. #endif
  129.