summaryrefslogtreecommitdiffstats
path: root/src/include/linux/hdreg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/linux/hdreg.h')
-rw-r--r--src/include/linux/hdreg.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/include/linux/hdreg.h b/src/include/linux/hdreg.h
new file mode 100644
index 0000000..e6c593f
--- /dev/null
+++ b/src/include/linux/hdreg.h
@@ -0,0 +1,65 @@
1/*
2 * This file contains some defines for the AT-hd-controller.
3 * Various sources. Check out some definitions (see comments with
4 * a ques).
5 */
6#ifndef _HDREG_H
7#define _HDREG_H
8
9/* Hd controller regs. Ref: IBM AT Bios-listing */
10#define HD_DATA 0x1f0 /* _CTL when writing */
11#define HD_ERROR 0x1f1 /* see err-bits */
12#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */
13#define HD_SECTOR 0x1f3 /* starting sector */
14#define HD_LCYL 0x1f4 /* starting cylinder */
15#define HD_HCYL 0x1f5 /* high byte of starting cyl */
16#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */
17#define HD_STATUS 0x1f7 /* see status-bits */
18#define HD_PRECOMP HD_ERROR /* same io address, read=error, write=precomp */
19#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */
20
21#define HD_CMD 0x3f6
22
23/* Bits of HD_STATUS */
24#define ERR_STAT 0x01
25#define INDEX_STAT 0x02
26#define ECC_STAT 0x04 /* Corrected error */
27#define DRQ_STAT 0x08
28#define SEEK_STAT 0x10
29#define WRERR_STAT 0x20
30#define READY_STAT 0x40
31#define BUSY_STAT 0x80
32
33/* Values for HD_COMMAND */
34#define WIN_RESTORE 0x10
35#define WIN_READ 0x20
36#define WIN_WRITE 0x30
37#define WIN_VERIFY 0x40
38#define WIN_FORMAT 0x50
39#define WIN_INIT 0x60
40#define WIN_SEEK 0x70
41#define WIN_DIAGNOSE 0x90
42#define WIN_SPECIFY 0x91
43
44/* Bits for HD_ERROR */
45#define MARK_ERR 0x01 /* Bad address mark ? */
46#define TRK0_ERR 0x02 /* couldn't find track 0 */
47#define ABRT_ERR 0x04 /* ? */
48#define ID_ERR 0x10 /* ? */
49#define ECC_ERR 0x40 /* ? */
50#define BBD_ERR 0x80 /* ? */
51
52struct partition {
53 unsigned char boot_ind; /* 0x80 - active (unused) */
54 unsigned char head; /* ? */
55 unsigned char sector; /* ? */
56 unsigned char cyl; /* ? */
57 unsigned char sys_ind; /* ? */
58 unsigned char end_head; /* ? */
59 unsigned char end_sector; /* ? */
60 unsigned char end_cyl; /* ? */
61 unsigned int start_sect; /* starting sector counting from 0 */
62 unsigned int nr_sects; /* nr of sectors in partition */
63};
64
65#endif