kernel: block abstraction and partition table parsing

This commit is contained in:
Matheus
2023-07-20 14:27:23 -03:00
parent ac8cdfb2f3
commit f30f41a28c
4 changed files with 217 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef _BLOCK_H
#define _BLOCK_H
#include <stddef.h>
#include <stdint.h>
#define BLOCK_TYPE_DISK 0
#define BLOCK_TYPE_PART 1
typedef struct {
void *private;
int type;
uintmax_t lbaoffset;
size_t blockcapacity;
size_t blocksize;
int (*write)(void *private, void *buffer, uintmax_t lba, size_t count);
int (*read)(void *private, void *buffer, uintmax_t lba, size_t count);
} blockdesc_t;
void block_register(blockdesc_t *desc, char *name);
void block_init();
#endif