Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Formatting XBD device in vxworks6.3

1,694 views
Skip to first unread message

Akshatha

unread,
Apr 25, 2008, 10:08:57 AM4/25/08
to
Hi,
I am trying to format my xbd device in vxworks 6.3.LEt me explain the
procedure i follow befor that:

1) First i create a virtual device using pBlkDevRoot =
virtualDiskCreate();

2)Since we can use dosFsDevInit()to initialise DOS filesystem in 6.3 i
use a XBD wrapper utility which converts BLK_DEV device to XBD type
and by default instantiates rawFS on it.

xbdBlkDevCreate(pBlkDevRoot, "/");
value = 1 = 0x1
or

xbdBlkDevCreateSync(pBlkDevRoot,"/");
Instantiating / as rawFs, device = 0x20001

value = 65537 = 0x10001

3) then try to format using
dosFsVolFormat("/", 0, 0);
Formatting / for DOSFS
Format failed
value = -1 = 0xffffffff.

some more details:
Formatting / for DOSFS
Instantiating / as rawFs, device = 0x10001
Formatting...Retrieved old volume params with %38 confidence:
Volume Parameters: FAT type: FAT32, sectors per cluster 0
0 FAT copies, 0 clusters, 0 sectors per FAT
Sectors reserved 0, hidden 0, FAT sectors 0
Root dir entries 0, sysId (null) , serial number 71d20000
Label:" " ...
Disk with 83968 sectors of 512 bytes will be formatted with:
Volume Parameters: FAT type: FAT32, sectors per cluster 8
2 FAT copies, 536870891 clusters, 82 sectors per FAT
Sectors reserved 1, hidden 83968, FAT sectors 164
Root dir entries 0, sysId VXDOS16 , serial number 71d20000
Label:" " ...
dosFsVolFormat: bad format parameters, errno = 0x16
Failed.
value = -1 = 0xffffffff


what is the cause for this error? how do i debug this issue or am i
missing something before formatting my virtual disk?
Any sugesstion or pointers would be of great help..

peter....@gmail.com

unread,
Apr 25, 2008, 10:35:36 AM4/25/08
to
It has been a while since I have worked with VxWorks, but I see
several things.

#1.
The preferred way to format a DosFS device in VxWorks 6.2 and later is
to use ...

dosfsDiskFormat "<device name>"
See target/src/util/usrFsLib.c, as I may be slightly off in the
name. If I remember correctly it does allow various options to be
passed.

Example:
dosfsDiskFormat "/ata0a"
dosfsDiskFormat "/vDisk"

#2.
The name of your device is "/". Try giving it another name such as "/
vDisk". VxWorks does not really support a root directory "/". It can
fake it out for POSIX compliance (I can't remember the name of the
component to include for that) but under that circumstance, its "root
directory" is strictly read only.

#3.
The virtual disk module is already set up to use XBDs. You shouldn't
need to explicitly use an XBD wrapper with them (that wrapper is
already built into it).


After creating your virtual disk using virtualDiskCreate( ... ), run
"devs" from the target shell. You should see your virtual disk device
in the device listing.

To format it for DosFS, use dosfsDiskFormat().


Sparky.

Akshatha

unread,
Apr 29, 2008, 10:06:05 AM4/29/08
to
Hi Peter,
Thanks for the reply..
But i tried using dosfsDiskFormat but this also returns me error.

1)If i dont use XBD wrapper the virtual device is not detected.only
when i use this wrapper i see the device listed on giving devs.

a)-> pBlkDevRoot = virtualDiskCreate("/myworkspace/virtual_disk_root",
512, 42991616/512, 42991616/512);

b)->xbdBlkDevCreate(pBlkDevRoot, "/vroot");


value = 1 = 0x1

-> Instantiating /vroot:0 as rawFs, device = 0x10001

c)dosfsDiskFormat("/vroot");
Formatting /vroot:0 for DOSFS
Instantiating /vroot:0 as rawFs, device = 0x10001


Formatting...Retrieved old volume params with %38 confidence:
Volume Parameters: FAT type: FAT32, sectors per cluster 0
0 FAT copies, 0 clusters, 0 sectors per FAT
Sectors reserved 0, hidden 0, FAT sectors 0

Root dir entries 0, sysId (null) , serial number 56fb0000


Label:" " ...
Disk with 83968 sectors of 512 bytes will be formatted with:
Volume Parameters: FAT type: FAT32, sectors per cluster 8
2 FAT copies, 536870891 clusters, 82 sectors per FAT
Sectors reserved 1, hidden 83968, FAT sectors 164

Root dir entries 0, sysId VXDOS16 , serial number 56fb0000


Label:" " ...
dosFsVolFormat: bad format parameters, errno = 0x16
Failed.
value = -1 = 0xffffffff

->
-> printErrno 0x16
errno = 0x16 : S_errno_EINVAL.
value = 0 = 0x0


