文件系统资料文档格式.docx

上传人:b****7 文档编号:22745247 上传时间:2023-02-05 格式:DOCX 页数:22 大小:612.80KB
下载 相关 举报
文件系统资料文档格式.docx_第1页
第1页 / 共22页
文件系统资料文档格式.docx_第2页
第2页 / 共22页
文件系统资料文档格式.docx_第3页
第3页 / 共22页
文件系统资料文档格式.docx_第4页
第4页 / 共22页
文件系统资料文档格式.docx_第5页
第5页 / 共22页
点击查看更多>>
下载资源
资源描述

文件系统资料文档格式.docx

《文件系统资料文档格式.docx》由会员分享,可在线阅读,更多相关《文件系统资料文档格式.docx(22页珍藏版)》请在冰豆网上搜索。

文件系统资料文档格式.docx

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

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 文学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1