summaryrefslogtreecommitdiff
path: root/Kernel/Disk.h
blob: 28126b292219bb206cadeb911952abdd7e348a73 (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
31
32
33
34
35
#pragma once

#include "types.h"
#include "DataBuffer.h"

#define IDE0_DATA        0x1F0
#define IDE0_STATUS      0x1F7
#define IDE0_COMMAND     0x1F7
#define BUSY             0x80
#define DRDY             0x40
#define DRQ              0x08
#define IDENTIFY_DRIVE   0xEC
#define READ_SECTORS     0x21

#define IDE0_DISK0       0
#define IDE0_DISK1       1
#define IDE1_DISK0       2
#define IDE1_DISK1       3

typedef struct
{
    WORD cylinders;
    WORD heads;
    WORD sectors_per_track;
} ide_drive_t;

extern void ide_init();
extern ide_drive_t drive[4];

namespace Disk {

void initialize();
bool readSectors(DWORD sectorIndex, WORD count, BYTE* buffer);

}