📄 gettingstarted4.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Getting Started </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><a href="gettingStarted.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="gettingStarted3.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="binding.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="95076">2.4 Socket Layer Options for the pc386 and pc486 BSPs</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="95079"> </a>For the pc386 and pc486 BSPs, you have the option of including a fully functional PCMCIA interface driver that TrueFFS can use to handle its socket layer interface. You can use this PCMCIA driver instead of the PCIC driver. The PCMCIA interface driver is designed to support a wide variety of PC card devices, including flash memory card devices. It supports hot swapping and is careful to check the type of the device in the PCMCIA socket before it sends any commands to the device.<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup> </p><dd><p class="Body"><a name="95519"> </a>Of course, there are situations in which you need some support for PC flash cards but could do without all the services provided by the PCMCIA driver. In such cases, you should use the simple PCIC driver with <b class="file">pc386sysTffs.c</b>. The PCIC driver does not support hot swapping, nor does it check the device type before sending commands to the socket. However, the PCIC code is quite small. </p></dl></dl><dl class="margin"><dd><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><a name="96208"><br></a><img border="0" alt="*" src="icons/note.gif"> </td><td><div class="Note"><hr><b class="symbol_UC">NOTE: </b>It is not necessary to define <b class="symbol_UC">INCLUDE_PCMCIA</b> in order for TrueFFS to use the PCMCIA sockets. The PCIC driver can provide TrueFFS with an interface to that hardware. Likewise, the PCMCIA package does not require TrueFFS (unless you intend to support TrueFFS-managed flash cards in those sockets). <hr></div></td></tr></table></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="95567">2.4.1 Configuring the pc386 and pc486 for TrueFFS and the PCMCIA Driver </a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="95598"> </a>The changes described in <a href="gettingStarted2.html#85369"><i class="title">Changing the Makefile</i></a>, and <a href="gettingStarted2.html#89636"><i class="title">Changing sysTffs.c</i></a>, apply to both the pc386 and pc486 BSPs. However, the changes you must make to <b class="file">config.h</b> and <b class="file">syslib.c</b> differ as described below. </p></dl></dl><dl class="margin"><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="95726">Changing <b class="file">config.h</b> </a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="95727"> </a>If you want to use the simple PCIC driver, follow the instructions in <a href="gettingStarted2.html#88652"><i class="title">Changing config.h</i></a>. To use the PCMCIA driver you will need to modify <b class="file">config.h</b> as described below.</p></dl><dl class="margin"><b class="HU-bullet"><li><a name="95514"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Including TrueFFS Support with the PCMCIA Driver </font></li></b></dl><dl class="margin"><dd><p class="Body"><a name="95351"> </a>The PCMCIA interface driver is a product offering distinct from TrueFFS for Tornado. To include it in VxWorks, you must define <b class="symbol_UC">INCLUDE_PCMCIA </b>in your <b class="file">config.h</b> file. Because this PCMCIA interface driver must support TrueFFS for Tornado, you must also add <b class="symbol_UC">INCLUDE_TFFS</b> to the list of devices that PCMCIA includes. Thus, in addition to defining <b class="symbol_UC">INCLUDE_PCMCIA</b>, your <b class="file">config.h</b> make sure that your <b class="file">config.h</b> also defines the following: </p></dl><dl class="margin"><dd><pre class="Code"><b><a name="95420">#ifdef INCLUDE_PCMCIA #define INCLUDE_TFFS /* include TFFS driver */ #define INCLUDE_ATA /* include ATA driver */ #define INCLUDE_SRAM /* include SRAM driver */ #ifdef INCLUDE_NETWORK #define INCLUDE_ELT /* include 3COM EtherLink III driver */ #endif /* INCLUDE_NETWORK */ #endif /* INCLUDE_PCMCIA */</a></b></pre></dl><dl class="margin"><b class="HU-bullet"><li><a name="95561"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Avoiding Address Conflicts with the DiskOnChip 2000 </font></li></b></dl><dl class="margin"><dd><p class="Body"><a name="95562"> </a>If you are using the M-System DiskOnChip 2000 product, you might run in to address conflicts with the PCMCIA product. To resolve conflict, redefine the CIS macros as follows: </p></dl><dl class="margin"><dd><pre class="Code"><b><a name="95607">#ifdef INCLUDE_TFFS #undef CIS_MEM_START #undef CIS_MEM_STOP #undef CIS_REG_START #undef CIS_REG_STOP #define CIS_MEM_START 0xc8000 /* mapping addr for CIS tuple */ #define CIS_MEM_STOP 0xcbfff #define CIS_REG_START 0xcc000 /* mapping addr for config reg */ #define CIS_REG_STOP 0xccfff #endif /* INCLUDE_TFFS */</a></b></pre></dl><dd><font face="Helvetica, sans-serif" size="-1" class="sans"><h5 class="HU"><i><a name="95744">Changing <b class="file">syslib.c</b> </a></i></h5></font><dl class="margin"><dd><p class="Body"><a name="95985"> </a>If your C: drive is a DiskOnChip 2000 device, and, if you boot from it instead of floppy disk, set the <b class="symbol_lc">sysWarmType</b> global variable to 3. This specifies a warm start from the DiskOnChip 2000 device. To enable rebooting from the TrueFFS flash device, you must change <b class="file">sysLib.c</b> as follows:</p></dl><dl class="margin"><b class="HU-bullet"><li><a name="95991"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Define <b class="symbol_lc">sysWarmTffsDrive</b></font></li></b></dl><dl class="margin"><dd><p class="Body"><a name="95814"> </a>After the declaration of the <b class="symbol_lc">sysWarmAtaDrive</b> variable, add the following: </p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="95817">int sysWarmTffsDrive = SYS_WARM_TFFS_DRIVE; /* TFFS drive 0 (DOC) */</a></b></pre></dl></dl></dl><dl class="margin"><b class="HU-bullet"><li><a name="95819"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Changes to <b class="routine"><i class="routine">sysToMonitor</i></b><b>( )</b></font></li></b></dl><dl class="margin"><dd><p class="Body"><a name="96002"> </a>In the function <b class="routine"><i class="routine">sysToMonitor</i></b><b>( )</b>, find the clause that defines the reboot process for the reboot device ATA. After the <b class="symbol_lc">#endif</b> statement for <b class="symbol_UC">INCLUDE_ATA</b>, add the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="95823">#ifdef INCLUDE_TFFS if (sysWarmType == 3) { IMPORT int dosFsDrvNum; tffsDrv (); /* initialize TFFS */ if (dosFsDrvNum == ERROR) dosFsInit (NUM_DOSFS_FILES); /* initialize DOS-FS */ if (usrTffsConfig (sysWarmTffsDrive, FALSE, "/vxboot/") == ERROR) { printErr ("usrTffsConfig failed.\n"); return (ERROR); } } #endif /* INCLUDE_TFFS */</a></b></pre></dl><dd><p class="Body"><a name="95961"> </a>Search for the lines:</p><dl class="margin"><dd><pre class="Code2"><b><a name="95962">#if (defined (INCLUDE_FD) || defined (INCLUDE_ATA)) if ((sysWarmType == 1) || (sysWarmType == 2))</a></b></pre></dl><dd><p class="Body"><a name="95963"> </a>Replace them with the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="95848">#if (defined(INCLUDE_FD) || defined(INCLUDE_ATA) ||defined(INCLUDE_TFFS)) if ((sysWarmType == 1) || (sysWarmType == 2) || (sysWarmType == 3))</a></b></pre></dl><dd><p class="Body"><a name="95851"> </a>Search for the line: </p><dl class="margin"><dd><pre class="Code2"><b><a name="95853">#endif /* defined (INCLUDE_FD) || defined (INCLUDE_ATA) */</a></b></pre></dl><dd><p class="Body"><a name="95855"> </a>Replace it with the following:</p><dl class="margin"><dd><pre class="Code2"><b><a name="96231">#endif /* (INCLUDE_FD) || (INCLUDE_ATA) || (INCLUDE_TFFS) */</a></b></pre></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="96232">2.4.2 x86 with DiskOnChip 2000 and Two PCMCIA Slots Using <b class="symbol_UC">INCLUDE_PCMCIA</b></a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="96233"> </a>The following instructions show you how to setup and instantiate three TrueFFS devices (a DiskOnChip 2000 and two flash cards in the PCMCIA sockets) for a target using the pc386 or pc486 BSP. All three devices are dedicated entirely to TrueFFS and so each is formatted using <b class="routine"><i class="routine">tffsDevFormat</i></b><b>( )</b>. Notice also that the instructions do not include setting <b class="symbol_UC">INCLUDE_TFFS</b> or <b class="symbol_UC">INCLUDE_DOS</b>. That is because defining <b class="symbol_UC">INCLUDE_PCMCIA</b> implicitly sets those defines for you. <sup><a href="#foot"><b class="FootnoteMarker">2</b></a></sup></p></dl><dl class="margin"><p><ol class="List"><li value="1."><a name="95138"> </a>Edit <b class="file">config.h </b>as described in <a href="gettingStarted4.html#95726"><i class="title">Changing config.h</i></a>. </li></ol></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -