This repository has been archived on 2023-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
homepage/content/projects/noxos/docs/codebase/drivers/fs/ramfs.h.md

1.1 KiB

title summary
ramfs.h specific driver for RAMFS

Warning: This is a filesystem specific driver, by this it should only be accessed by the vfs.

The ramfs (ram-filesystem) is not a filesystem in the common sense. All data that is stored in ramfs is stored in the virtual file systems cache. This means that all data in ramfs is temporary and erased after a reboot.

ramfs_file_delete(node) - function (void)

Frees the files cache space. This won't delete the node in the vfs.

ramfs_file_write(node, size, buffer_in) - function (void)

If this file has some cache space allocated, it will be freed. Then there will be some cache space (size bytes) allocated and size bytes from buffer_in copied into the cache.

This use of the vfs cache isn't a great solution and should be reworked.

ramfs_file_read(node, size, buffer_out) - function (void)

Copies size bytes from the files' cache to buffer_out. This won't copy more bytes than the allocated cache space is big.