4 #define floppy_dmalen 0x4800
5 #define FLOPPY_MAIN 0x03f0
6 #define FLOPPY_SECO 0x0370
7 #define FLOPPY_144_CODE 4
8 #define FLOPPY_144_SECTORS_PER_TRACK 18
9 #define FLOPPY_144_SECTOR_SIZE 512
10 #define FLOPPY_144_CYLINDER_FACE_SIZE (FLOPPY_144_SECTORS_PER_TRACK * FLOPPY_144_SECTOR_SIZE)
11 #define FLOPPY_144_HEADS 2
12 #define FLOPPY_144_CYLINDER_SIZE (FLOPPY_144_CYLINDER_FACE_SIZE * FLOPPY_144_HEADS)
18 FLOPPY_ERROR_NOSUPPORT = 1,
20 FLOPPY_ERROR_MOTOR = 3,
22 FLOPPY_ERROR_READ = 5,
23 FLOPPY_ERROR_CALIBRATE = 6,
24 FLOPPY_ERROR_TRACK = 7,
26 FLOPPY_ERROR_NOREADY = 9,
27 FLOPPY_ERROR_CRC = 10,
28 FLOPPY_ERROR_CONTROLLER = 11,
29 FLOPPY_ERROR_NODATA = 12,
30 FLOPPY_ERROR_NOADDR = 13,
31 FLOPPY_ERROR_DELADDR = 14,
32 FLOPPY_ERROR_CYLINDER = 15,
33 FLOPPY_ERROR_UPD765 = 16,
34 FLOPPY_ERROR_512B = 17,
35 FLOPPY_ERROR_WRITE = 18,
36 FLOPPY_ERROR_CMD_UNK = 19,
37 FLOPPY_ERROR_20INV = 20,
38 FLOPPY_ERROR_SEEK = 21,
39 FLOPPY_ERROR_INVTRACK = 22,
40 FLOPPY_ERROR_RESET = 23,
45 FLOPPY_CMD_READ_TRACK = 2,
46 FLOPPY_CMD_SPECIFY = 3,
47 FLOPPY_CMD_SENSE_DRIVE_STATUS = 4,
48 FLOPPY_CMD_WRITE_DATA = 5,
49 FLOPPY_CMD_READ_DATA = 6,
50 FLOPPY_CMD_RECALIBRATE = 7,
51 FLOPPY_CMD_SENSE_INTERRUPT = 8,
52 FLOPPY_CMD_WRITE_DELETED_DATA = 9,
53 FLOPPY_CMD_READ_ID = 10,
54 FLOPPY_CMD_READ_DELETED_DATA = 12,
55 FLOPPY_CMD_FORMAT_TRACK = 13,
56 FLOPPY_CMD_DUMPREG = 14,
58 FLOPPY_CMD_VERSION = 16,
59 FLOPPY_CMD_SCAN_EQUAL = 17,
60 FLOPPY_CMD_PERPENDICULAR_MODE = 18,
61 FLOPPY_CMD_CONFIGURE = 19,
63 FLOPPY_CMD_VERIFY = 22,
64 FLOPPY_CMD_SCAN_LOW_OR_EQUAL = 25,
65 FLOPPY_CMD_SCAN_HIGH_OR_EQUAL = 29
79 enum floppy_registers {
87 enum floppy_commands {
92 CMD_SENSE_INTERRUPT = 8,
98 FLOPPY_STATUS_REGISTER_A = 0,
99 FLOPPY_STATUS_REGISTER_B = 1,
100 FLOPPY_DIGITAL_OUTPUT_REGISTER = 2,
101 FLOPPY_TAPE_DRIVE_REGISTER = 3,
102 FLOPPY_MAIN_STATUS_REGISTER = 4,
103 FLOPPY_DATARATE_SELECT_REGISTER = 4,
104 FLOPPY_DATA_FIFO = 5,
105 FLOPPY_DIGITAL_INPUT_REGISTER = 7,
106 FLOPPY_CONFIGURATION_CONTROL_REGISTER = 7
108 typedef size_t (*FloppyR_t)(int,
char*,uint32_t,uint32_t);
109 typedef size_t (*FloppyW_t)(int,
const char*,uint32_t,uint32_t);
110 typedef int (*FloppyCache_t)(int,FloppyMode,uint32_t,uint32_t*,uint32_t*);
Основные определения ядра
int Ticks
Тики работы дисковода
int Index
Индекс устройства
char FileSystem[12]
Файловая система
char Name[12]
Название дискеты
FloppyCache_t Cache
Команда для кэша
FloppyR_t Read
Команда для чтения данных
FloppyW_t Write
Команда для записи данных