1 / 7

Clib File System

Clib File System. CLIB File System. BSP hook up Initialization—filesystem_init() Supported functions Limitations. BSP hook up. In bsp.h, #define BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY 1 Call filesystem_init() after TCP/IP stack is up and the time is setup. Initialization—filesystem_init().

nyx
Download Presentation

Clib File System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Clib File System

  2. CLIB File System • BSP hook up • Initialization—filesystem_init() • Supported functions • Limitations

  3. BSP hook up • In bsp.h, #define BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY 1 • Call filesystem_init() after TCP/IP stack is up and the time is setup

  4. Initialization—filesystem_init() • In file bsp\platforms\yourboard\startfilesystem.c struct fs_config_t { char volume_type; char volume_name[NAFS_VOLUME_NAME_SIZE]; int user_permissions; unsigned int group_id; unsigned char media_type; NAFS_MEDIA_CB *media_cb; TX_THREAD *media_thread; TX_QUEUE *media_queue; NAFS_BUFFER_POOL *buffer_pool; void *media_stack_addr; void *media_queue_addr; NAFS_IO_INTF *io_intf; NAFS_VOLUME_CB *volume_cb; int volume_size; char *volume; int flash_start_sector; int flash_end_sector; int flash_option; int flash_compacting_threshold; };

  5. Supported functions • mkdir() • rename() • remove() • open() • close() • read() • write() • fopen() • fclose() • fread() • fwrite() • fseek()

  6. Limitations • The file IO functions are implemented as binary and block only • In function mkdir(dirname, mode) implementation, the mode is ignored since creating directory in NETOS6's native filesystem requires group id and group access mode. group id and group access mode is hardcoded in the filesystem configuration and can be changed in \bsp\platforms\your_board\startfilesystem.c

  7. Limitations • In function open(filename, mode), the mode is implemented to be consistent with fopen(filename, fmode) as the following table: r w a r+ w+ a+ File must exist before open * * Old file truncated to zero length * * File can be read * * * * File can be written * * * * * File can be written only at end * *

More Related