aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs/atapi_pio.h
diff options
context:
space:
mode:
authorMarvin Borner2019-11-20 22:17:48 +0100
committerMarvin Borner2019-11-20 22:28:30 +0100
commit0ba991750314310a5e53b0d8135aef5b1352b261 (patch)
treeacae7106a24b85116cd7119bd239c3d9299f2ba8 /src/kernel/fs/atapi_pio.h
parent6ca5f1bcec7f0716bad5e1cdd38d41be137fe7e5 (diff)
Began two-stage hdd bootloader and os installer
Diffstat (limited to 'src/kernel/fs/atapi_pio.h')
-rw-r--r--src/kernel/fs/atapi_pio.h26
1 files changed, 26 insertions, 0 deletions
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 <stdint.h>
+
+#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