Implement an ATA driver, Add vfsmount/vfsunmount syscalls

This commit is contained in:
2025-10-14 00:39:59 +02:00
parent cb9e15330e
commit 25cb309105
19 changed files with 455 additions and 58 deletions

View File

@ -5,6 +5,7 @@
#include <stddef.h>
#include "spinlock/spinlock.h"
#include "ramsd.h"
#include "atasd.h"
#include "compiler/attr.h"
#include "dev/dev.h"
@ -12,25 +13,28 @@
enum {
STOREDEV_RAMSD,
STOREDEV_ATASD,
};
UNUSED static const char *storedev_strings[] = {
"RAMSD",
"RAMSD", "ATASD"
};
typedef struct StoreDev {
uint32_t _magic;
struct StoreDev *next;
int32_t sdtype;
size_t sectorsize;
int32_t (*init)(struct StoreDev *sd, void *extra);
int32_t (*read)(struct StoreDev *sd, uint8_t *const buffer, size_t n, size_t off);
int32_t (*write)(struct StoreDev *sd, const uint8_t *const buffer, size_t n, size_t off);
int32_t (*read)(struct StoreDev *sd, uint8_t *const buffer, ptrdiff_t sector, ptrdiff_t off, size_t size);
int32_t (*write)(struct StoreDev *sd, const uint8_t *const buffer, ptrdiff_t sector, ptrdiff_t off, size_t size);
int32_t (*cleanup)(struct StoreDev *sd);
size_t (*capacity)(struct StoreDev *sd);
union {
RamSd ramsd;
AtaSd atasd;
} sd;
SpinLock spinlock;
} StoreDev;