fat_io_lib port WIP
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m12s

This commit is contained in:
2026-02-26 23:33:03 +01:00
parent 9758d79303
commit baa13fb695
15 changed files with 3607 additions and 18 deletions

View File

@@ -91,16 +91,18 @@ int ramdrv_get_sector_size (struct device* device, struct proc* proc, struct res
int ramdrv_read (struct device* device, struct proc* proc, struct reschedule_ctx* rctx, void* a1,
void* a2, void* a3, void* a4) {
if (a1 == NULL || a2 == NULL || a3 == NULL || a4 == NULL)
(void)proc, (void)rctx, (void)a4;
if (a1 == NULL || a2 == NULL || a3 == NULL)
return -ST_BAD_ADDRESS_SPACE;
size_t sector = *(size_t*)a1;
size_t off = *(size_t*)a2;
size_t size = *(size_t*)a3;
uint8_t* buffer = a4;
size_t sector_count = *(size_t*)a2;
uint8_t* buffer = a3;
struct ramdrv* ramdrv = device->udata;
size_t pos = sector * ramdrv->sector_size + off;
size_t pos = sector * ramdrv->sector_size;
size_t size = sector_count * ramdrv->sector_size;
memcpy (buffer, (void*)(((uintptr_t)ramdrv->buffer) + pos), size);