1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >i386 PC Hardware Setup</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos User Guide"
20 HREF="ecos-user-guide.html"><LINK
23 HREF="appendix-target-setup.html"><LINK
25 TITLE="NEC CEB-V850/SB1 Hardware Setup"
26 HREF="setup-v850-cebsb1.html"><LINK
28 TITLE="i386/Linux Synthetic Target Setup"
29 HREF="setup-synth-i386linux.html"></HEAD
40 SUMMARY="Header navigation table"
57 HREF="setup-v850-cebsb1.html"
65 >Appendix A. Target Setup</TD
71 HREF="setup-synth-i386linux.html"
85 NAME="SETUP-I386-PC">i386 PC Hardware Setup</H1
87 >eCos application on the PC can be run in three ways: via RedBoot,
88 loaded directly from a floppy disk, or loaded by the GRUB bootloader.</P
94 NAME="AEN4408">RedBoot Support</H2
96 >For information about setting up the PC to run with RedBoot,
97 consult the RedBoot User"s Guide. If using serial debugging,
98 the serial line runs at 38400 baud 8-N-1 and should be connected
99 to the debug host using a null modem cable. If ethernet debugging
100 is required, an i82559 compatible network interface card, such as
101 an Intel EtherExpress Pro 10/100, should be installed
102 on the target PC and connected to the development PC running GDB.
103 When RedBoot is configured appropriately to have an IP address set,
104 then GDB will be able to debug directly over TCP/IP to the
112 NAME="AEN4411">Floppy Disk Support</H2
114 >If an application is built with a startup type of FLOPPY, then it is
115 configured to be a self-booting image that must be written onto a
116 formatted floppy disk. This will erase any existing file system or
117 data that is already on the disk, so proceed
120 >To write an application to floppy disk, it must first be converted to
121 a pure binary format. This is done with the following command:</P
133 >i386-elf-objcopy -O binary app.elf app.bin</B
143 > is the final linked application
144 executable, in ELF format (it may not have a <TT
148 extension). The file <TT
152 pure binary file. This must be written to the floppy disk with the
165 >dd conv=sync if=app.bin of=/dev/fd0</B
173 >For NT Cygwin users, this can be done by first ensuring that the raw
174 floppy device is mounted as <TT
178 is the case, type the command <B
182 prompt. If the floppy drive is already mounted, it will be listed as something
183 similar to the following line:</P
192 > \\.\a: /dev/fd0 user binmode</PRE
197 >If this line is not listed, then mount the floppy drive using the command:</P
209 >mount -f -b //./a: /dev/fd0</B
216 >To actually install the boot image on the floppy, use the command:</P
228 >dd conv=sync if=app.bin of=/dev/fd0</B
235 >Insert this floppy in the A: drive of the PC to be used as a target
236 and ensure that the BIOS is configured to boot from A: by default. On reset,
237 the PC will boot from the floppy and the eCos application will load
238 itself and execute immediately.</P
246 >Unreliable floppy media may cause the write to silently fail. This
247 can be determined if the RedBoot image does not correctly
248 boot. In such cases, the floppy should be (unconditionally) reformatted
252 > command on Linux, or
256 > on DOS/Windows. If this fails, try a
266 NAME="AEN4439">GRUB Bootloader Support</H2
268 >If an application is built with the GRUB startup type, it is
269 configured to be loaded by the GRUB bootloader.</P
271 >GRUB is an open source boot loader that supports many different
272 operating systems. It is available from
274 HREF="http://www.gnu.org/software/grub"
276 >http://www.gnu.org/software/grub</A
278 The latest version of GRUB should be downloaded from there and installed.
279 In Red Hat Linux version 7.2 and later it is the default bootloader
280 for Linux and therefore is already installed.</P
282 >To install GRUB on a floppy disk from Linux you need to execute the
283 following commands:</P
301 >mount /mnt/floppy</B
307 >grub-install --root-directory=/mnt/floppy '(fd0)'</B
310 Probing devices to guess BIOS drives. This may take a long time.
311 Installation finished. No error reported.
312 This is the contents of the device map /mnt/floppy/boot/grub/device.map.
313 Check if this is correct or not. If any of the lines is incorrect,
314 fix it and re-run the script `grub-install'.
320 >cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub</B
326 >umount /mnt/floppy</B
336 > is an example GRUB menu
337 configuration file. It contains menu items to load some of the
338 standard eCos tests from floppy or from partition zero of the first
339 hard disk. You should, of course, customize this file to load your own
340 application. Alternatively you can use the command-line interface of
341 GRUB to input commands yourself.</P
343 >Applications can be installed, or updated simply by copying them to
344 the floppy disk at the location expected by the
348 > file. For booting from floppy disks it
349 is recommended that the executable be stripped of all debug and symbol
350 table information before copying. This reduces the size of the file
351 and can make booting faster.</P
353 >To install GRUB on a hard disk, refer to the GRUB documentation. Be
354 warned, however, that if you get this wrong it may compromise any
355 existing bootloader that exists on the hard disk and may make any
356 other operating systems unbootable. Practice on floppy disks or
357 sacrificial hard disks first. On machines running Red Hat Linux
358 version 7.2 and later, you can just add your own menu items to the
361 >/boot/grub/menu.lst</TT
362 > file that already exists.</P
369 NAME="AEN4457">Debugging FLOPPY and GRUB Applications</H2
371 >When RedBoot loads an application it also provides debugging services
372 in the form of GDB remote protocol stubs. When an application is
373 loaded stand-alone from a floppy disk, or by GRUB, these services are
374 not present. To allow these application to be debugged, it is possible
375 to include GDB stubs into the application.</P
377 >To do this, set the "Support for GDB stubs"
380 >CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT
382 option. Following this any application built will allow GDB to connect
383 to the debug serial port (by default serial device 0, also known as
384 COM1) whenever the application takes an exception, or if a Control-C
385 is typed to the debug port. Ethernet debugging is not supported.</P
387 >The option "Enable initial breakpoint"
390 >CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK</TT
392 to take a breakpoint immediately before calling cyg_start(). This
393 gives the developer a chance to set any breakpoints or inspect the
394 system state before it proceeds. The configuration sets this option by
395 default if GDB stubs are included, and this is not a RedBoot build. To
396 make the application execute immediately either disable this option,
399 >CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT
408 SUMMARY="Footer navigation table"
419 HREF="setup-v850-cebsb1.html"
428 HREF="ecos-user-guide.html"
437 HREF="setup-synth-i386linux.html"
447 >NEC CEB-V850/SB1 Hardware Setup</TD
453 HREF="appendix-target-setup.html"
461 >i386/Linux Synthetic Target Setup</TD