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

📄 setup-i386-pc.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>i386 PC Hardware Setup</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos User Guide"HREF="ecos-user-guide.html"><LINKREL="UP"TITLE="Target Setup"HREF="appendix-target-setup.html"><LINKREL="PREVIOUS"TITLE="NEC CEB-V850/SB1 Hardware Setup"HREF="setup-v850-cebsb1.html"><LINKREL="NEXT"TITLE="i386/Linux Synthetic Target Setup"HREF="setup-synth-i386linux.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos User Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="setup-v850-cebsb1.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Appendix A. Target Setup</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="setup-synth-i386linux.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="SETUP-I386-PC">i386 PC Hardware Setup</H1><P>eCos application on the PC can be run in three ways: via RedBoot,loaded directly from a floppy disk, or loaded by the GRUB bootloader.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4408">RedBoot Support</H2><P>For information about setting up the PC to run with RedBoot,consult the RedBoot User&quot;s Guide. If using serial debugging,the serial line runs at 38400 baud 8-N-1 and should be connectedto the debug host using a null modem cable. If ethernet debuggingis required, an i82559 compatible network interface card, such asan Intel EtherExpress Pro 10/100,  should be installedon the target PC and connected to the development PC running GDB.When RedBoot is configured appropriately to have an IP address set,then GDB will be able to debug directly over TCP/IP to thetarget PC.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4411">Floppy Disk Support</H2><P>If an application is built with a startup type of FLOPPY, then it isconfigured to be a self-booting image that must be written onto aformatted floppy disk. This will erase any existing file system ordata that is already on the disk, so proceedwith caution.</P><P>To write an application to floppy disk, it must first be converted toa pure binary format. This is done with the following command:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>i386-elf-objcopy -O binary app.elf app.bin</B></TT></PRE></TD></TR></TABLE><P>Here <TTCLASS="FILENAME">app.elf</TT> is the final linked applicationexecutable, in ELF format (it may not have a <TTCLASS="FILENAME">.elf</TT>extension). The file <TTCLASS="FILENAME">app.bin</TT> is the resultingpure binary file. This must be written to the floppy disk with thefollowing command:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>dd conv=sync if=app.bin of=/dev/fd0</B></TT></PRE></TD></TR></TABLE></P><P>For NT Cygwin users, this can be done by first ensuring that the rawfloppy device is mounted as <TTCLASS="FILENAME">/dev/fd0</TT>. To check if thisis the case, type the command <BCLASS="COMMAND">mount</B> at the Cygwin bashprompt. If the floppy drive is already mounted, it will be listed as somethingsimilar to the following line:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">  \\.\a: /dev/fd0 user binmode</PRE></TD></TR></TABLE><P>If this line is not listed, then mount the floppy drive using the command:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>mount -f -b //./a: /dev/fd0</B></TT></PRE></TD></TR></TABLE><P>To actually install the boot image on the floppy, use the command:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>dd conv=sync if=app.bin of=/dev/fd0</B></TT></PRE></TD></TR></TABLE><P>Insert this floppy in the A: drive of the PC to be used as a targetand ensure that the BIOS is configured to boot from A: by default. On reset,the PC will boot from the floppy and the eCos application will loaditself and execute immediately.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>NOTE: </B>Unreliable floppy media may cause the write to silently fail. Thiscan be determined if the RedBoot image does not correctlyboot. In such cases, the floppy should be (unconditionally) reformattedusing the <BCLASS="COMMAND">fdformat</B> command on Linux, or<BCLASS="COMMAND">format a: /u</B> on DOS/Windows. If this fails, try adifferent disk.</P></BLOCKQUOTE></DIV></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4439">GRUB Bootloader Support</H2><P>If an application is built with the GRUB startup type, it isconfigured to be loaded by the GRUB bootloader.</P><P>GRUB is an open source boot loader that supports many differentoperating systems. It is available from<AHREF="http://www.gnu.org/software/grub"TARGET="_top">http://www.gnu.org/software/grub</A>.The latest version of GRUB should be downloaded from there and installed.In Red Hat Linux version 7.2 and later it is the default bootloaderfor Linux and therefore is already installed.</P><P>To install GRUB on a floppy disk from Linux you need to execute thefollowing commands:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">$ <TTCLASS="USERINPUT"><B>mformat a:</B></TT>$ <TTCLASS="USERINPUT"><B>mount /mnt/floppy</B></TT>$ <TTCLASS="USERINPUT"><B>grub-install --root-directory=/mnt/floppy '(fd0)'</B></TT>Probing devices to guess BIOS drives. This may take a long time.Installation finished. No error reported.This is the contents of the device map /mnt/floppy/boot/grub/device.map.Check if this is correct or not. If any of the lines is incorrect,fix it and re-run the script `grub-install'.(fd0)	/dev/fd0$ <TTCLASS="USERINPUT"><B>cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub</B></TT>$ <TTCLASS="USERINPUT"><B>umount /mnt/floppy</B></TT></PRE></TD></TR></TABLE><P>The file <TTCLASS="FILENAME">menu.lst</TT> is an example GRUB menuconfiguration file. It contains menu items to load some of thestandard eCos tests from floppy or from partition zero of the firsthard disk. You should, of course, customize this file to load your ownapplication. Alternatively you can use the command-line interface ofGRUB to input commands yourself.</P><P>Applications can be installed, or updated simply by copying them tothe floppy disk at the location expected by the<TTCLASS="FILENAME">menu.lst</TT> file. For booting from floppy disks itis recommended that the executable be stripped of all debug and symboltable information before copying. This reduces the size of the fileand can make booting faster.</P><P>To install GRUB on a hard disk, refer to the GRUB documentation. Bewarned, however, that if you get this wrong it may compromise anyexisting bootloader that exists on the hard disk and may make anyother operating systems unbootable. Practice on floppy disks orsacrificial hard disks first. On machines running Red Hat Linuxversion 7.2 and later, you can just add your own menu items to the<TTCLASS="FILENAME">/boot/grub/menu.lst</TT> file that already exists.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN4457">Debugging FLOPPY and GRUB Applications</H2><P>When RedBoot loads an application it also provides debugging servicesin the form of GDB remote protocol stubs. When an application isloaded stand-alone from a floppy disk, or by GRUB, these services arenot present. To allow these application to be debugged, it is possibleto include GDB stubs into the application.</P><P>To do this, set the &quot;Support for GDB stubs&quot;(<TTCLASS="LITERAL">CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT>) configurationoption. Following this any application built will allow GDB to connectto the debug serial port (by default serial device 0, also known asCOM1) whenever the application takes an exception, or if a Control-Cis typed to the debug port. Ethernet debugging is not supported.</P><P>The option &quot;Enable initial breakpoint&quot;(<TTCLASS="LITERAL">CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK</TT>) causes the HALto take a breakpoint immediately before calling cyg_start(). Thisgives the developer a chance to set any breakpoints or inspect thesystem state before it proceeds. The configuration sets this option bydefault if GDB stubs are included, and this is not a RedBoot build. Tomake the application execute immediately either disable this option,or disable <TTCLASS="LITERAL">CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT>.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="setup-v850-cebsb1.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-user-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="setup-synth-i386linux.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">NEC CEB-V850/SB1 Hardware Setup</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="appendix-target-setup.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">i386/Linux Synthetic Target Setup</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

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