d) I tried using -dofFsDevCreate() before formatting but it returns
unknown volume format error

> dosFsDevCreate("/",xbd_root,10,0x00000002 | 0x00000100 | 0x00000200 )
0x6a6c4c58 (tShell0): dosFsLib.c : Malformed boot sector. Offset 0,
value 0.
0x6a6c4c58 (tShell0): dosFsLib.c : error when mounting volume
0x6a6c4f30
0x6a6c4c58 (tShell0): dosFsLib.c : Failed to create a dosFs volume


value = -1 = 0xffffffff

->
-> errno
errno = 0x680ddc70: value = 3670044 = 0x38001c

any idea what is the problem here? any input would be of greta help..

jab...@hotmail.com

unread,
May 5, 2008, 10:12:59 AM5/5/08
to


Hello,
below is copy from WR documentation for VxWorks 6.6, your steps seem
to differ:
4.3.2 Virtual Disk Support
To simulate access to file systems, either the file system supplied
with VxWorks or one you have implemented yourself, the VxWorks
simulator includes support for virtual disks. A virtual disk converts
all read and write accesses to read and write accesses to a file on
the host file system. However, to an application running in a VxWorks
image, accessing the virtual disk looks no different than any other
disk in a VxWorks I/O system.
NOTE: Virtual disk support replaces the UNIX disk driver library
(unixDrv) included in earlier versions of the VxWorks simulator.

By default, the VxWorks simulator includes support for virtual disks.
The relevant configuration component is INCLUDE_VIRTUAL_DISK. To
initialize the virtual disk system, call virtualDiskInit( ). After
control returns from a successful call to virtualDiskInit( ), you can
create a virtual disk instance by calling virtualDiskCreate( ):

BLK_DEV * vitualDiskCreate
(
char * hostFile, /* name of the host file to
use */
int bytesPerBlk, /* number of bytes per
block */
int blksPerTrack, /* number of blocks per
track */
int nBlocks /* number of blocks on this
device */
)
Although a successful call to virtualDiskCreate( ) creates a disk
instance, there is not yet any name or file system associated with the
instance. To create this association, you must call a file system
device initialization routine. Consider the following code fragment:

BLK_DEV * vdBlkDev;
vdBlkDev = virtualDiskCreate (hostFile, 512, 32, 32*200);
fsmNameInstall("/Q:0", "/Q");
xbd = xbdBlkDevCreateSync(vdBlkDev, "/Q");
status = dosFsVolFormat("/Q", DOS_OPT_QUIET | DOS_OPT_BLANK,
NULL);

This code creates /Q, a 3 MB DOS disk with 512-byte blocks, and 32
tracks. In support of this virtual disk, the virtualDiskCreate( ) call
creates the file c:/tmp/filesys1 (if the file does not already exist).
Do not delete this file while the virtual disk is open (to close a
virtual disk, call the virtualDiskClose( ) routine). To check whether
this code has successfully created a virtual disk, you can call
devs( ), which should return the following:

drv name
0 /null
1 /tyCo/0
5 host:
6 /vio
3 C:

cheers.

Akshatha

unread,
May 8, 2008, 2:33:21 AM5/8/08
to
Hi,
The procedure is same . even i use the fsmName Install before calling
XBDBlkDevCreateSync.I missed out specifyinf that last time.

And these commands are run on a bash startup script which runs on
winshell when launching vxsim.

Thanks.

MB

unread,
May 8, 2008, 9:45:31 AM5/8/08
to
Hi Akshatha,

I was working on 6.2 and worked on ATA driver, that time I was trying
to format and create dos FS on the ATA device (compact flash device).
I did following in order to get the formatting

1. BLK_DEV *pAta;
pAta =(BLK_DEV *) ataXbdDevCreate(0,0,0,0, "/ata");

2. xbdCreatePartition("/ata:0", 1, 100, 0, 0 );

3. dosFsVolFormat( "/ata:1", DOS_OPT_BLANK , 0) ;

I saw your dumps and I have few tips for you:
1) Biggest concern is : "Formatting...Retrieved old volume params
with %38 confidence:
" I think some thing gone wrong in your BSP or the driver. Are you
trying to format compact flash or sata device?

2) When you call dosfsDiskFormat(), it will try to send few commands
and check, if you have kernel source and BSP source, try debugging
those library.

3) If you have the device manual with you, then you can double check
with the volueme parameters get printed when you call
dosfsDiskFormat(). If you drivers sysByteRead/Write or some other
entry point is not proper, then you may find few of those parameters
correct and few wrong. Make sure they are all correct.

Happy debugging...enjoy:-)

-MB.

> > cheers.- Hide quoted text -
>
> - Show quoted text -

Akshatha

unread,
May 8, 2008, 11:49:25 PM5/8/08
to
ok Thanks for the info .Let me try this.. I am trying to format
virtual disk created by virtualDiskCreate().
0 new messages