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

📄 hy_dos.h

📁 德国Hyperstone公司dsp的CF卡驱动程序
💻 H
字号:
/*
 **************************************************************
 *
 *  hyperstone MS-DOS FAT File System Drivers
 *
 *  General definitions
 *
 *  Christoph Baumhof 2000-03-21
 *  Reinhard K乭ne 2000-03-21
 *  Mihajlo Varga 2000-03-21
 *
 *  Copyright (C) 1997-2000 hyperstone electronics GmbH Konstanz
 *
 *  2000-03-21 initial release
 *
 * $Id$
 *
 * $Log$
 *
 **************************************************************
 *
 * Changes:
 *
 **************************************************************
 */


#ifndef   __HY_DOS_
#define   __HY_DOS_
#include  <sys/stat.h>
#include  <dos.h>

#include  "part.h"
#include "ata.h"
#include  "boot.h"
#include  "fat.h"

#define   DRIVE_NAME       'Z'
/*
     defines for FINDFILE
*/

#define FILEXIST         0
#define DELETEFILE       1
#define DIRENTRYSTRUCT   2
#define GENERDIRENTRY    3

#define WRITE            0
#define READ             1

#define FAT12_ENTRIES_FOR_3SECS 1024
#define FAT16_ENTRIES            256
#define ILLEGAL_FATSECTOR 0xffffffff

/* only small part of real boot sector */
struct msdos_b_sect {
     unsigned short   *FatStart;
     unsigned long    nDir;
     unsigned long    DataStart;
     unsigned long    RootDirStart;
     unsigned long    MaxCluster;
     unsigned short   bytesPerSector;
     char             sectPerCluster;
     unsigned char    nFats;
     unsigned short   resSectors;
     unsigned short   nRootDir;
     unsigned short   nSectors;
     unsigned short   sectPerFat;
     unsigned long    nHidden;
     unsigned long    nSectorHuge;
     unsigned long    volid;
     unsigned char    filesys[8];
     unsigned char    FatSystem;
     unsigned char    extBoot;
};

#if 0
static long _hy_lseek(int, long, int, struct RPC_Command *Command);
static int  _hy_access(const char *path, int access_mode, struct RPC_Command *Command);
static int  _hy_close(int , struct RPC_Command *Command);
static int  _hy_open(char *, struct RPC_Command *Command, int access, ... /* access mode */ );
static int  _hy_read(int handle, void *, unsigned, struct RPC_Command *Command);
static int  _hy_fstat(int handle, struct stat *statbuf, struct RPC_Command *Command);
static int  _hy_stat(const char *path, struct stat *statbuf, struct RPC_Command *Command);
static int  _hy_creat(const char * path, int access, int amode, struct RPC_Command *Command) {
static int  _hy_setmode(int handle, int newmode, struct RPC_Command *Command);
static int  _hy_write(int handle, void *, unsigned, struct RPC_Command *Command);
static int  _hy_isatty(int handle, struct RPC_Command *Command);
static int  _hy_unlink(const char *path, struct RPC_Command *Command);
static int  _hy_rename(const char *newname, const char *oldname, struct RPC_Command *Command);
static int  _hy_system(const char *cmd, struct RPC_Command *Command);
static int  _hy__chmod(const char *path, struct RPC_Command *Command, int func, ... /* int attrib */ );
#endif

extern int readDosBlock(int drive, int partnum, int startCluster, char *buf);
extern int FINDFILE(int drive, int partnum, const char *filename, struct directory *dir, int func);
#if 0
extern int r_w_Cluster(unsigned int drive, unsigned int partnum,
  unsigned int startCluster, void *buf, unsigned int ClusterCnt,
  unsigned int ClusterOffs, int rw);
#else
extern int r_w_Cluster(unsigned int handle, void *buf, unsigned int ClusterCnt,
		       unsigned int ClusterOffs, int rw);
#endif
extern int _hy_dir(int argc, char **argv, int type);
extern int _hy_attrib(int argc, char **argv, int type);
extern unsigned long _getserialnum(int drive, int partnum);
extern unsigned long _alignClusterSize(unsigned long num, int drive, int partnum);
extern int testFAT(struct BOOT_SECT * boot_sect);
extern int InstallLocalFileSystem();
extern void DeInstallLocalFileSystem();
extern int Flush_Fat(int drive, int partnum);
extern int delete_FatEntrys(int drive, int partnum, int startCluster);
#endif

⌨️ 快捷键说明

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