A file system which can mount, read, and enumerate a file system image which has been appended to the compiled .bin code file before being uploaded to the mbed device.
ffsformat.h
00001 /* Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/) 00002 00003 Licensed under the Apache License, Version 2.0 (the "License"); 00004 you may not use this file except in compliance with the License. 00005 You may obtain a copy of the License at 00006 00007 http://www.apache.org/licenses/LICENSE-2.0 00008 00009 Unless required by applicable law or agreed to in writing, software 00010 distributed under the License is distributed on an "AS IS" BASIS, 00011 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00012 See the License for the specific language governing permissions and 00013 limitations under the License. 00014 */ 00015 /* Specifies constants and structures used within the FLASH File System. The 00016 header is used by both the runtime and the tool which builds the image on 00017 the PC. 00018 */ 00019 #ifndef _FFSFORMAT_H_ 00020 #define _FFSFORMAT_H_ 00021 00022 00023 /* The signature to be placed in SFileSystemHeader::FileSystemSignature. 00024 Only the first 8 bytes are used and the NULL terminator discarded. */ 00025 #define FILE_SYSTEM_SIGNATURE "FFileSys" 00026 00027 /* Header stored at the beginning of the file system image. */ 00028 typedef struct _SFileSystemHeader 00029 { 00030 /* Signature should be set to FILE_SYSTEM_SIGNATURE. */ 00031 char FileSystemSignature[8]; 00032 /* Number of entries in this file system image. */ 00033 unsigned int FileCount; 00034 /* The SFileSystemEntry[SFileSystemHeader::FileCount] array will start here. 00035 These entries are to be sorted so that a binary search can be performed 00036 at file open time. */ 00037 } SFileSystemHeader; 00038 00039 /* Information about each file added to the file system image. */ 00040 typedef struct _SFileSystemEntry 00041 { 00042 /* The 2 following offsets are relative to the beginning of the file 00043 image. */ 00044 unsigned int FilenameOffset; 00045 unsigned int FileBinaryOffset; 00046 unsigned int FileBinarySize; 00047 } SFileSystemEntry; 00048 00049 00050 #endif /* _FFSFORMAT_H_ */
Generated on Tue Jul 12 2022 18:57:29 by 1.7.2