From 0ba991750314310a5e53b0d8135aef5b1352b261 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 20 Nov 2019 22:17:48 +0100 Subject: Began two-stage hdd bootloader and os installer --- src/kernel/fs/atapi_pio.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/kernel/fs/atapi_pio.h (limited to 'src/kernel/fs/atapi_pio.h') diff --git a/src/kernel/fs/atapi_pio.h b/src/kernel/fs/atapi_pio.h new file mode 100644 index 0000000..5e89e85 --- /dev/null +++ b/src/kernel/fs/atapi_pio.h @@ -0,0 +1,26 @@ +#ifndef MELVIX_ATAPI_PIO_H +#define MELVIX_ATAPI_PIO_H + +#include + +#define ATAPI_PIO_DRIVE 0xE0 +#define LBA_READ_INT 0x13 +#define ATAPI_PIO_DAPACK 0x7E00 +#define ATAPI_PIO_BUFFER 0x8000 +#define ATAPI_SECTOR_SIZE 0x800 + +struct dapack { + uint8_t size; + uint8_t null; + uint16_t blkcount; + uint16_t boffset; + uint16_t bsegment; + uint32_t start; + uint32_t upper_lba_bits; +} __attribute__((packed)); + +void ATAPI_read(uint16_t nblocks, uint32_t lba); + +void ATAPI_granular_read(uint32_t nblocks, uint32_t lba, uint8_t *output); + +#endif -- cgit v1.2.3