You copied the Doc URL to your clipboard.

4.4.69 VFS2 component

This section describes the VFS2 component.

VFS2 - about

This component implements the Virtual File System (VFS).

The VFS is a virtual device that provides access to parts of the underlying host filesystem through a target OS-specific driver and a memory-mapped device called the MessageBox. The VFS component is virtual, so you might have to write your own driver. Fast Models contains example drivers. These drivers are for bare metal, written in C++, and for Linux, written in C. You can use much of the driver code for porting to other operating systems.

This component contains:

VFS LISA component
Coordinates device activity.
MessageBox component
Handles bus activity and interrupts.
Defines types shared between target and OS.
Implements the VFS class/function interface.
Provides a host filesystem abstraction layer.
Provides utility classes for packing and unpacking messages.
Defines the VFS operations.
Defines types shared between target and OS.

To use this component in a platform, add the vfs.sgrepo repository file to your project. You must also add the path to the C++ header files in the VFS implementation parts list to your project.

This is a LISA+ component.

Related reference

VFS2 - operations

This section describes the operations.

Access to the host filesystem through the VFS is analogous to access to a shared network drive, and you can expect it to behave in the same way.

These are the VFS operations:

Retrieve metadata for the file, directory, or symbolic link.
Create a new directory.
Remove a file, directory, or symbolic link.
Rename a file, directory, or symbolic link.
Remove an empty directory.

Set metadata for the file, directory, or symbolic link.


The VFS does not implement setattr.

The VFS does not support symbolic links. The model cannot create hard links, but hard links that the host operating system created function correctly.

These are the VFS mount points:


Free the iterator handle returned from openmounts.

Retrieve an iterator handle for the list of available mounts.
Read one entry from the mount iterator ID.

These are the VFS directory iterators:

Free a directory iterator handle retrieved by opendir.
Retrieve an iterator handle for the directory specified.
Read the next entry from the directory iterator.

These are the VFS file operations:

Free a handle opened with openfile.
Force the host OS to flush all file data to persistent storage.
Return the size of a file, in bytes.
Return a handle to the file specified.
Read a block of data from a file.
Set the size of a file in bytes, either by truncating, or extending the file with zeroes.
Write a block of data to a file.


Datestamps are in milliseconds since the VFS epoch of January 01 1970 00:00 UTC and are host datestamps. The host datestamp might be in the future relative to the OS datestamp.

VFS2 - ports

This section describes the ports.

Table 4-173 VFS2 ports

Name Protocol Type Description
pvbus_s PVBus Slave Provides memory-mapped access to the VFS device.
intr Signal Master Optional interrupt line used to indicate availability of incoming VFS data. If the intr port is not used, MessageBox registers can be used to poll for incoming VFS data.
Related reference

VFS2 - parameters

This section describes the parameters.

Table 4-174 VFS2 parameters

Name Type Allowed values Default value Description
mount string - '' Path to host folder to make accessible inside the model.

VFS2 - verification and testing

This component passes tests through use with Linux operating systems.

VFS2 - performance

ARM® expects this component to have little effect on the performance of PV systems. The component depends on the performance of the host filesystem.