Discussion:
create ramdisk
(too old to reply)
Arif
2005-05-16 06:55:48 UTC
Permalink
hi everyone,
Actually i am trying to create a RAM disk in vxworks .I tried it once,
but while running a new window is opening saying that " UNRESOLVED
SYMBOL". Can any one give some details how to create RAMdisk.

Regards,
Arif
Aek
2005-05-16 08:46:56 UTC
Permalink
depends on what version of vxworks you are using.
this is the function I am using the create a ramdisk in vxworks 5.5
that has a dosFS2 on it.

*this is a cutnpaste job, not tested.. *

#include "ramDiskCbio.h"
#include "dosFsLib.h"

CBIO_DEV_ID *pRAMcbio;
long lRAMDRVexists;

int makeRAMDrive ( void )
{
int retval;
STATUS status;
retval = OK;

if (lRAMDRVexists == 0) /* else return will
be OK */
{
*pRAMcbio = ramDiskDevCreate(0,512,3000,3000,0);
if (*pRAMcbio == NULL)
{
printf(" makeRAMDrive: ram drive creation failed \n");
retval = ERROR;
}
else
{
lRAMDRVexists = 1;
status = dosFsDevCreate("/RAMDRV/",*pRAMcbio,4,NONE);
if (status == ERROR)
{
printf( "makeRAMDrive: creation of DOS FS on RAM drive failed
\n " );
retval = ERROR;
}
else
{
status = dosFsVolFormat(*pRAMcbio, DOS_OPT_BLANK | DOS_OPT_QUIET,
NULL);
if (status == ERROR) {
printf( "makeRAMDrive: formatting DOS FS on RAM drive failed \n " );
retval = ERROR;
}
}

}
}
return retval;
}

Loading...