hdtool.h
上传用户:tjzyjsm
上传日期:2007-02-22
资源大小:6k
文件大小:2k
源码类别:

磁盘编程

开发平台:

DOS

  1. /*
  2.    HDTOOL.H --- Hard disk tools Ver 1.1
  3.    (C) M.L.Y  2000.8, 2001.6
  4. */
  5. #include <dos.h>
  6. #include <conio.h>
  7. #include <stdio.h>
  8. #include <stdarg.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <time.h>
  12. #ifndef  USG_TYPE
  13. # define USG_TYPE
  14.   typedef unsigned char  USGC;
  15.   typedef unsigned short USGS;
  16.   typedef unsigned int   USGI;
  17.   typedef unsigned long  USGL;
  18. #endif
  19. int  int13_ext_chk(USGC drv_no, int *ext_ver);
  20. int  get_drv_parm(USGC drv_no, USGI *cyl, USGI *head, USGI *sec, USGI *drvnum,
  21.                   USGI *phy_cyl, USGI *phy_head, USGI *phy_sec,
  22.                   int *ext_ver, USGL *LBA_sec_numL, USGL *LBA_sec_numH);
  23. int  rwv_disk_sect(USGC rwv, USGC drv_no, USGI cyl, USGC head, USGC sec,
  24.                    USGC sec_num, USGC *buf, int ext_ver, USGL sabn);
  25. int  format_cyl(USGC drv_no, USGI cyl, USGC head, USGC sec_num, int ext_ver);
  26. int  read_test_disk(USGC drv, USGI cyl_num, USGI head_num, USGI sec_num,
  27.                     int ext_ver, USGL LBA_sec_num);
  28. int  hd_clone(USGC drv1, USGI cyl_num1, USGI head_num1, USGI sec_num1,
  29.               int ext_ver1, USGL LBA_sec_num1,
  30.               USGC drv2, USGI cyl_num2, USGI head_num2, USGI sec_num2,
  31.               int ext_ver2, USGL LBA_sec_num2,
  32.               USGL LBA_begin, USGL LBA_end);
  33. int  wrt_buf2file(char *filename, USGC *buf, USGI bytes);
  34. int  read_file2buf(char *filename, USGC *buf, USGI bytes);
  35. void disp_hex(USGC *buf, int len);
  36. int  sprintf_end(void *buffer, void *fmt, ...);
  37. int  DbgOutStrA(USGC *buf, USGC *str, int str_len, char *ptr_left,
  38.                 int ptr_len);
  39. /* End of file */