����14-19 linux/include/linux/fdreg.h
1 /*
2 * This file contains some defines for the floppy disk controller.
3 * Various sources. Mostly "IBM Microcomputers: A Programmers
4 * Handbook", Sanches and Canton.
5 */
/*
* ���ļ��к���һЩ���̿�������һЩ���塣��Щ��Ϣ�жദ��Դ�������ȡ��Sanches��Canton
* ������"IBM�ͼ����������Ա�ֲ�"һ�顣
*/
6 #ifndef _FDREG_H // �ö��������ų��������ظ�������ͷ�ļ���
7 #define _FDREG_H
8
// һЩ�������ͺ�����ԭ��˵����
9 extern int ticks_to_floppy_on(unsigned int nr);
10 extern void floppy_on(unsigned int nr);
11 extern void floppy_off(unsigned int nr);
12 extern void floppy_select(unsigned int nr);
13 extern void floppy_deselect(unsigned int nr);
14
// �������й����̿�����һЩ�˿ںͷ��ŵĶ��塣
15 /* Fd controller regs. S&C, about page 340 */
/* ���̿�����(FDC)�Ĵ����˿ڡ�ժ��S&C����Լ340ҳ */
16 #define FD_STATUS 0x3f4 // ��״̬�Ĵ����˿ڡ�
17 #define FD_DATA 0x3f5 // ���ݶ˿ڡ�
18 #define FD_DOR 0x3f2 /* Digital Output Register */
// ��������Ĵ�����Ҳ��Ϊ���ֿ��ƼĴ�������
19 #define FD_DIR 0x3f7 /* Digital Input Register (read) */
// ��������Ĵ�����
20 #define FD_DCR 0x3f7 /* Diskette Control Register (write)*/
// ���ݴ����ʿ��ƼĴ�����
21
22 /* Bits of main status register */
/* ��״̬�Ĵ���������λ�ĺ��� */
23 #define STATUS_BUSYMASK 0x0F /* drive busy mask */
// ������æλ��ÿλ��Ӧһ������������
24 #define STATUS_BUSY 0x10 /* FDC busy */
// ���̿�����æ��
25 #define STATUS_DMA 0x20 /* 0- DMA mode */
// 0 - ΪDMA���ݴ���ģʽ��1 - Ϊ��DMAģʽ��
26 #define STATUS_DIR 0x40 /* 0- cpu->fdc */
// ���䷽��0 - CPU �� fdc��1 - �෴��
27 #define STATUS_READY 0x80 /* Data reg ready */
// ���ݼĴ�������λ��
28
29 /* Bits of FD_ST0 */
/*״̬�ֽ�0��ST0��������λ�ĺ��� */
30 #define ST0_DS 0x03 /* drive select mask */
// ������ѡ��ţ������ж�ʱ�������ţ���
31 #define ST0_HA 0x04 /* Head (Address) */
// ��ͷ�š�
32 #define ST0_NR 0x08 /* Not Ready */
// ����������δ���á�
33 #define ST0_ECE 0x10 /* Equipment chech error */
// �豸����������ŵ�У��������
34 #define ST0_SE 0x20 /* Seek end */
// Ѱ��������У������ִ�н�����
35 #define ST0_INTR 0xC0 /* Interrupt code mask */
// �жϴ���λ���ж�ԭ��00 - ��������������
// 01 - �����쳣������10 - ������Ч��11 - FDD����״̬�ı䡣
36
37 /* Bits of FD_ST1 */
/*״̬�ֽ�1��ST1��������λ�ĺ��� */
38 #define ST1_MAM 0x01 /* Missing Address Mark */
// δ�ҵ���ַ��־(ID AM)��
39 #define ST1_WP 0x02 /* Write Protect */
// �����
40 #define ST1_ND 0x04 /* No Data - unreadable */
// δ�ҵ�ָ����������
41 #define ST1_OR 0x10 /* OverRun */
// ���ݴ��䳬ʱ��DMA���������ϣ���
42 #define ST1_CRC 0x20 /* CRC error in data or addr */
// CRC���������
43 #define ST1_EOC 0x80 /* End Of Cylinder */
// ���ʳ���һ���ŵ��ϵ���������š�
44
45 /* Bits of FD_ST2 */
/*״̬�ֽ�2��ST2��������λ�ĺ��� */
46 #define ST2_MAM 0x01 /* Missing Addess Mark (again) */
// δ�ҵ����ݵ�ַ��־��
47 #define ST2_BC 0x02 /* Bad Cylinder */
// �ŵ�����
48 #define ST2_SNS 0x04 /* Scan Not Satisfied */
// ������ɨ�裩���������㡣
49 #define ST2_SEH 0x08 /* Scan Equal Hit */
// �����������㡣
50 #define ST2_WC 0x10 /* Wrong Cylinder */
// �ŵ������棩�Ų�����
51 #define ST2_CRC 0x20 /* CRC error in data field */
// ���ݳ�CRCУ�����
52 #define ST2_CM 0x40 /* Control Mark = deleted */
// ����������ɾ����־��
53
54 /* Bits of FD_ST3 */
/*״̬�ֽ�3��ST3��������λ�ĺ��� */
55 #define ST3_HA 0x04 /* Head (Address) */
// ��ͷ�š�
56 #define ST3_TZ 0x10 /* Track Zero signal (1=track 0) */
// ��ŵ��źš�
57 #define ST3_WP 0x40 /* Write Protect */
// �����
58
59 /* Values for FD_COMMAND */
/* ���������� */
60 #define FD_RECALIBRATE 0x07 /* move to track 0 */
// ����У��(��ͷ�˵���ŵ�)��
61 #define FD_SEEK 0x0F /* seek track */
// ��ͷѰ����
62 #define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */
// �����ݣ�MT��ŵ�������MFM��ʽ������ɾ�����ݣ���
63 #define FD_WRITE 0xC5 /* write with MT, MFM */
// д���ݣ�MT��MFM����
64 #define FD_SENSEI 0x08 /* Sense Interrupt Status */
// ����ж�״̬��
65 #define FD_SPECIFY 0x03 /* specify HUT etc */
// �趨�������������������ʡ���ͷж��ʱ��ȣ���
66
67 /* DMA commands */
/* DMA ���� */
68 #define DMA_READ 0x46 // DMA���̣�DMA��ʽ�֣���DMA�˿�12��11����
69 #define DMA_WRITE 0x4A // DMAд�̣�DMA��ʽ�֡�
70
71 #endif
72