kv2: initialize memory manager, early pci devices

Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
Michael Shaw 2026-05-12 02:59:37 -04:00
commit a252a3f8e9
58 changed files with 1270 additions and 505 deletions

24
include/drivers/block.h Normal file
View file

@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _BLOCK_H_
#define _BLOCK_H_
#include <kernel/device.h>
struct block_device;
struct block_ops {
ssize_t (*read)(struct block_device *dev, char *buf, size_t offset, size_t n);
ssize_t (*write)(struct block_device *dev, char *buf, size_t offset, size_t n);
};
struct block_device {
char *name;
dev_t dev;
size_t size;
size_t block_size;
struct block_ops ops;
};
ssize_t block_read(struct block_device *dev, char *buf, size_t offset, size_t n);
ssize_t block_write(struct block_device *dev, char *buf, size_t offset, size_t n);
#endif /* _BLOCK_H_ */