mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
kernel: block abstraction and partition table parsing
This commit is contained in:
@@ -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
|
||||
@@ -11,6 +11,7 @@
|
||||
#define DEV_MAJOR_CONSOLE 4
|
||||
#define DEV_MAJOR_FB 5
|
||||
#define DEV_MAJOR_KEYBOARD 6
|
||||
#define DEV_MAJOR_BLOCK 7
|
||||
|
||||
typedef struct {
|
||||
int (*open)(int minor, int flags);
|
||||
|
||||
Reference in New Issue
Block a user