X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=Documentation%2Fyaffs_direct.html;fp=Documentation%2Fyaffs_direct.html;h=668305400bbafd3545eebb9c0305ccf1c473fb4e;hb=4ea0578f8af411adf56fdc1eb4af08f4e36c7eec;hp=0000000000000000000000000000000000000000;hpb=657bdac1f20c85e9e0d06ef5fcdd49cec4d7627c;p=yaffs%2F.git diff --git a/Documentation/yaffs_direct.html b/Documentation/yaffs_direct.html new file mode 100644 index 0000000..6683054 --- /dev/null +++ b/Documentation/yaffs_direct.html @@ -0,0 +1,160 @@ + + +
+ +YAFFS code is GPL. The YAFFS Direct Interface(YDI) is really +intended to provide a direct interface to YAFFS in an embedded/RTOS +environment. Using YAFFS in this way might violate GPL. Aleph One are +looking at ways to make YAFFS licensing more flexible to support both +GPL and YDI users. For further info, please contact Aleph One.
+The purpose of the YAFFS Direct Interface is to provide YAFFS to +embedded/RTOS environments where full file system support is not +available. Typically, therefore, YDI is intended for smaller embedded +systems.
+The software is designed in a modular fashion to facilitate +integration and configuration.
+The software comprises the following main sections:
+yaffscfg.c Configuration. Set up various device features etc + and some OS integration (eg. locking function). Allows tuning.
+yaffsfs.c: File system interface functions (and associated + header file for inclusion in application code). +
+yaffs_flashif.c NAND integration functions (to be completed + by the integrator) This currently holds a second ramdisk for test + purposes.
+yaffs_guts.c: The file system algorithms for yaffs.
+nand_ecc.c: The ECC algorithms.
+yaffs_ramdisk.c: RAMdisk support code.
+yaffs_fileem.c: Flash emulation on a host file. This is for + testing purposes only.
+dtest.c: Test harness functions.
+
+
The YAFFS file system is GPL.
+The YAFFS bootloader and header files are LGPL to allow +incorporation of these into proprietary code.
+nand_ecc.c, copyright SJ Hill, is LGPL.
+Multiple partitions are defined by setting up the partition table +in yaffscfg.c.
+The system has no concept of current directory, therefore all +names and paths must be fully specified. eg. "/boot/xxx"
+Names are case sensitive. +
+The divider between path elements is '/'. eg "/ram/dir/file".
+The following permissions are supported in mode: S_IREAD, +S_IWRITE.
+The following opening modes are checked: O_RDONLY, O_WRONLY, +O_RDWR, O_EXCL.
+Times are just flat 32-bit numbers. The meaning of these numbers +is OS dependent and is defined by completing the funbctiuon +yaffsfs_CurrentTime() in yaffscfg.c
+Attributes are stored as a 32-bit unsigned value. Some of these +are reserved. Others are used transparently (and may be used for +additional information by the application). Reserved are:
+S_IREAD, S_IWRITE.
+S_IFMT, the file type bit-field for S_IFREG, S_IFDIR and + S_IFLNK.
+
+
All yaffs routines are thread safe when called through the +specified interface.
+All yaffs routines are controlled by a single locking +mutex/semaphore by defining yaffsfs_Lock() and yaffsfs_Unlock() in +yaffscfg.c. +
+Thus, only one thread is able to execute yaffs functions at a +time. Most yaffs functions execute quickly, so this generally not a +limitation.
+Configuration is done in four places: +
+yaffscfg.c: OS specific functions
+yaffscfg.h: Preferably only change YAFFSFS_N_HANDLES, the + number of files that can be simultaneously opened.
+yportenv.h: Preferably do not change this.
+Compile options. The valid compile options for the YAFFS + direct interface are:
+CONFIG_YAFFS_DIRECT must be enabled to use the direct + interface.
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM define to enable short name + caching. This is suggested in cases unless RAM is very limited.
+The device configuration table is set up in yaffscfg.c and +specifies what devices are in the system. The order is important +since this is the order that is used when searching for +files/directories and provides the "switch" mechanism to +support multiple "mount points"
+The device configuration has the form:
+struct {
+
const char *prefix;
yaffs_Device *dev;
};
eg.
+{
{"/ram",ramDevice},
+
{"/boot",bootDevice},
{"/flash",flashDevice},
{NULL,NULL}
}
Note that multiple yaffs_Devices can share a single physical NAND +device by "partitioning". Thus, for instance, /boot and +/data may be on the same physical device, just with non-overlapping +regions.
+Different properties may be attached to the different yaffs_Device +entries. For example note that the RAM disk is set up with different +NANDECC flags.
+int yaffs_open(const char *path, int oflag, int mode) ;
+Supported flags O_CREAT, O_EXCL, O_TRUNC, O_APPEND, O_RDONLY, +O_RDWR, O_WRONLY.
+int yaffs_read(int fd, void *buf, unsigned int nbyte) ;
+int yaffs_write(int fd, const void *buf, unsigned int nbyte) ;
+int yaffs_close(int fd) ;
+off_t yaffs_lseek(int fd, off_t offset, int whence) ;
+int yaffs_unlink(const char *path) ;
+int yaffs_rename(const char *old, const char *new) ;
+int yaffs_stat(const char *path, struct stat *buf) ;
+int yaffs_lstat(const char *path, struct stat *buf) ;
+int yaffs_fstat(int fd, struct, struct stat *buf) ;
+int yaffs_chmod(const char *path, mode_t mode) ;
+int yaffs_fchmod(int fd, struct, mode_t mode) ;
+int yaffs_mkdir(const char *path, mode_t mode) ;
+int yaffs_rmdir(const char *path) ;
+yaffs_DIR *yaffs_opendir(const char *dirname) ;
+struct yaffs_dirent *yaffs_readdir(yaffs_DIR *dirp) ;
+void yaffs_rewinddir(yaffs_DIR *dirp) ;
+int yaffs_closedir(yaffs_DIR *dirp) ;
+int yaffs_mount(const char *path) ;
+int yaffs_unmount(const char *path) ;
+int yaffs_symlink(const char *oldpath, const char *newpath); +
+int yaffs_readlink(const char *path, char *buf, size_t bufsiz); +
+int yaffs_link(const char *oldpath, const char *newpath); +
+int yaffs_mknod(const char *pathname, mode_t mode, dev_t dev);
+off_t yaffs_freespace(const char *path);
+$Id: yaffs_direct.html,v 1.1 2003-01-21 03:34:12 charles Exp $
+
+