home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
167
/
BADCLU.ZIP
/
HDIO.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-25
|
2KB
|
110 lines
/**********************************************************************
*
* NAME: hdio.h
*
* DESCRIPTION: hard disk i/o (int 13H)
*
* M O D I F I C A T I O N H I S T O R Y
*
* when who what
* -------------------------------------------------------------------
* 04/24/90 J. Alan Eldridge created from badclu.c
*
*********************************************************************/
#ifndef __HDIO_H__
#define __HDIO_H__
#define BOOT_CODE_SIZE (512-0x01E)
#define PRI_DOS_12 1
#define PRI_DOS_16 4
#define EXT_DOS 5
#define BOOT_IND 0x80
#define CLUST_BAD 0xFFF7
#define IS_CLUST_FREE(x) ((x)==0x0000)
#define IS_CLUST_RESV(x) ((x)<=0xFFF6&&(x)>=0xFFF0)
#define IS_CLUST_BAD(x) ((x)==CLUST_BAD)
#define IS_CLUST_LAST(x) ((x)<=0xFFFF&&(x)>=0xFFF8)
#define IS_CLUST_INUSE(x) \
(!IS_CLUST_FREE(x)&&!IS_CLUST_RESV(x)&&!IS_CLUST_BAD(x))
#define SEC_READ 2
#define SEC_WRITE 3
#define SEC_VERIFY 4
typedef unsigned short UINT;
typedef unsigned char UCHAR;
typedef unsigned long ULONG;
typedef struct {
UCHAR drv;
UCHAR hds;
UINT cyl;
UINT sec;
} DISK_INFO;
typedef struct {
UCHAR hd;
UINT cyl;
UINT sec;
} PART_POS;
typedef struct {
UCHAR boot;
PART_POS beg;
UCHAR type;
PART_POS end;
ULONG rel_sec;
ULONG num_sec;
} PARTITION;
typedef struct {
PARTITION part;
UINT dsec;
UINT dir0;
UINT dat0;
UINT nclu;
} DOS_PARTITION;
typedef struct {
UCHAR hd;
UCHAR cyl;
UCHAR sec;
} HCS_POS;
typedef struct {
UCHAR boot;
HCS_POS beg;
UCHAR type;
HCS_POS end;
ULONG rel_sec;
ULONG num_sec;
} PART_ENT;
typedef struct {
UCHAR reserved[0x1be];
PART_ENT part_ents[4];
UCHAR signature[2];
} PART_TBL;
typedef struct {
UCHAR jmp_instr[3];
UCHAR oem[8];
UINT bytes_per_sec;
UCHAR sec_per_clust;
UINT rsv_sec_cnt;
UCHAR num_fats;
UINT num_root_ent;
UINT num_sec;
UCHAR media_desc;
UINT sec_per_fat;
UINT sec_per_trk;
UINT num_heads;
UINT num_hidden_sec;
UCHAR boot_code[BOOT_CODE_SIZE];
} BOOT_SEC;
#endif /* __HDIO_H__ */