From faaa3b1473af2ba9ea216486f68191aac251da95 Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 14 Oct 2024 23:09:05 +0200 Subject: [PATCH] Mon 14 Oct 23:06:38 CEST 2024 --- kernel/ata.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 kernel/ata.h diff --git a/kernel/ata.h b/kernel/ata.h new file mode 100644 index 0000000..2568701 --- /dev/null +++ b/kernel/ata.h @@ -0,0 +1,32 @@ +/* +Copyright (C) 2015-2019 The University of Notre Dame +This software is distributed under the GNU General Public License. +See the file LICENSE for details. +*/ + +#ifndef ATA_H +#define ATA_H + +#define ATA_BLOCKSIZE 512 +#define ATAPI_BLOCKSIZE 2048 + +#include "device.h" + +struct ata_count { + int blocks_written[4]; + int blocks_read[4]; +}; + +void ata_init(); + +struct ata_count ata_stats(); +void ata_reset(int unit); + +int ata_probe(int unit, int *nblocks, int *blocksize, char *name); +int ata_read(int unit, void *buffer, int nblocks, int offset); +int ata_write(int unit, const void *buffer, int nblocks, int offset); + +int atapi_probe(int unit, int *nblocks, int *blocksize, char *name); +int atapi_read(int unit, void *buffer, int nblocks, int offset); + +#endif