PHAT File System
[File System API.]

Collaboration diagram for PHAT File System:


Detailed Description

FAT12/16/32 compatible file system.

Note:
This is alpha code and may contain severe bugs.


Modules

 Volume Support
 Dealing with volumes.
 Directory Support
 Routines for reading and writing directories.
 PHAT12 Support
 PHAT12 specific routines.
 PHAT16 Support
 PHAT16 specific routines.
 PHAT32 Support
 PHAT32 specific routines.
 PHAT Block I/O
 Reading and writing data blocks.
 PHAT Utilities
 General utility routines used by the PHAT file system.
 PHAT Debugging Support
 Listing various PHAT structures.

Data Structures

struct  _PHATFILE
 PHAT file descriptor structure. More...

File attributes.

#define PHAT_FATTR_RDONLY
#define PHAT_FATTR_HIDDEN
#define PHAT_FATTR_SYSTEM
#define PHAT_FATTR_VOLID
#define PHAT_FATTR_DIR
#define PHAT_FATTR_ARCHIV
#define PHAT_FATTR_FILEMASK

Defines

#define PHAT_MAX_PATHLEN
 Maximum length of a full path name.
#define PHAT_MAX_NAMELEN
 Maximum length of a base file name.
#define PHATEOC
 Marks end of cluster chain.

Typedefs

typedef _PHATFILE PHATFILE
 PHAT file descriptor structure.

Functions

u_long AllocFirstCluster (NUTFILE *nfp)
 Allocate the first cluster of a file.

Variables

u_long _PHATFILE::f_clust
 Current cluster.
u_long _PHATFILE::f_clust_pos
 Sector within the current cluster.
u_long _PHATFILE::f_sect_pos
 Position within the sector.
u_long _PHATFILE::f_clust_prv
 Previous cluster used,.
u_long _PHATFILE::f_mode
 File open mode flags.
PHATDIRENT _PHATFILE::f_dirent
 Directory entry of this file.
u_long _PHATFILE::f_de_sect
 Sector of the directory entry.
u_long _PHATFILE::f_de_offs
 Offset into the sector containing the directory entry.
u_int _PHATFILE::f_de_dirty
 Directory entry change marker.
u_short _PHATFILE::f_pde_clust
 First cluster of the parent directory, low word.
u_short _PHATFILE::f_pde_clusthi
 First cluster of the parent directory, high word.
NUTDEVICE devPhat0
 PHAT file system driver information structure.
NUTDEVICE devPhat1
NUTDEVICE devPhat0
 PHAT file system driver information structure.
NUTDEVICE devPhat1


Define Documentation

#define PHAT_FATTR_ARCHIV
 

File is not archived. This flag will be set when the file is created or modified.

#define PHAT_FATTR_DIR
 

File contains a subdirectory.

#define PHAT_FATTR_FILEMASK
 

Only these flags are allowed for files and directories.

#define PHAT_FATTR_HIDDEN
 

Hidden file.

#define PHAT_FATTR_RDONLY
 

Read only file.

#define PHAT_FATTR_SYSTEM
 

System file.

#define PHAT_FATTR_VOLID
 

No file, but a volume label.


Function Documentation

u_long AllocFirstCluster NUTFILE nfp  ) 
 

Allocate the first cluster of a file.

Parameters:
The file for which a cluster is allocated.
Returns:
Number of the allocated cluster, which is not lower than 2. Any value lower than 2 indicates an error.


Variable Documentation

NUTDEVICE devPhat0
 

PHAT file system driver information structure.

A pointer to this structure must be passed to NutRegisterDevice() to bind this file system driver to the Nut/OS kernel. An application may then call /verbatim _open("MMC0:1/PHAT0", _O_RDWR | _O_BINARY); /endverbatim to mount partition 1 on the previously registered block device (devMmc0 in this example).

NUTDEVICE devPhat0
 

PHAT file system driver information structure.

A pointer to this structure must be passed to NutRegisterDevice() to bind this file system driver to the Nut/OS kernel. An application may then call /verbatim _open("MMC0:1/PHAT0", _O_RDWR | _O_BINARY); /endverbatim to mount partition 1 on the previously registered block device (devMmc0 in this example).

u_long _PHATFILE::f_de_sect [inherited]
 

Sector of the directory entry.

For the root directory this value is zero, because the root doesn't have any entry in another directory.

u_short _PHATFILE::f_pde_clust [inherited]
 

First cluster of the parent directory, low word.

Our directory entry is located in this cluster.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/