tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
ide.h
Go to the documentation of this file.
1#ifndef IDE_H
2#define IDE_H
3//integrated drive electronics driver
4#include "../lib/types.h"
5
6#define IDE_DATA 0x1F0 //bunch of vals
7#define IDE_PRIMARY_CONTROL 0x3F6
8#define IDE_ERROR 0x1F1
9#define IDE_SECTORS 0x1F2
10#define IDE_LBA_LOW 0x1F3
11#define IDE_LBA_MID 0x1F4
12#define IDE_LBA_HIGH 0x1F5
13#define IDE_DEVICE 0x1F6
14#define IDE_COMMAND 0x1F7
15#define IDE_STATUS 0x1F7
16
17#define ideinit __ideinit
18#define irsec __irsec
19#define iwrt __iwrt
20#define idesize __idesize
21
22void __ideinit(void); //ide init
23void __irsec(uint32_t lba, uint8_t *buff); //ide read sector
24void __iwrt(uint32_t lba, uint8_t *buff); //ide write
25int __idesize(uint32_t *secs); //ide size
26
27#endif
void __ideinit(void)
ideinit initializes the ide disk controller
Definition ide.c:21
void __iwrt(uint32_t lba, uint8_t *buff)
iwrt writes a single 512 byte sector to disk
Definition ide.c:99
void __irsec(uint32_t lba, uint8_t *buff)
irsec reads a single 512 byte sector from disk
Definition ide.c:59
int __idesize(uint32_t *secs)
idesize queries the ide drive for its total sector count
Definition ide.c:144
unsigned int uint32_t
Definition types.h:30
unsigned char uint8_t
Definition types.h:28