Specifications

Read-Only Zip File System
12
2015.05.14
NII5V2
Subscribe
Send Feedback
Altera provides a read-only zip file system for use with the hardware abstraction layer (HAL). The read-
only zip file system provides access to a simple file system stored in flash memory. This file system is
suitable for embedded software use. The drivers take advantage of the HAL generic device driver
framework for file subsystems. Therefore, you can access the zip file subsystem using the ANSI C standard
library I/O functions, such as fopen() and fread().
The Altera read-only zip file system is provided as a software package. All source and header files for the
HAL drivers are located in the directory <Nios II EDS install path>/components/altera_ro_zipfs/HAL/.
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.
Preparing the Zip File
The zip file must be uncompressed. The Altera read-only zip file system uses the zip format only for
bundling files together; it does not provide the file decompression features for which zip utilities are
known.
Creating a zip file with no compression is straightforward using the WinZip GUI. Alternately, use the -e0
option to disable compression when using either winzip or pkzip from a command line.
©
2015 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, ENPIRION, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are
trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance
of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information,
product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device
specifications before relying on any published information and before placing orders for products or services.
ISO
9001:2008
Registered
www.altera.com
101 Innovation Drive, San Jose, CA 95134