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

📄 _doc2exb.h

📁 M-System DOC(Disk on a Chip) Flash芯片的诊断工具, 可以从Flash芯片中获取特定的数据信息, 用于判断芯片当前的状态.
💻 H
字号:
/***********************************************************************************/
/*                        M-Systems Confidential                                   */
/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2003            */
/*                         All Rights Reserved                                     */
/***********************************************************************************/
/*                            NOTICE OF M-SYSTEMS OEM                              */
/*                           SOFTWARE LICENSE AGREEMENT                            */
/*                                                                                 */
/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
/*      E-MAIL = info@m-sys.com                                                    */
/***********************************************************************************/

/*
 * $Log:   V:/PVCSDB/DiskOnChip/archives/general storage/TrueFFS/src/include/_doc2exb.h-arc  $
 * 
 *    Rev 1.0   Apr 09 2003 12:16:00   OriS
 * Initial revision.
 * 
 */

/***********************************************************************************
 *                                                                                 * 
 * Project     : TrueFFS source code                                               *
 *                                                                                 *
 * Name        : doc2exb.h                                                         *
 *                                                                                 *
 * Description : M-Systems EXB firmware files and media definitions and dats       *
 *               data structures                                                   *
 *                                                                                 * 
 ***********************************************************************************/



#ifndef _DOC2EXB_H
#define _DOC2EXB_H

#include "docbdk.h"

#ifdef BDK_ACCESS
extern BDKVol*  flBdkVol;         /* pointer to current binary partition */
#endif

/* Firmware stack constant */
#ifdef VERIFY_WRITE
#define INFTL_NEAR_HEAP_SIZE sizeof(FLBuffer)+(FL_SECTOR_SIZE<<1)+READ_BACK_BUFFER_SIZE
#else
#define INFTL_NEAR_HEAP_SIZE sizeof(FLBuffer)+(FL_SECTOR_SIZE<<1)
#endif /* VERIFY_WRITE */
#define DEFAULT_DOC_STACK 2*1024


/* File specific record specifing data for all firmwares in the file */
typedef struct {
  FLByte   mSysSign[4];       /* identification signature */
  FLByte   osakVer[4];        /* identification signature */
  LEmin fileSize;                       /* Total file size */
  LEmin noOfFirmwares;                  /* Number of firmware supported by this file */
} ExbGlobalHeader;


/* File specific record specifing data for a specific firmwares in the file */
typedef struct {
  LEmin type;                           /* Firmware type (must fit the H/W)  */
  LEmin startOffset;                    /* Firmware start offset in the file */
  LEmin endOffset;                      /* Firmware end offset in the file   */
  LEmin splStartOffset;                 /* SPL start offset in the file      */
  LEmin splEndOffset;                   /* SPL end offset in the file        */
} FirmwareHeader;


/* data structure representing BIOS extention header */
typedef struct{
  FLByte  signature[2]; /* BIOS extention signature (0xAA55) */
  FLByte  lenMod512; /* length in unsigned chars modulo 512 */
} BIOSHeader;


/* data structure representing IPL header */
typedef struct{
  BIOSHeader     biosHdr;
  FLByte         jmpOpcode[3];  /* jmp start_of_code                      */
  FLByte         dummy;         /* dummy byte                             */
  FLByte         msysStr[17];   /* ORG  7h ManStr DB '(C)M-Systems1998',0 */
  FLWord         pciHeader;     /* ORG 18h   ; PCI header                 */
  FLWord         pnpHeader;     /* ORG 1Ah   ; P&P header                 */
  FLByte         dummy0[4];     /* Actual address must be shifted by 4 '0'*/
  LEushort       windowBase;    /* ORG 20h   ; explicit DOC window base   */
  Unaligned      spl_offset;    /* DFORMAT !!!                            */
  Unaligned      spl_size;      /* spl actual size                        */
  FLByte         NoOfCopies;    /* Number of SPL copies                   */
  FLByte         spl_chksum;    /* 55                                     */
} IplHeader;


/* data structure representing SPL header */
typedef struct{
  FLByte         jmpOpcode[2];
  BIOSHeader     biosHdr;
      /* Note: At run-time biosHdr.lenMod512 contains size of entire DOC 2000
      boot area modulo 512 as set by DFORMAT  */
  Unaligned      runtimeID;        /* filled in by DFORMAT  */
  Unaligned      tffsHeapSize;     /* filled in by DFORMAT  */
  FLByte         chksumFix;        /* changed by DFORMAT    */
  FLByte         NoOfCopies;       /* Can be 1/2            */ 
  FLByte         version;
  FLByte         subversion;
  FLSByte        copyright[29];    /* "SPL_DiskOnChip (c) M-Systems", 0 */
  Unaligned      windowBase;       /* filled in by DFORMAT */
  Unaligned4     exbOffset;        
} SplHeader;


/* data structure representing TFFS header */
typedef struct{
  BIOSHeader     biosHdr;
  FLByte         jmpOpcode[3];
  FLSByte        tffsId[4];         /* "TFFS" */
  FLByte         exbFlags;          /* filled in by writeExbDriverImage() */
  Unaligned      heapLen;           /* not used for now */
  Unaligned      windowBase;        /* passed by SPL and saved here */
  FLByte         chksumFix;         /* changed by writeExbDriverImage() */
  Unaligned      runtimeID;         /* passed by SPL and saved here */
  FLByte         firstDiskNumber;   /* filled in............  */
  FLByte         lastDiskNumber;    /* ..........at run-time */
  Unaligned      versionNo;         /* filled in at run-time */
} TffsHeader;


/* data structure representing Socket Services  header */
typedef struct{
  BIOSHeader     biosHdr;
  FLByte         jmpOpcode[3];
  FLSByte        tffsId[4];         /* "TFFS" */
  FLByte         exbFlags;          /* filled in by writeExbDriverImage() */
  FLByte         heapLen;           /* not used for now */
  Unaligned      windowBase;        /* filled in at run-time */
  FLByte         chksumFix;         /* changed by writeExbDriverImage() */
} SSHeader;


/* Work space for writting the exb file */
typedef struct{
  FLWord  exbFlags;            /* For the complete list see doc2hdrs.h     */
  FLWord  iplMod512;           /* Size of the IPL module divided by 512    */
  FLWord  splMod512;           /* Size of the SPL module divided by 512    */
  FLDword splMediaAddr;        /* Start of the SPL module media address    */
  FLDword ssMediaAddr;         /* Start of the SS module media address     */
  FLDword exbRealSize;         /* Actual binary area + bad blocks          */
  FLWord  moduleLength;        /* Length of the modules in divided by 512  */
  FLDword tffsHeapSize;        /* TFFS needed heap size                    */
  FLWord  tffsFarHeapSize;     /* TFFS needed far heap size                */
  FLWord  bufferOffset;        /* Curret Offset inside the internal buffer */
  FLDword exbFileEnd;          /* Offset of the last Byte of the files     */
  FLDword exbFileOffset;       /* Current Offset inside the EXB file       */
  FLDword splStart;            /* First SPL byte offset                    */
  FLDword splEnd;              /* Last SPL byte offset                     */
  FLDword firmwareEnd;         /* End offset of the specific firmware      */
  FLDword firmwareStart;       /* Start offset of the specific firmware    */
  FLBuffer *buffer;            /* Internal 512 byte buffer                 */
} exbStruct;

#endif /* _DOC2EXB_H */

⌨️ 快捷键说明

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