VxWorks API Reference : OS Libraries
ramDiskCbio - RAM Disk Cached Block Driver
ramDiskDevCreate( ) - Initialize a RAM Disk device
This module implements a RAM-disk driver with a CBIO interface which can be directly utilized by dosFsLib without the use of the Disk Cache module dcacheCbio. This results in an ultra-compact RAM footprint. This module is implemented using the CBIO API (see cbioLib( ))
This module is delivered in source as a functional example of a basic CBIO module.
This module may be used for SRAM or other non-volatile RAM cards to store a file system, but that configuration will be susceptible to data corruption in events of system failure which are not normally observed with magnetic disks, i.e. using this driver with an SRAM card can not guard against interruptions in midst of updating a particular sector, resulting in that sector become internally inconsistent.
ramDiskDevCreate( ) - Initialize a RAM Disk device
CBIO_DEV_ID ramDiskDevCreate ( char * pRamAddr, /* where it is in memory (0 = malloc) */ int bytesPerBlk, /* number of bytes per block */ int blksPerTrack, /* number of blocks per track */ int nBlocks, /* number of blocks on this device */ int blkOffset /* no. of blks to skip at start of device */ )
This function creates a compact RAM-Disk device that can be directly utilized by dosFsLib, without the intermediate disk cache. It can be used for non-volatile RAM as well as volatile RAM disks.
The RAM size is specified in terms of total number of blocks in the device and the block size in bytes. The minimal block size is 32 bytes. If pRamAddr is NULL, space will be allocated from the default memory pool.
a CBIO handle that can be directly used by dosFsDevCreate( ) or NULL if the requested amount of RAM is not available.
When used with NV-RAM, this module can not eliminate mid-block write interruption, which may cause file system corruption not existent in common disk drives.