플로피 디스크 드라이버를 구현한다.
More...
|
| enum | { FD_SECTOR_PER_TRACK = 18,
FD_HEAD = 2,
FD_BLKSZ = 512
} |
| | 트랙, 헤드, 블럭크기를 정의한다. More...
|
| |
| enum | base_address { FDC_PRIMARY = 0x3F0,
FDC_SECONDARY = 0x370,
FDC_BASE_MAX = 0xFFFF
} |
| | 플로피 디스크 드라이버 Primary,Secondary 포트 주소 정의 More...
|
| |
| enum | bytes_per_sector { SECTOR_128 = 0,
SECTOR_256 = 1,
SECTOR_512 = 2,
SECTOR_1024 = 3
} |
| | 섹터당 바이트 수를 정의한다 More...
|
| |
| enum | command_set {
CMD_READ_TRACK = 0x02,
CMD_SPECIFY = 0x03,
CMD_SEND_DRIVE_STATUS = 0x04,
CMD_WRITE_DATA = 0x05,
CMD_READ_DATA = 0x06,
CMD_RECALIBRATE = 0x07,
CMD_SENSE_INTERRUPT = 0x08,
CMD_WRITE_DELETED_DATA = 0x09,
CMD_READ_ID = 0x0A,
CMD_READ_DELETED_DATA = 0x0C,
CMD_FORMAT_TRACK = 0x0D,
CMD_DUMPREG = 0x0E,
CMD_SEEK = 0x0F,
CMD_VERSION = 0x10,
CMD_SCAN_EQUAL = 0x11,
CMD_PERPENDICULAR_MODE = 0x12,
CMD_CONFIGURE = 0x13,
CMD_LOCK = 0x14,
CMD_VERIFY = 0x16,
CMD_SCAN_LOW_OR_EQUAL = 0x19,
CMD_SCAN_HIGH_OR_EQUAL = 0x1D,
CMD_RELATIVE_SEEK = 0x8F,
CMD_EXT_SKIP = 0x20,
CMD_EXT_DENSITY = 0x40,
CMD_EXT_MULTITRACK = 0x80
} |
| |
| enum | data_rates { DRATE_1Mbps = 0x03,
DRATE_500Kbps = 0x00,
DRATE_300Kbps = 0x01,
DRATE_250Kbps = 0x02
} |
| |
| enum | dir_of_data { UNDEFINED = 0x00,
READ_REQUIRED = 0x01,
WRITE_REQUIRED = 0x02,
MAX_DIR_OF_DATA = 0xFF
} |
| |
| enum | dma_state { DMA = 0x01,
NONDMA = 0x00
} |
| |
| enum | drive_activation_values { DRIVE0 = 0x1C,
DRIVE1 = 0x2D,
DRIVE2 = 0x4E,
DRIVE3 = 0x8F
} |
| |
| enum | drive_letter {
DRIVE_A = 0x00,
DRIVE_B = 0x01,
DRIVE_C = 0x02,
DRIVE_D = 0x03,
DRIVE_MAX = 0xFF
} |
| |
| enum | fdc_dma_dir_t { FDC_DMA_READ = 1,
FDC_DMA_WRITE = 2
} |
| |
| enum | precompensation_delays {
DELAY_DISABLED = 0x07,
DELAY_41_67ns = 0x01,
DELAY_83_34ns = 0x02,
DELAY_125ns = 0x03,
DELAY_166_67ns = 0x04,
DELAY_208_33ns = 0x05,
DELAY_250ns = 0x06,
DELAY_DEFAULT = 0x0
} |
| |
| enum | symbol { EIS = 0x06,
EFIFO = 0x05,
POLL = 0x04
} |
| |
플로피 디스크 드라이버를 구현한다.
- Author
- Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
- Date
- 2011-8-16
| #define DOR_ENABLE |
( |
|
single, |
|
|
|
drv, |
|
|
|
dma |
|
) |
| |
Value:do { \
dor->drive = (drv); \
dor->b_dma_gate = (dma); \
dor->motor = 0x01 << (drv); \
} while (0)
Definition at line 136 of file fdc.h.
| #define DOR_RESET |
( |
|
single) | |
|
Value:do { \
dor->drive = 0; \
dor->b_dma_gate = 0; \
dor->motor = 0; \
} while (0)
Definition at line 125 of file fdc.h.
Value:
dsr->power_down = 1; \
} while (0)
Definition at line 207 of file fdc.h.
| #define IN_RESULT_PHASE |
( |
|
reg) | |
(MSR(reg)->cmd_busy) |
| #define IN_SEEK_PORTION |
( |
|
reg) | |
(MSR(reg)->drive_busy) |
| #define LBA_TO_CHS |
( |
|
lba, |
|
|
|
h, |
|
|
|
t, |
|
|
|
s |
|
) |
| |
Value:
Converting the Logical Block Address to CHS. CHS: Cylinder, Head, Sector.
Definition at line 343 of file fdc.h.
| #define MSR |
( |
|
reg) | |
((MSR_t*)(reg)) |
| #define REG_CCR |
( |
|
base) | |
((base) + 0x07) |
| #define REG_DIR |
( |
|
base) | |
((base) + 0x07) |
| #define REG_DOR |
( |
|
base) | |
((base) + 0x02) |
| #define REG_DSR |
( |
|
base) | |
((base) + 0x04) |
| #define REG_FIFO |
( |
|
base) | |
((base) + 0x05) |
| #define REG_MSR |
( |
|
base) | |
((base) + 0x04) |
| #define REG_SRA |
( |
|
base) | |
(base) |
Definition at line 39 of file fdc.h.
| #define REG_SRB |
( |
|
base) | |
((base) + 0x01) |
Definition at line 77 of file fdc.h.
| #define REG_TDR |
( |
|
base) | |
((base) + 0x03) |
| #define SELECT_DRATE |
( |
|
reg, |
|
|
|
rate |
|
) |
| |
Value:
switch (dsr->dratesel) { \
break; \
break; \
break; \
break; \
default: \
break; \
} \
} while (0)
Definition at line 184 of file fdc.h.
| #define SET_DRATE |
( |
|
reg, |
|
|
|
drate |
|
) |
| (((CCR_t*)(reg))->drate_sel = (drate)) |
| #define SRA |
( |
|
reg) | |
((SRA_t*)(ret)) |
Definition at line 40 of file fdc.h.
| #define SRB |
( |
|
reg) | |
((SRB_t*)(reg)) |
Definition at line 78 of file fdc.h.
| #define VALIDATE_RESULT |
( |
|
ctx) | |
|
Value:do { \
int ret; \
unsigned char byte; \
ret = read_byte(ctx, &byte); \
if (ret < 0 || byte == 0x80) { \
printf("Failed to read\n"); \
} \
} while (0)
Definition at line 350 of file fdc.h.
Referenced by fdc_lock(), fdc_read_deleted_sector(), fdc_read_id(), fdc_read_sector(), fdc_read_track(), fdc_seek(), fdc_unlock(), fdc_verify(), fdc_version(), fdc_write_deleted_sector(), and fdc_write_sector().
Definition at line 42 of file fdc.h.
Definition at line 79 of file fdc.h.
트랙, 헤드, 블럭크기를 정의한다.
| Enumerator |
|---|
| FD_SECTOR_PER_TRACK |
트랙당 섹터 수
|
| FD_HEAD |
해드 수
|
| FD_BLKSZ |
섹터 크기 (bytes)
|
Definition at line 14 of file fdc.h.
플로피 디스크 드라이버 Primary,Secondary 포트 주소 정의
| Enumerator |
|---|
| FDC_PRIMARY |
Primary controller 의 주소
|
| FDC_SECONDARY |
Secondary controller 의 주소
|
| FDC_BASE_MAX |
|
Definition at line 24 of file fdc.h.
섹터당 바이트 수를 정의한다
| Enumerator |
|---|
| SECTOR_128 |
128 바이트
|
| SECTOR_256 |
256 바이트
|
| SECTOR_512 |
512 바이트
|
| SECTOR_1024 |
1024 바이트
|
Definition at line 31 of file fdc.h.
| Enumerator |
|---|
| CMD_READ_TRACK |
IRQ6 발생
|
| CMD_SPECIFY |
드라이브 파라미터 설정
|
| CMD_SEND_DRIVE_STATUS |
|
| CMD_WRITE_DATA |
디스크에 쓰기
|
| CMD_READ_DATA |
디스크에서 읽기
|
| CMD_RECALIBRATE |
Cylinder 0 으로 이동
|
| CMD_SENSE_INTERRUPT |
IRQ6 응답, 마지막 명령 처리 결과
|
| CMD_WRITE_DELETED_DATA |
|
| CMD_READ_ID |
IRQ6 발생
|
| CMD_READ_DELETED_DATA |
|
| CMD_FORMAT_TRACK |
|
| CMD_DUMPREG |
|
| CMD_SEEK |
SEEK
|
| CMD_VERSION |
초기화시 한 번만 사용
|
| CMD_SCAN_EQUAL |
|
| CMD_PERPENDICULAR_MODE |
초기화시 한 번만 사용
|
| CMD_CONFIGURE |
Controller 파라미터 설정
|
| CMD_LOCK |
Controller 에 설정된 파라미터 reset 방지
|
| CMD_VERIFY |
|
| CMD_SCAN_LOW_OR_EQUAL |
|
| CMD_SCAN_HIGH_OR_EQUAL |
|
| CMD_RELATIVE_SEEK |
|
| CMD_EXT_SKIP |
|
| CMD_EXT_DENSITY |
|
| CMD_EXT_MULTITRACK |
|
Definition at line 298 of file fdc.h.
| Enumerator |
|---|
| DRATE_1Mbps |
|
| DRATE_500Kbps |
|
| DRATE_300Kbps |
|
| DRATE_250Kbps |
|
Definition at line 168 of file fdc.h.
| Enumerator |
|---|
| UNDEFINED |
|
| READ_REQUIRED |
|
| WRITE_REQUIRED |
|
| MAX_DIR_OF_DATA |
|
Definition at line 224 of file fdc.h.
| Enumerator |
|---|
| DRIVE0 |
|
| DRIVE1 |
|
| DRIVE2 |
|
| DRIVE3 |
|
Definition at line 105 of file fdc.h.
| Enumerator |
|---|
| DRIVE_A |
|
| DRIVE_B |
|
| DRIVE_C |
|
| DRIVE_D |
|
| DRIVE_MAX |
|
Definition at line 216 of file fdc.h.
| Enumerator |
|---|
| FDC_DMA_READ |
|
| FDC_DMA_WRITE |
|
Definition at line 293 of file fdc.h.
| Enumerator |
|---|
| DELAY_DISABLED |
|
| DELAY_41_67ns |
|
| DELAY_83_34ns |
|
| DELAY_125ns |
|
| DELAY_166_67ns |
|
| DELAY_208_33ns |
|
| DELAY_250ns |
|
| DELAY_DEFAULT |
|
Definition at line 157 of file fdc.h.