Raw File System: rawFs
VxWorks provides a minimal "file system," rawFs, for use in systems that require only the most basic disk I/O functions. The rawFs file system, implemented in rawFsLib, treats the entire disk volume much like a single large file.
Although the dosFs file system provides this ability to varying degrees, the rawFs file system offers advantages in size and performance if more complex functions are not required.
To use the rawFs file system in a VxWorks-based system, include the INCLUDE_RAWFS component in the kernel, and set the NUM_RAWFS_FILES parameter to the desired maximum open file descriptor count.
5.4.1 Disk Organization
The rawFs file system imposes no organization of the data on the disk. It maintains no directory information; thus there is no division of the disk area into specific files. All open( ) operations on rawFs devices specify only the device name; no additional filenames are possible.
The entire disk area is treated as a single file and is available to any file descriptor that is open for the device. All read and write operations to the disk use a byte-offset relative to the start of the first block on the disk.
5.4.2 Initializing the rawFs File System
Before any other operations can be performed, the rawFs library, rawFsLib, must be initialized by calling rawFsInit( ). This routine takes a single parameter, the maximum number of rawFs file descriptors that can be open at one time. This count is used to allocate a set of descriptors; a descriptor is used each time a rawFs device is opened.
The rawFsInit( ) routine also makes an entry for the rawFs file system in the I/O system driver table (with iosDrvInstall( )). This entry specifies the entry points for rawFs file operations, for all devices that use the rawFs file system. The driver number assigned to the rawFs file system is placed in a global variable, rawFsDrvNum.
The rawFsInit( ) routine is normally called by the usrRoot( ) task after starting the VxWorks system.