Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

12.1. Using the Read-Only Zip File System in a Project

The read-only zip file system is supported by both Nios® II software development flows. You need not edit any source code to include and configure the file system. To use the zip file system, you use the Nios II development tools to include it as a software package for the board support package (BSP) project.

You must specify the following four parameters to configure the file system:

  • The name of the flash device where you wish to program the file system.
  • The offset in the address space of this flash device.
  • The name of the mount point for this file subsystem in the HAL file system. For example, if you name the mount point /mnt/zipfs, the following code opens a file in the zip file:

    fopen("/mnt/zipfs/hello", "r");

    This code, called from within a HAL-based program, opens the file hello for reading.

  • The name of the zip file you wish to use.

The next time you build your project after you make these settings, the Nios II development tools include and link the file subsystem in the project. After you rebuild the project, the system.h file reflects the presence of this software package in the system.