⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vxw_pt6.html

📁 vxworks及tornado常见问题解答
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head>   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   <meta name="GENERATOR" content="VIM on Unix and Win95">   <meta name="Author" content="Johan Borkhuis">   <meta name="description" content="VxWorks / Tornado II information / FAQ">   <meta name="keywords" content="VxWorks,Tornado,FAQ">   <meta name="version" content="$Id: vxw_pt6.html,v 1.24 2002/03/20 14:00:51 borkhuis Exp $">   <title>VxWorks and Tornado II FAQ</title></head><body><center><h1><strong><font size="+4">VxWorks / Tornado II FAQ</font></strong></h1></center><p><hr WIDTH="80%"><h2><a href="#6">6. Extra modules</a></h2><blockquote><h3><a href="#6.1">6.1 Hard delay</a></h3></blockquote><blockquote><h3><a href="#6.2">6.2 Memory leaks</a></h3></blockquote><blockquote><h3><a href="#6.3">6.3 Corba</a></h3></blockquote><blockquote><h3><a href="#6.4">6.4 Web servers</a></h3></blockquote><blockquote><h3><a href="#6.5">6.5 NTP usage</a></h3></blockquote><blockquote><h3><a href="#6.6">6.6 Performace / Benchmarks</a></h3></blockquote><blockquote><h3><a href="#6.7">6.7 SNMP</a></h3></blockquote><blockquote><h3><a href="#6.8">6.8 Lint</a></h3></blockquote><blockquote><h3><a href="#6.9">6.9 Encryption</a></h3></blockquote><blockquote><h3><a href="#index">Index</a></h3></blockquote><hr WIDTH="80%"><p><h2><a NAME="6"><center>6. Extra modules</center></a></h2><p><h3><a NAME="6.1"><center>6.1 Hard delay</center></a></h3><a NAME="6.1-A"></a>Q: How do I create a hard delay in my task?<p>A: The following was written by Geoffrey Espin in the newsgroup:<blockquote>Attached is a portable sub-clock tick "hard" (busy loop) delay library.I can't believe how many times I've seen code like (bletch!):<pre>for (ix = 0; ix &lt; 0x40000; ix++) ; /* spin wheels for 20 usecs (I hope) */</pre>WRS does supply nanosleep() but is actually limited to system clock rateusually I think.<br>Attached are my delayLib.c and delayLib.h. If you have anysuggestions or improvments let me know: <a href="mailto:espin@idiom.com">espin@idiom.com</a><br><br><a href="delayLib.c">delayLib.c</a><br><a href="delayLib.h">delayLib.h</a></blockquote><p><hr WIDTH="60%"><p><h3><a NAME="6.2"><center>6.2 Memory leaks</center></a></h3><a NAME="6.2-A"></a>Q: How do I find memory leaks?<p>A: The following message was written in de newsgroup by Richard Dickson<a href="mailto:dickson@jlab.org">dickson@jlab.org</a> for a 68K architecturesystem:<p>I coded up some diagnostic code myself to help me find memory leakscaused by the use of malloc, calloc, and free.I have attached the two c source files (both pretty small) for this.  Theymay not be great, but then again I think they generally work (and are free).Compile both source files and then enter:<pre> ld &lt;findMalloc.o find_malloc ld &lt;memTrack.o</pre>in that order *before* loading any of your source code.  This diagnosticreplaces malloc, calloc, and free with versions that keep some statistics.You can then enter "memTrack" at the command line to get info on a per taskbasis about memory used.<br>Use at your own risk :)<br><br><a href="findMalloc.c">findMalloc.c</a><br><a href="memTrack.c">memTrack.c</a><hr WIDTH="20%"><a NAME="6.2-A1"></a><p>I found this a couple of years ago.  Check out<A HREF="http://www.snippets.org">http://www.snippets.org</A>and more specifically<A HREF="http://www.snippets.org/snippets/portable/portable.php3">http://www.snippets.org/snippets/portable/portable.php3</A>Here you will find Walter Bright's memory allocation debugging package.His stuff was not written for vxWorks, but I think it would berelatively easy (a couple of hours, max) to port.<br>(From: Don Small, dmsmall@sandia.gov)<p><hr WIDTH="60%"><p><h3><a NAME="6.3"><center>6.3 Corba engines</center></a></h3><a NAME="6.3-A"></a>Q: Where can I find a Corba engine that runs under VxWorks?<p>A: The following links were given in the newsgroup as being available forVxWorks:<ul><li><a href="http://www.cs.wustl.edu/~schmidt/TAO.html">http://www.cs.wustl.edu/~schmidt/TAO.html</a>:<blockquote>TAO is open source software that is compliant with most features and componentsin the latest CORBA 2.2 and 2.3 specifications. TAO can be downloaded from theInternet and freely used and redistributed without developer or run-timelicensing costs. Commercial support, documentation, training, and consultingfor TAO are available from OCI.</blockquote></li><blockquote>Instructions on how to build ACE can be found here: <a href="http://www.gum.de/it/download_documents.htm">http://www.gum.de/it/download_documents.htm</a>.</blockquote><li><a href="http://www-b0.fnal.gov:8000/ROBIN/">http://www-b0.fnal.gov:8000/ROBIN/</a>:<blockquote>ROBIN is a freeware distributed object system based on CORBA 2.1, written byJim Pangburn with a great start from Ryan Pierce. It has additional support for:<ul><li>Remote Procedure Calls defined in IDL</li><li>Load-balancing</li><li>Redundancy (virtual synchrony model),</li></ul></blockquote></li></ul>The following page gives a more complete list of links to free implementationsof CORBA (and also to commercial / not-free implementations):<ul><li><a href="http://adams.patriot.net/~tvalesky/freecorba.html">http://adams.patriot.net/~tvalesky/freecorba.html</a></li></ul><p><hr WIDTH="60%"><p><h3><a NAME="6.4"><center>6.4 Web servers</center></a></h3><a NAME="6.4-A"></a>Q: What web servers are available?<p>A: The following web servers are available for free:<ul><li><a href="http://www.goahead.com/webserver/">http://www.goahead.com/webserver</a></li><li>From Marc S. Yaxley (ohmy-gosh@home.com) <a href="VxHttp.c">VxHttp.c</a>,based on the VxHttp.c as provided on the VxHack site</li></ul><p><hr WIDTH="50%"><a NAME="6.4-B"></a><p>Q: I have written a simple Http Server but it "sleeps" for a periodbetween 30 sec to 1 min after 12 requests, and it begins to response againafter that.<p>A: The sockets used by the web server (yours, WindRivers, GoAhead's) willstay 'alive' for up to three minutes after you have closed the connection waiting for tardy packets. <br>All part of the RFC. Recall, VxWorks is still supporting TCP/IP on 68000 machines with as little as 1 MB of RAM! But read the following WindRiver texton how to improve this.<blockquote><h4>Recommended VxWorks configuration</h4>The default configuration for VxWorks board support packages is adequatefor normal development work, but does not adequately support the networktraffic required when running a network application such as a browser.<br>The following changes are recommended in your VxWorks configuration using the Tornado project facility.<ul><li>In the following selection:network components -&gt; basic network initialization components -&gt;network buffer initialization :<br>Set the parameters to their new values to increase the number of network buffers in the TCP/IP stack:<p><TABLE BORDER=0 CELLSPACING=0><TR><TD VALIGN=TOP>Parameter</TD><TD>Value</TD></TR><TR><TD VALIGN=TOP>NUM_NET_MBLKS&nbsp;</TD><TD VALIGN=TOP>800</TD></TR><TR><TD VALIGN=TOP>NUM_64</TD><TD VALIGN=TOP>256</TD></TR><TR><TD VALIGN=TOP>NUM_128</TD><TD VALIGN=TOP>256</TD></TR><TR><TD VALIGN=TOP>NUM_256</TD><TD VALIGN=TOP>256</TD></TR><TR><TD VALIGN=TOP>NUM_512</TD><TD VALIGN=TOP>128</TD></TR><TR><TD VALIGN=TOP>NUM_1024</TD><TD VALIGN=TOP>100</TD></TR><TR><TD VALIGN=TOP>NUM_2048</TD><TD VALIGN=TOP>100</TD></TR><TR><TD VALIGN=TOP>NUM_SYS_64</TD><TD VALIGN=TOP>160</TD></TR><TR><TD VALIGN=TOP>NUM_SYS_128</TD><TD VALIGN=TOP>160</TD></TR><TR><TD VALIGN=TOP>NUM_SYS_256</TD><TD VALIGN=TOP>160</TD></TR><TR><TD VALIGN=TOP>NUM_SYS_512</TD><TD VALIGN=TOP>160</TD></TR></TABLE>Ensure that NUM_SYS_CL_BLKS is set to (NUM_SYS_64 + NUM_SYS_128 +NUM_SYS_256 + NUM_SYS_512). This should be the default.</li><li>In the following selection:network components -&gt; network protocols -&gt;core TCP/IP components -&gt; TCPv4 :<br>Set TCP_RCV_SIZE_DFLT to 16384 to increase the size of the receive buffer of a TCP connection.</li><li>In the following selections:operating system components -&gt; IO system components -&gt; IO system -&gt;network components -&gt; networking protocols -&gt; core TCP/IP components -&gt;BSD SOCKET :<br>Set NUM_FILES to at least 150 to increase the number of socket filedescriptors.</li></ul></blockquote>See also <TD VALIGN=TOP><A HREF="vxw_pt4.html#4.6-B">4.6-B</A></TD><p><hr WIDTH="60%"><p><h3><a NAME="6.5"><center>6.5 NTP usage</center></a></h3><a NAME="6.5-A"></a>Q: How do I synchronise time using NTP?<p>A: Use the following code in your usrAppInit:<pre>    /* initialize clock */    {       struct timespec tspec;       STATUS sntpc_status;       sntpc_status = sntpcTimeGet(NTP_SERVER_IP, WAIT_FOREVER, &amp;tspec);       if (sntpc_status ==  ERROR)           printf("sntpcTimeGet returned ERROR.\n");       else           clock_settime(CLOCK_REALTIME, &amp;tspec);    }</pre><br>(From: Jeremey Barrett, jeremey@terisa.com)<p>Two comments from Leonid Rosenboim (leonid@bitband.com) about thisprogram:<ol><li>The infinite timeout is not such a good idea ... can't allow a machine to fail boot if the time server called in sick...</li><li>If your application needs a correct time and date, this just wontcompensate for a rather significant drift of the interrupt-generated clock, you must re-sync the clock "every so often"...</li></ol><p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -