ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
mnt_ram.h File Reference

The built-in RAM filesystem backend (PROTOCORE_ENABLE_MNT). More...

Go to the source code of this file.

Classes

struct  MntRamNs
 Dispatch table. Addressed by offset, so the layout is asserted below. More...
 

Functions

 PROTOCORE_NS_LAYOUT (MntRamNs, backend, format)
 
const protocore_mnt_backend * protocore_mnt_ram_backend (uint8_t *work)
 Publish the vtable, for the caller to mount.
 
void protocore_mnt_ram_format (uint8_t *work)
 Empty the pool and close every handle.
 

Variables

PROTOCORE_NS MntRamNs MntRam PROTOCORE_UNUSED
 Module namespace.
 

Detailed Description

The built-in RAM filesystem backend (PROTOCORE_ENABLE_MNT).

A fixed pool of named in-BSS files and a fixed handle table: bounded, zero-heap, and host-identical, which is what lets the file-transfer servers run under a native test. It implements the protocore_mnt_backend contract that server/storage/mnt registers, and it is one of several things that can - a board layer wraps a real fs::FS the same way.

Directories are a flag on a name-table entry rather than a tree: the table already holds whole paths, so "what is in this directory" is a prefix scan of names that are already there. A tree would add nodes, links, and a second lifetime to maintain in order to answer a question the flat table already answers.

The module publishes its vtable rather than mounting itself, so the mount stays one decision in one place:

MntRam.backend(work); MntV.args.backend = MntRamV.backend; Mnt.mount(work);

Pool dimensions are PROTOCORE_MNT_RAM_FILES, PROTOCORE_MNT_RAM_FILE_SIZE, PROTOCORE_MNT_MAX_OPEN and PROTOCORE_MNT_NAME_MAX in protocore_config.h.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file mnt_ram.h.

Function Documentation

◆ PROTOCORE_NS_LAYOUT()

PROTOCORE_NS_LAYOUT ( MntRamNs  ,
backend  ,
format   
)

◆ protocore_mnt_ram_backend()

const protocore_mnt_backend * protocore_mnt_ram_backend ( uint8_t *  work)

Publish the vtable, for the caller to mount.

Parameters
workPROTOCORE_MNT_RAM_BORROW bytes the caller took. Not held past the call.
Returns
The const protocore_mnt_backend *.

◆ protocore_mnt_ram_format()

void protocore_mnt_ram_format ( uint8_t *  work)

Empty the pool and close every handle.

Parameters
workPROTOCORE_MNT_RAM_BORROW bytes the caller took. Not held past the call.

Variable Documentation

◆ PROTOCORE_UNUSED

PROTOCORE_NS MntRamNs MntRam PROTOCORE_UNUSED
Initial value:
void protocore_mnt_ram_format(uint8_t *work)
Empty the pool and close every handle.
const protocore_mnt_backend * protocore_mnt_ram_backend(uint8_t *work)
Publish the vtable, for the caller to mount.

Module namespace.

Definition at line 65 of file mnt_ram.h.