Nios® V Processor Software Developer Handbook

ID 743810
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

7.7.2.1. Create a Device Instance

Creating and registering a file system is very similar to creating and registering a character-mode device. To make a file system available, create an instance of the alt_dev structure.

For more information, refer to the Character-Mode Device Drivers chapter.

The only distinction is that the name field of the device represents the mount point for the file subsystem. Of course, you must also provide any necessary functions to access the file subsystem, such as read() and write(), similar to the case of the character-mode device.

Note: If you do not provide an implementation of fstat(), the default behavior returns the value for a character-mode device, which is incorrect behavior for a file subsystem.