summaryrefslogtreecommitdiffstats
path: root/include/floppy.h
blob: 8d526ef4b8789ec635945ec80eb50b7019da8e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#define PORT_FLOPPY_DOR 0x03F2
#define PORT_FLOPPY_TAPE_DRIVE 0x03F3
#define PORT_FLOPPY_SELECT_DATA_RATE 0x03F4
#define PORT_FLOPPY_STATUS 0x03F4
#define PORT_FLOPPY_COMMAND_DATA 0x03F5
#define PORT_FLOPPY_DIR 0x03F7

#define FLOPPY_STATE_IDLE 0
#define FLOPPY_STATE_RECALIBRATE 1
#define FLOPPY_STATE_SEEK 2
#define FLOPPY_STATE_READ 3


struct floppy_request {
	unsigned char command;
	unsigned char drive;
	unsigned char cylinder;
	unsigned char head;
	unsigned char sector;
	unsigned char sector_count;
	void *buffer;
};


static unsigned char floppy_drive_types[6][8] = {"none", "360 KB", "1.2 MB", "720 KB", "1.44 MB", "2.88 MB"};


void init_floppy();
int read_floppy_sectors(unsigned char drive, unsigned char cylinder, unsigned char head, unsigned char sector, unsigned char sector_count);
void floppy_IRQ();