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

📄 x-vxsim4.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title>    VxSim   </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-vxsim.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-vxsim3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-vxsim5.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="84622">H.4  &nbsp;&nbsp;Architecture Considerations</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84623"> </a>The information in this section highlights differences between VxSim (both the built-in and optional versions) and other VxWorks BSPs. These differences should be taken into consideration as you develop applications on VxSim that will eventually be ported to another target architecture.</p><dd><p class="Body"><a name="84624"> </a>VxSim uses the VxWorks scheduler, which behaves the same way as for any other VxWorks architecture (see <a href="c-basic.html#83550"><i class="title">2.&nbsp;Basic OS</i></a>). The BSP is extensible; for example, pseudo-drivers can be written for additional timers, serial drivers, and so forth.</p><dd><p class="Body"><a name="84628"> </a>The rest of this section discusses some details of the VxSim implementation. Differences between VxSim and other VxWorks environments are noted where appropriate.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84629">Supported Configurations</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84630"> </a>Most of the optional features and device drivers for VxWorks are supported by VxSim. The few that are not are hardware devices (SCSI, Ethernet), and ROM configurations, and so on. The BSP makefile builds only the images <b class="file">vxWorks</b> and <b class="file">vxWorks.st</b> (standalone VxWorks).</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84631">The BSP Directory</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84632"> </a>Aside from the following exceptions, the VxSim BSP is the same as a VxWorks BSP:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84633"> </a>The <b class="file">sysLib.c</b> module contains the same essential functions: <b class="routine"><i class="routine">sysModel</i></b><b>(</b>&nbsp;<b>)</b>, <b class="routine"><i class="routine">sysHwInit</i></b><b>(</b>&nbsp;<b>)</b>, and <b class="routine"><i class="routine">sysClkConnect</i></b><b>(</b>&nbsp;<b>)</b> through <b class="routine"><i class="routine">sysNvRamSet</i></b><b>(</b>&nbsp;<b>)</b>. Because there is no bus, <b class="routine"><i class="routine">sysBusToLocalAdrs</i></b><b>(</b>&nbsp;<b>)</b> and related functions have no effect.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84634"> </a><b class="file">tyCoDrv.c</b> ultimately calls host <b class="routine"><i class="routine">read</i></b><b>(</b>&nbsp;<b>)</b> and <b class="routine"><i class="routine">write</i></b><b>(</b>&nbsp;<b>)</b> routines on the process's true standard input and output. But all the "driver" functions and <b class="file">tyLib.c</b> are intact. </li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84635"> </a>The configuration header<b class="file"> config.h</b> is minimal:</li></ul></p><dl class="margin"><p class="listspace"><ul class="Dash2" type="circle"><li><a name="84636"> </a>It does not reference a <i class="textVariable">bspname</i><b class="file">.h</b> file.</li></ul></p><p class="listspace"><ul class="Dash2" type="circle"><li><a name="84637"> </a>Most network devices are excluded.</li></ul></p><p class="listspace"><ul class="Dash2" type="circle"><li><a name="84638"> </a>The boot line has no fixed memory location. Instead, it is stored in the variable <b class="routine"><i class="routine">sysBootLine</i></b> in <b class="file">sysLib.c</b>.</li></ul></p></dl><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84639"> </a>The <b class="file">Makefile</b> is the standard version for VxWorks BSPs. It does not build boot ROM images (although the makefile rules remain intact); it can only build <b class="file">vxWorks</b> and <b class="file">vxWorks.st</b> (standalone) images. The final linking does not arrange for the TEXT segment to be loaded at a fixed area in RAM, but follows the usual loading model. The makefile macro <b class="symbol_UC">MACH_EXTRA</b> is provided so that users can easily link their application modules into the VxWorks image if they are using manual build methods.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84640"> </a>The BSP file <b class="file">sysLib.c</b> can be extended to emulate the eventual target hardware more completely. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84643">Interrupts</a></i></h4></font><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="84644">Solaris and HP-UX</a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="84645"> </a>Host signals are used to simulate hardware interrupts. For example, VxSim uses the <b class="symbol_UC">SIGALRM</b> signal to simulate system clock interrupts, the <b class="symbol_UC">SIGPROF</b> signal for the auxiliary clock, and the <b class="symbol_UC">SIGVTALRM</b> signal for virtual timer interrupts. Furthermore, all host file descriptors (such as standard input) are put in asynchronous mode, so that the <b class="symbol_UC">SIGIO</b> signal is sent to VxSim when data becomes ready. The signal handlers are the VxSim equivalent to Interrupt Service Routines (ISRs) on other VxWorks targets.</p><dd><p class="Body"><a name="84646"> </a>You can install ISRs in VxSim to handle these "interrupts." Not all VxWorks functions can be called from ISRs; see <a href="c-basic.html#83550"><i class="title">2.&nbsp;Basic OS</i></a>.</p><dd><p class="Body"><a name="84650"> </a>To run ISR code during a future system clock interrupt, use the watchdog timer facilities. To run ISR code during auxiliary clock interrupts, use the <b class="routine"><i class="routine">sysAuxClk</i></b><i class="textVariable">xxx</i><b>(&nbsp;)</b> functions.</p><dd><p class="Body"><a name="84672"> </a><a href="x-vxsim4.html#84657">Table&nbsp;H-2</a> shows how the interrupt vector table is set up.<p class="table"><h4 class="EntityTitle"><a name="84657"><font face="Helvetica, sans-serif" size="-1" class="sans">Table H-2:&nbsp;&nbsp;Interrupt Assignments</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84661"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Interrupts</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84663"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Assigned To</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84665"> </a>1-32&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84667"> </a>host signals&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84669"> </a>33-64&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84671"> </a>host file descriptors 1-32 (<b class="symbol_UC">SIGIO</b>)&nbsp;</div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p><dd><p class="Body"><a name="84673"> </a>Pseudo-drivers can be created to use these interrupts. Interrupt code must be connected with the standard VxWorks <b class="routine"><i class="routine">intConnect</i></b><b>(</b>&nbsp;<b>)</b> mechanism. </p><dd><p class="Body"><a name="84674"> </a>For example, to install an ISR that logs a message whenever host signal <b class="routine"><i class="routine">SIGUSR2</i></b> arrives, execute the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="84675"></b><tt class="output">-&gt; </tt><b>intConnect (31, logMsg, "Help!\n")</a></b></pre></dl><dd><p class="Body"><a name="84676"> </a>Then send signal 31 to VxSim from a host task, for example using the host <b class="command">kill</b> command. Every time the signal is received, the ISR (<b class="routine"><i class="routine">logMsg</i></b><b>(&nbsp;)</b> in this case) runs.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="84681"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION:  </font></b></a>Do not use the preprocessor constants <b class="symbol_UC">SIGUSR1</b> or <b class="symbol_UC">SIGUSR2</b> for this purpose in VxWorks applications, since those constants evaluate to the VxWorks definitions for these signals. You need to specify your host's signal numbers instead.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr>

⌨️ 快捷键说明

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