faq.html   [plain text]


<!--$Id: faq.so,v 1.30 2004/08/17 13:45:35 sue Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: VxWorks FAQ</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Building Berkeley DB for VxWorks systems</dl></b></td>
<td align=right><a href="../build_vxworks/notes.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade/version.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>VxWorks FAQ</b></p>
<ol>
<p><li><b>I get the error "Workspace open failed: This project workspace is an
older format.", when trying to open the supplied workspace on Tornado 2.0
under Windows.</b>
<p>This error will occur if the files were extracted in a manner that adds
a CR/LF to lines in the file.  Make sure that you download the Berkeley DB
".zip" version of the Berkeley DB distribution, and, when extracting the Berkeley DB
sources, that you use an unzipper program that will not do any
conversion.</p>
<p><li><b>I sometimes see spurious output errors about temporary directories.</b>
<p>These messages are coming from the <b>stat</b>(2) function call
in VxWorks.  Unlike other systems, there may not be a well known
temporary directory on the target.  Therefore, we highly recommend that
all applications use <a href="../../api_c/env_set_tmp_dir.html">DB_ENV-&gt;set_tmp_dir</a> to
specify a temporary directory for the application.</p>
<p><li><b>How can I build Berkeley DB without using Tornado?</b>
<p>The simplest way to build Berkeley DB without using Tornado is to configure
Berkeley DB on a UNIX system, and then use the Makefile and include files
generated by that configuration as the starting point for your build.
The Makefile and include files are created during configuration, in the
current directory, based on your configuration decisions (for example,
debugging vs.  non-debugging builds), so you'll need to configure the
system for the way you want Berkeley DB to be built.</p>
<p>Additionally, you'll need to account for the slight difference between
the set of source files used in a UNIX build and the set used in a
VxWorks build.  You can use the following command to create a list of
the Berkeley DB VxWorks files.  The commands assume you are in the build_vxworks
directory of the Berkeley DB distribution:</p>
<blockquote><pre>% cat &gt; /tmp/files.sed
s/&lt;BEGIN&gt; FILE_//
s/_objects//
^D
% grep FILE_ BerkeleyDB.wpj | grep _objects | sed -f /tmp/files.sed &gt; /tmp/db.files</pre></blockquote>
<p>You will then have a template Makefile and include files, and a list of
VxWorks-specific source files.  You will need to convert this Makefile
and list of files into a form that is acceptable to your specific build
environment.</p>
<p><li><b>Does Berkeley DB use floating point registers?</b>
<p>Yes, there are a few places in Berkeley DB where floating point computations
are performed.  As a result, all applications that call
<i>taskSpawn</i> should specify the <b>VX_FP_TASK</b> option.</p>
<p><li><b>Can I run the test suite under VxWorks?</b>
<p>The test suite requires the Berkeley DB Tcl library.  In turn, this library
requires Tcl 8.4 or greater.  In order to run the test suite, you would
need to port Tcl 8.4 or greater to VxWorks.  The Tcl shell included in
<i>windsh</i> is not adequate for two reasons.  First, it is based on
Tcl 8.0.  Second, it does not include the necessary Tcl components for
adding a Tcl extension.</p>
<p><li><b>Are all Berkeley DB features available for VxWorks?</b>
<p>All Berkeley DB features are available for VxWorks with the exception of the
<a href="../../api_c/db_open.html#DB_TRUNCATE">DB_TRUNCATE</a> flag for <a href="../../api_c/db_open.html">DB-&gt;open</a>.  The underlying mechanism
needed for that flag is not available consistently across different file
systems for VxWorks.</p>
<p><li><b>Are there any constraints using particular filesystem drivers?</b>
<p>There are constraints using the dosFs filesystems with Berkeley DB.  Namely,
you must configure your dosFs filesystem to support long filenames if
you are using Berkeley DB logging in your application.  The VxWorks' dosFs
1.0 filesystem, by default, uses the old MS-DOS 8.3 file-naming
constraints, restricting to 8 character filenames with a 3 character
extension.  If you have configured with VxWorks' dosFs 2.0 you should
be compatible with Windows FAT32 filesystems which supports long
filenames.</p>
<p><li><b>Are there any dependencies on particular filesystem drivers?</b>
<p>There is one dependency on specifics of filesystem drivers in the port
of Berkeley DB to VxWorks.  Berkeley DB synchronizes data using the FIOSYNC function
to ioctl() (another option would have been to use the FIOFLUSH function
instead).  The FIOSYNC function was chosen because the NFS client driver,
nfsDrv, only supports it and doesn't support FIOFLUSH.  All local file
systems, as of VxWorks 5.4, support FIOSYNC -- with the exception of
rt11fsLib, which only supports FIOFLUSH.  To use rt11fsLib, you will need
to modify the os/os_fsync.c file to use the FIOFLUSH function; note that
rt11fsLib cannot work with NFS clients.</p>
<p><li><b>Are there any known filesystem problems?</b>
<p>During the course of our internal testing, we came across three problems
with the dosFs 2.0 filesystem that warranted patches from Wind River Systems.
We strongly recommend you upgrade to dosFs 2.2, <b>SPR 79795 (x86)</b>
and <b>SPR 79569 (PPC)</b> which fixes all of these problems and
many more.  You should ask Wind River Systems for the patches to these
problems if you encounter them and are unable to upgrade to dosFs 2.2.</p>
<p>The first problem is that files will seem to disappear.  You should
look at <b>SPR 31480</b> in the Wind River Systems' Support pages for
a more detailed description of this problem.</p>
<p>The second problem is a semaphore deadlock within the dosFs filesystem
code.  Looking at a stack trace via CrossWind, you will see two or more of
your application's tasks waiting in semaphore code within dosFs.  The patch
for this problem is under <b>SPR 33221</b> at Wind River Systems.
There are several SPR numbers at Wind River Systems that refer to this
particular problem.</p>
<p>The third problem is that all tasks will hang on a dosFs semaphore.  You should
look at <b>SPR 72063</b> in the Wind River Systems' Support pages for
a more detailed description of this problem.</p>
<p><li><b>Are there any filesystems I cannot use?</b>
<p>Currently both the Target Server File System (TSFS) and NFS are not able
to be used.</p>
<p>The Target Server File System (TSFS) uses the netDrv driver.  This driver
does not support any ioctl that allows flushing to the disk, nor does
it allow renaming of files via FIORENAME.
The NFS file system uses nfsDrv and that driver
does not support FIORENAME and cannot be used
with Berkeley DB.  </p>
<p><li><b>What VxWorks primitives are used for mutual exclusion in Berkeley DB?</b>
<p>Mutexes inside of Berkeley DB use the basic binary semaphores in VxWorks.  The
mutexes are created using the FIFO queue type.</p>
<p><li><b>What are the implications of VxWorks' mutex implementation
using microkernel resources?</b>
<p>On VxWorks, the semaphore primitives implementing mutexes consume system
resources.  Therefore, if an application unexpectedly fails, those
resources could leak.  Berkeley DB solves this problem by always allocating
mutexes in the persistent shared memory regions.  Then, if an
application fails, running recovery or explicitly removing the database
environment by calling the <a href="../../api_c/env_remove.html">DB_ENV-&gt;remove</a> method will allow Berkeley DB to
release those previously held mutex resources.  If an application
specifies the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag (choosing not to use persistent
shared memory), and then fails, mutexes allocated in that private memory
may leak their underlying system resources.  Therefore, the
<a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag should be used with caution on VxWorks.</p>
</ol>
<table width="100%"><tr><td><br></td><td align=right><a href="../build_vxworks/notes.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade/version.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>