Blame

0b059f Bob Green 2026-09-02 14:20:10
1
# Filesystem Layer
2
3
```mermaid
5f1d4d Bob Green 2026-09-02 14:22:12
4
---
761b33 Bob Green 2026-09-02 14:45:55
5
title: Filesystem Structures
5f1d4d Bob Green 2026-09-02 14:22:12
6
---
7
classDiagram
43b4ad Bob Green 2026-09-02 14:36:55
8
class vmp_t{
e95433 Bob Green 2026-09-02 14:49:11
9
block_device-t *dev_driver;
10
vfs_fs_t *fs_driver;
11
char name[16];
316ebd Bob Green 2026-09-02 14:50:23
12
uint8_t block_buff[BLOCK_DEVICE_BLOCK_SIZE];
13
unsigned int mounted : 1;
14
unsigned int read_only : 1;
15
uint8_t subdev;
81a43d Bob Green 2026-09-02 14:51:10
16
union fs_data;
d4e8bf Bob Green 2026-09-02 14:38:10
17
}
18
class block_device_t {
323337 Bob Green 2026-09-02 15:00:02
19
bool_t active;
20
char name[16];
21
uint8_t num_sub_devices;
22
23
int (*init)(block_device_t *dev);
24
int (*finish)(void);
25
26
int (*read_block)(uint32_t block_num, uint8_t *buff, uint8_t subdev);
27
int (*write_block)(uint32_t block_num, uint8_t *buff, uint8_t subdev);
28
29
void *driver_data;
43b4ad Bob Green 2026-09-02 14:36:55
30
}
97c962 Bob Green 2026-09-02 14:45:21
31
class vfs_fs_t {
88240e Bob Green 2026-09-02 14:58:38
32
uint8_t type;
33
int (*handles_path)(const char *pathname);
34
char *name;
35
block_device_t *dev;
36
vfs_t api;
97c962 Bob Green 2026-09-02 14:45:21
37
}
42c05c Bob Green 2026-09-02 14:56:44
38
class fs_data <<union>> {
39
ext2_fs_t e2fs;
332030 Bob Green 2026-09-02 14:52:01
40
}
43b4ad Bob Green 2026-09-02 14:36:55
41
d0bc6c Bob Green 2026-09-02 14:43:04
42
block_device_t <|-- vmp_t
97c962 Bob Green 2026-09-02 14:45:21
43
vfs_fs_t <|-- vmp_t
b33795 Bob Green 2026-09-02 14:52:44
44
820306 Bob Green 2026-09-02 14:22:39
45
```
0b059f Bob Green 2026-09-02 14:20:10
46
> [!NOTE]
47
> This diagram is evolving as I am in the process of implementing
48
> the code for this. Anything could change, so come back often.