ahci: add block operations

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-13 00:02:22 -04:00
commit fc0720b118
5 changed files with 60 additions and 9 deletions

View file

@ -2,6 +2,7 @@
#ifndef _BLOCK_H_
#define _BLOCK_H_
#include <fs/vfs.h>
#include <kernel/device.h>
struct block_device;
@ -11,11 +12,19 @@ struct block_ops {
};
struct block_device {
char *name;
dev_t dev;
size_t size;
size_t block_size;
char name[256];
dev_t dev;
size_t size;
size_t block_size;
struct block_ops ops;
void *priv;
size_t lba_start;
};
struct disk {
struct block_device *dev;
char model[FILE_NAME_MAX_LEN + 1];
list_t part_table;
};
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n_blocks);