dosfslib.html
来自「vxworks相关论文」· HTML 代码 · 共 1,270 行 · 第 1/5 页
HTML
1,270 行
No automatic incrementing of the date is performed; each new date mustbe set with a call to this routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the date is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><i><a href="./dosFsLib.html#dosFsTimeSet">dosFsTimeSet</a></i>( )</b>, <b><i><a href="./dosFsLib.html#dosFsDateTimeInstall">dosFsDateTimeInstall</a></i>( )</b>.<hr><a name="dosFsDateTimeInstall"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dosFsDateTimeInstall</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dosFsDateTimeInstall</i>( )</strong> - install a user-supplied date/time function</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void dosFsDateTimeInstall ( FUNCPTR pDateTimeFunc /* pointer to user-supplied function */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine installs a user-supplied function to provide the currentdate and time. Once such a function is installed, <b><a href="./dosFsLib.html#top">dosFsLib</a></b> will callit when necessary to obtain the date and time. Otherwise, the date andtime most recently set by <b><i><a href="./dosFsLib.html#dosFsDateSet">dosFsDateSet</a></i>( )</b> and <b><i><a href="./dosFsLib.html#dosFsTimeSet">dosFsTimeSet</a></i>( )</b> are used.<p>The user-supplied routine must take exactly one input parameter, theaddress of a <b>DOS_DATE_TIME</b> structure (defined in <b>dosFsLib.h</b>). The userroutine should update the necessary fields in this structure and thenreturn. Any fields which are not changed by the user routine willretain their previous value.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b><hr><a name="dosFsDevInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dosFsDevInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dosFsDevInit</i>( )</strong> - associate a block device with dosFs file system functions</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>DOS_VOL_DESC *dosFsDevInit ( char * devName, /* device name */ BLK_DEV * pBlkDev, /* pointer to block device struct */ DOS_VOL_CONFIG * pConfig /* pointer to volume config data */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine takes a block device structure (<b>BLK_DEV</b>) created bya device driver and defines it as a dosFs volume. As a result, whenhigh-level I/O operations (e.g., <b><i><a href="./ioLib.html#open">open</a></i>( )</b>, <b><i><a href="./ioLib.html#write">write</a></i>( )</b>) are performed onthe device, the calls will be routed through dosFsLib. The <i>pBlkDev</i>parameter is the address of the <b>BLK_DEV</b> structure which describes thisdevice.<p>This routine associates the name <i>devName</i> with the device and installsit in the VxWorks I/O system's device table. The driver number used whenthe device is added to the table is that which was assigned to thedosFs library during <b><i><a href="./dosFsLib.html#dosFsInit">dosFsInit</a></i>( )</b>. (The driver number is placed inthe global variable <b>dosFsDrvNum</b>.)<p>The <b>BLK_DEV</b> structure contains configuration data describing the deviceand the addresses of five routines which will be called to read sectors,write sectors, reset the device, check device status, and perform othercontrol functions (<b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b>). These routines will not be called until theyare required by subsequent I/O operations.<p>The <i>pConfig</i> parameter is the address of a <b>DOS_VOL_CONFIG</b> structure.This structure must have been previously initialized with the specificdosFs configuration data to be used for this volume. This structuremay be easily initialized using <b><i><a href="./dosFsLib.html#dosFsConfigInit">dosFsConfigInit</a></i>( )</b>.<p>If the device being initialized already has a valid dosFs (MS-DOS) filesystem on it, the <i>pConfig</i> parameter may be NULL. In this case, thevolume will be mounted and the configuration data will be read fromthe boot sector of the disk. (If <i>pConfig</i> is NULL, both change-no-warnand auto-sync options are initially disabled. These can be enabledusing the <b><i><a href="./dosFsLib.html#dosFsVolOptionsSet">dosFsVolOptionsSet</a></i>( )</b> routine.)<p>This routine allocates and initializes a volume descriptor (<b>DOS_VOL_DESC</b>)for the device. It returns a pointer to <b>DOS_VOL_DESC</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the volume descriptor <b>DOS_VOL_DESC</b>, or NULL ifthere is an error.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><i><a href="./dosFsLib.html#dosFsMkfs">dosFsMkfs</a></i>( )</b><p><hr><a name="dosFsDevInitOptionsSet"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dosFsDevInitOptionsSet</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dosFsDevInitOptionsSet</i>( )</strong> - specify volume options for <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dosFsDevInitOptionsSet ( UINT options /* options for future dosFsDevInit() calls */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allows volume options to be set that will be enabled by subsequent calls to <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b> that do not explicitly supplyconfiguration information in a <b>DOS_VOL_CONFIG</b> structure. This is normally done when mounting a disk which has already been initializedwith file system data. The value of <i>options</i> will be used for all volumes that are initialized by <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b>, unless a specificconfiguration is given.<p>The only volume options which may be specified in this call are thosewhich are not tied to the actual data on the disk. Specifically, youmay not specify the long file name option in this call; if a diskusing that option is mounted, that will be automatically detected.If you specify such an unsettable option during this call it will be ignored;all valid option bits will still be accepted and applied duringsubsequent <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b> calls.<p>For example, to use <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b> to initialize a volume with the auto-syncand filesystem export options, do the following:<pre> status = dosFsDevInitOptionsSet (DOS_OPT_AUTOSYNC | DOS_OPT_EXPORT); if (status != OK) return (ERROR); vdptr = dosFsDevInit ("DEV1:", pBlkDev, NULL); /* note NULL pointer for DOS_VOL_CONFIG */</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>options</i> is invalid.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b>, <b><i><a href="./dosFsLib.html#dosFsVolOptionsSet">dosFsVolOptionsSet</a></i>( )</b><hr><a name="dosFsInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dosFsInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dosFsInit</i>( )</strong> - prepare to use the dosFs library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS dosFsInit ( int maxFiles /* max no. of simultaneously open files */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the dosFs library. It must be called exactlyonce, before any other routine in the library. The argument specifies thenumber of dosFs files that may be open at once. This routine installs<b><a href="./dosFsLib.html#top">dosFsLib</a></b> as a driver in the I/O system driver table, allocates and sets upthe necessary memory structures, and initializes semaphores. The drivernumber assigned to <b><a href="./dosFsLib.html#top">dosFsLib</a></b> is placed in the global variable <b>dosFsDrvNum</b>.<p>This initialization is enabled when the configuration macro <b>INCLUDE_DOSFS</b>is defined; <b><i><a href="./dosFsLib.html#dosFsInit">dosFsInit</a></i>( )</b> is then called from the root task, <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>( )</b>, in<b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b><hr><a name="dosFsMkfs"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>dosFsMkfs</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>dosFsMkfs</i>( )</strong> - initialize a device and create a dosFs file system</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>DOS_VOL_DESC *dosFsMkfs ( char * volName, /* volume name to use */ BLK_DEV * pBlkDev /* pointer to block device struct */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine provides a quick method of creating a dosFs file system ona device. It is used instead of the two-step procedure of calling<b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>( )</b> followed by an <b><i><a href="./ioLib.html#ioctl">ioctl</a></i>( )</b> call with an FIODISKINIT functioncode.<p>This call uses default values for various dosFs configuration parameters(i.e., those found in the volume configuration structure, <b>DOS_VOL_CONFIG</b>).The values used are:<p><dl><dt>2<dd>sectors per cluster (see below)<p><dt>1<dd>reserved sector<p><dt>2<dd>FAT copies<p><dt>112<dd>root directory entries<p><dt>0xF0<dd>media byte value<p><dt>0<dd> hidden sectors<p></dl><p>The volume options (auto-sync mode, change-no-warn mode, and long filenames)that are enabled by this routine can be set in advance using <b><i><a href="./dosFsLib.html#dosFsMkfsOptionsSet">dosFsMkfsOptionsSet</a></i>( )</b>. By default, none of these options is enabled for disks initialized by <b><i><a href="./dosFsLib.html#dosFsMkfs">dosFsMkfs</a></i>( )</b>.<p>If initializing a large disk, it is quite possible that the entiredisk area cannot be described by the maximum 64K clusters if onlytwo sectors are contained in each cluster. In such a situation, <b><i><a href="./dosFsLib.html#dosFsMkfs">dosFsMkfs</a></i>( )</b> will automatically increase the number of sectorsper cluster to a number which will allow the entire disk area tobe described in 64K clusters.<p
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?