文件系统资料文档格式.docx
- 文档编号:22745247
- 上传时间:2023-02-05
- 格式:DOCX
- 页数:22
- 大小:612.80KB
文件系统资料文档格式.docx
《文件系统资料文档格式.docx》由会员分享,可在线阅读,更多相关《文件系统资料文档格式.docx(22页珍藏版)》请在冰豆网上搜索。
FS_AssignMemory()AssignsmemorytoPowerPacFileSystem.
FS_LOGVOL_Create()Createsalogicalvolume.
FS_LOGVOL_AddDevice()Addsadevicetoalogicalvolume.
FS_GetMaxSectorSize()Returnsthemaximumsectorsize.
FS_SetMaxSectorSize()Configuresthemaximumsectorsize.
FS_SetMemHandler()Setsthememoryallocationroutineswhenthefilesystemshalluse
externalmemoryallocationroutines.
FS_WriteUpdateDir()Updatesthedirectoryentrywheneverafileiswrittento.
Fileaccessfunctions
FS_FClose()Closesafile.
FS_FOpen()Opensafile.
FS_FRead()Readsdatafromafile.
FS_Read()Readsdatafromafile.
FS_FWrite()Writesdatatoafile.
FS_Write()Writesdatatoafile.
Filepositioningfunctions
FS_FSeek()Setspositionofafilepointer.
FS_FTell()Returnspositionofafilepointer.
FS_GetFilePos()Returnspositionofafilepointer.
FS_SetFilePos()Setspositionofafilepointer.
Operationsonfiles
FS_CopyFile()Copiesafile.
FS_GetFileAttributes()Retrievestheattributesofagivenfile/directory.
FS_GetFileTime()Retrievesthecreation,accessormodifytimestampofagivenfile/
directory.
FS_GetFileTimeExRetrievesthetimestampofagivenfile/directory.
FS_Move()Movesanexistingfileoradirectory,includingitschildren.
FS_Remove()Deletesafile.
FS_Rename()Renamesafile/directory.
FS_SetFileAttributes()Setstheattributesofagivenfileordirectory.
FS_SetFileTime()Setsthetimestampofagivenfileordirectory.
FS_SetFileTimeEx()Setsthecreation,accessormodifytimestampofagivenfileor
FS_SetEndOfFile()Setstheendofafile.
FS_Truncate()Truncatesafiletoaspecifiedsize.
FS_Verify()Verifiesafilewithagivendatabuffer.
Directoryfunctions
FS_FindClose()Closesadirectory.
FS_FindFirstFile()Searchesforafileinaspecifieddirectory.
FS_FindNextFile()Continuesfilesearchinadirectory.
FS_MkDir()Createsadirectory.
FS_RmDir()Removesadirectory.
Formattingamedium
FS_IsHLFormattedChecksifadeviceishigh-levelformatted.
FS_IsLLFormattedChecksifadeviceislow-levelformatted.
FS_FormatLLIfRequiredChecksifadeviceislow-levelformattedandformatsitifrequired.
FS_FormatLow()Low-levelformatsadevice.
FS_Format()High-levelformatsadevice.
Filesystemextendedfunctions
FS_GetFileSize()Retrievesthecurrentfilesizeofagivenfilepointer.
FS_GetFreeSpace()Getsamountoffreespaceondrive.
FS_GetNumVolumes()Retrievestheavailablevolumes.
FS_GetTotalSpace()Getstotalamountofdrivespace.
FS_GetVolumeFreeSpace()Getsthefreespaceofagivenvolume.
FS_GetVolumeInfo()Getvolumeinformation(clusters,sectorsetc.).
FS_GetVolumeLabel()Retrievesthelabelofagivenvolumeindex.
FS_GetVolumeName()Retrievesthenameofagivenvolumeindex.
FS_GetVolumeSize()Getsthesizeofagivenvolume.
FS_GetVolumeStatus()Returnsthestatusofavolume.
FS_IsVolumeMounted()Returnsifthevolumeismountedandhascorrectfilesystem
information.
FS_FileTimeToTimeStamp()Convertsafiletimetoatimestamp.
FS_SetBusyLEDCallback()SetsaBusyLEDcallbackforaspecificvolume.
FS_SetVolumeLabel()Setsalabeltoaspecificvolume.
FS_TimeStampToFileTime()Convertsatimestamptoafiletime.
Storagelayerfunctions
FS_STORAGE_GetDeviceInfo()Returnsinformationaboutthedevice.
FS_STORAGE_Init()InitializesthedriverandOSifnecessary.
FS_STORAGE_ReadSector()Readsasectorfromadevice.
FS_STORAGE_ReadSectors()Readsmultiplesectorsfromadevice.
FS_STORAGE_Sync()Writescacheddatatothestoragemedium.
FS_STORAGE_Unmount()Low-levelunmount.Unmountsavolumeonthedriverlayer.
FS_STORAGE_WriteSector()Writesasectorfromadevice.
FS_STORAGE_WriteSectors()Writesmultiplesectorsfromadevice.
FATrelatedfunctions
FS_FAT_CheckDisk()ChecksandrepairsaFATvolume.
FS_FAT_CheckDisk_ErrCode2Text()Returnsanerrormessagetoaspecificcheckdiskerrorcode.
FS_FAT_GrowRootDirLetstherootdirectoryofaFAT32volumegrow.
FS_FormatSD()High-levelformatsadeviceaccordingtotheSDcardfilesystem
specification.
Filesystemcachefunctions
FS_AssignCache()Addsacachetoaspecificdevice.
FS_CACHE_Clean()Cleansthecachesandwritesdirtysectorstothevolume.
FS_CACHE_SetMode()Setsthemodeforthecache.
FS_CACHE_SetQuota()Setsthequotasforthedifferentsectortypesinthe
CacheRW_Quotacachemodule.
Error-handlingfunctions
FS_ClearErr()Clearstheerrorstatusofagivenfilepointer.
FS_FEof()Testsforend-of-fileonagivenfilepointer.
FS_FError()Returnstheerrorcodeofagivenfilepointer.
FS_ErrorNo2Text()Retrievestextforagivenerrorcode.
Obsoletefunctions
FS_CloseDir()Closesadirectorystream.
FS_DirEnt2Attr()Getsthedirectoryentryattributes.
FS_DirEnt2Name()Getsthedirectoryentryname.
FS_DirEnt2Size()Getsthedirectoryentryfilesize.
FS_DirEnt2Time()Getsthedirectoryentrytimestamp.
FS_GetDeviceInfo()Returnsinformationaboutthedevice.
FS_GetNumFiles()Getsthenumberoffilesinadirectory.
FS_InitStorage()InitializesthedriverandOSifnecessary.
FS_OpenDir()Opensadirectorystream.
FS_ReadDir()Readsthenextdirectoryentry.
FS_ReadSector()Readsasectorfromadevice.
FS_RewindDir()Resetsthepositionofthedirectorystream.
FS_WriteSector()Writesasectortoadevice.
FS_UnmountLL()Low-levelunmount.Unmountsavolumeonthedriverlayer.
Devicedrivers
PowerPacFileSystemhasbeendesignedtocooperatewithanykindofhardware.Tousespecifichardwarewith
PowerPacFileSystem,aso-calleddevicedriverforthathardwareisrequired.Thedevicedriverconsistsofbasic
I/Ofunctionsforaccessingthehardwareandaglobaltablethatholdspointerstothesefunctions.
Generalinformation
DEFAULTDEVICEDRIVERNAMES
Bydefault,thefollowingidentifiersareusedforeachdriver.
ToaddadrivertoPowerPacFileSystem,FS_AddDevice()shouldbecalledwiththeproperidentifiertomountthe
devicedrivertoPowerPacFileSystembeforeaccessingthedeviceoritsunits.RefertoFS_AddDevice()onpage35
fordetailedinformation.
UNITNUMBER
Mostdriverfunctionsaswellasmostoftheunderlyinghardwarefunctionsreceivetheunitnumberasthefirst
parameter.Theunitnumberallowsdifferentiationbetweenthedifferentinstancesofthesamedevicetypes.Ifthereare
forexample2NANDflasheswhichoperateas2differentdevices,thefirstoneisidentifiedasUnit=0,thesecondone
asUnit=1.Ifthereisjustasingleinstance(asinmostsystems),theunitparametercanbeignoredbytheunderlying
hardwarefunctions.
RAMdiskdriver
PowerPacFileSystemcomeswithasimpleRAMdiskdriverthatmakesitpossibletouseaportionofyoursystem
RAMasadevicefordatastorage.Thiscanbeveryhelpfultoexamineyoursystemperformanceandmayalsobeused
asanin-systemtestprocedure.
SUPPORTEDHARDWARE
TheRAMdrivercanbeusedwitheverytargetwithenoughRAM.Thesizeofthediskisdefinedasthenumberof
sectorsreservedforthedrive.
THEORYOFOPERATION
ARAMdiskisaportionofmemorythatyouallocatetouseasapartition.TheRAMdiskdrivertakessomeofyour
memoryandpretendsthatitisaharddrivethatyoucanformat,mount,savefilesto,etc.
RememberthateverybitofRAMisimportantforthewellbeingofyoursystemandthelargeryourRAMdiskis,the
lessmemorythereisavailableforyoursystem.
FAIL-SAFEOPERATION
Whenpowerislost,thedataoftheRAMdriveistypicallylostaswellexceptforsystemswithBatterybackupforthe
RAMusedasstoragedevice.
Forthisreason,failsafetyisrelevantonlyforsystemswhichprovidesuchbatterybackup.
Unexpectedreset
Ifanunexpectedresetoccurs,thedatawillbepreserved.However,ifthepowerfailureoranunexpectedresetinterrupts
awriteoperation,thedataofthesectormaycontainpartiallyinvaliddata.
Powerfailure
Powerfailurecausesanunexpectedreset.Theeffectsofanunexpectedresetaredescribedabove.
WEARLEVELING
TheRAMdiskdriverdoesnotrequirewearleveling.
CONFIGURINGTHEDRIVER
AddingthedrivertoPowerPacFileSystem
Toaddthedriver,useFS_AddDevice()withthedriverlabelFS_RAMDISK_Driver.Thisfunctionhastobe
calledfromwithinFS_X_AddDevices().RefertoFS_X_AddDevices()onpage171formoreinformation.
Example
FS_AddDevice(&
FS_RAMDISK_Driver);
FS_RAMDISK_Configure()
Description
ConfiguresasingleRAMdiskinstance.
Prototype
voidFS_RAMDISK_Configure(U8Unit,
void*pData,
U16BytesPerSector,
U32NumSectors);
Additionalinformation
Thesizeofthediskisdefinedasthenumberofsectorsreservedforthedrive.Eachsectorconsistsof512bytes.The
minimumvalueforNumSectorsis7.BytesPerSectordefinesthesizeofeachsectorontheRAMdisk.AFATfile
systemneedsaminimumsectorsizeof5
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 文件系统 资料