OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [user-guide/] [setup-i386-pc.html] - Blame information for rev 646

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 unneback
<!-- 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.               -->
9
<HTML
10
><HEAD
11
><TITLE
12
>i386 PC Hardware Setup</TITLE
13
><meta name="MSSmartTagsPreventParsing" content="TRUE">
14
<META
15
NAME="GENERATOR"
16
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17
"><LINK
18
REL="HOME"
19
TITLE="eCos User Guide"
20
HREF="ecos-user-guide.html"><LINK
21
REL="UP"
22
TITLE="Target Setup"
23
HREF="appendix-target-setup.html"><LINK
24
REL="PREVIOUS"
25
TITLE="NEC CEB-V850/SB1 Hardware Setup"
26
HREF="setup-v850-cebsb1.html"><LINK
27
REL="NEXT"
28
TITLE="i386/Linux Synthetic Target Setup"
29
HREF="setup-synth-i386linux.html"></HEAD
30
><BODY
31
CLASS="SECT1"
32
BGCOLOR="#FFFFFF"
33
TEXT="#000000"
34
LINK="#0000FF"
35
VLINK="#840084"
36
ALINK="#0000FF"
37
><DIV
38
CLASS="NAVHEADER"
39
><TABLE
40
SUMMARY="Header navigation table"
41
WIDTH="100%"
42
BORDER="0"
43
CELLPADDING="0"
44
CELLSPACING="0"
45
><TR
46
><TH
47
COLSPAN="3"
48
ALIGN="center"
49
>eCos User Guide</TH
50
></TR
51
><TR
52
><TD
53
WIDTH="10%"
54
ALIGN="left"
55
VALIGN="bottom"
56
><A
57
HREF="setup-v850-cebsb1.html"
58
ACCESSKEY="P"
59
>Prev</A
60
></TD
61
><TD
62
WIDTH="80%"
63
ALIGN="center"
64
VALIGN="bottom"
65
>Appendix A. Target Setup</TD
66
><TD
67
WIDTH="10%"
68
ALIGN="right"
69
VALIGN="bottom"
70
><A
71
HREF="setup-synth-i386linux.html"
72
ACCESSKEY="N"
73
>Next</A
74
></TD
75
></TR
76
></TABLE
77
><HR
78
ALIGN="LEFT"
79
WIDTH="100%"></DIV
80
><DIV
81
CLASS="SECT1"
82
><H1
83
CLASS="SECT1"
84
><A
85
NAME="SETUP-I386-PC">i386 PC Hardware Setup</H1
86
><P
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
89
><DIV
90
CLASS="SECT2"
91
><H2
92
CLASS="SECT2"
93
><A
94
NAME="AEN4408">RedBoot Support</H2
95
><P
96
>For information about setting up the PC to run with RedBoot,
97
consult the RedBoot User&quot;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
105
target PC.</P
106
></DIV
107
><DIV
108
CLASS="SECT2"
109
><H2
110
CLASS="SECT2"
111
><A
112
NAME="AEN4411">Floppy Disk Support</H2
113
><P
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
118
with caution.</P
119
><P
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
122
><TABLE
123
BORDER="5"
124
BGCOLOR="#E0E0F0"
125
WIDTH="70%"
126
><TR
127
><TD
128
><PRE
129
CLASS="SCREEN"
130
>$ <TT
131
CLASS="USERINPUT"
132
><B
133
>i386-elf-objcopy -O binary app.elf app.bin</B
134
></TT
135
></PRE
136
></TD
137
></TR
138
></TABLE
139
><P
140
>Here <TT
141
CLASS="FILENAME"
142
>app.elf</TT
143
> is the final linked application
144
executable, in ELF format (it may not have a <TT
145
CLASS="FILENAME"
146
>.elf</TT
147
>
148
extension). The file <TT
149
CLASS="FILENAME"
150
>app.bin</TT
151
> is the resulting
152
pure binary file. This must be written to the floppy disk with the
153
following command:
154
<TABLE
155
BORDER="5"
156
BGCOLOR="#E0E0F0"
157
WIDTH="70%"
158
><TR
159
><TD
160
><PRE
161
CLASS="SCREEN"
162
>$ <TT
163
CLASS="USERINPUT"
164
><B
165
>dd conv=sync if=app.bin of=/dev/fd0</B
166
></TT
167
></PRE
168
></TD
169
></TR
170
></TABLE
171
></P
172
><P
173
>For NT Cygwin users, this can be done by first ensuring that the raw
174
floppy device is mounted as <TT
175
CLASS="FILENAME"
176
>/dev/fd0</TT
177
>. To check if this
178
is the case, type the command <B
179
CLASS="COMMAND"
180
>mount</B
181
> at the Cygwin bash
182
prompt. If the floppy drive is already mounted, it will be listed as something
183
similar to the following line:</P
184
><TABLE
185
BORDER="5"
186
BGCOLOR="#E0E0F0"
187
WIDTH="70%"
188
><TR
189
><TD
190
><PRE
191
CLASS="SCREEN"
192
>  \\.\a: /dev/fd0 user binmode</PRE
193
></TD
194
></TR
195
></TABLE
196
><P
197
>If this line is not listed, then mount the floppy drive using the command:</P
198
><TABLE
199
BORDER="5"
200
BGCOLOR="#E0E0F0"
201
WIDTH="70%"
202
><TR
203
><TD
204
><PRE
205
CLASS="SCREEN"
206
>$ <TT
207
CLASS="USERINPUT"
208
><B
209
>mount -f -b //./a: /dev/fd0</B
210
></TT
211
></PRE
212
></TD
213
></TR
214
></TABLE
215
><P
216
>To actually install the boot image on the floppy, use the command:</P
217
><TABLE
218
BORDER="5"
219
BGCOLOR="#E0E0F0"
220
WIDTH="70%"
221
><TR
222
><TD
223
><PRE
224
CLASS="SCREEN"
225
>$ <TT
226
CLASS="USERINPUT"
227
><B
228
>dd conv=sync if=app.bin of=/dev/fd0</B
229
></TT
230
></PRE
231
></TD
232
></TR
233
></TABLE
234
><P
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
239
><DIV
240
CLASS="NOTE"
241
><BLOCKQUOTE
242
CLASS="NOTE"
243
><P
244
><B
245
>NOTE: </B
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
249
using the <B
250
CLASS="COMMAND"
251
>fdformat</B
252
> command on Linux, or
253
<B
254
CLASS="COMMAND"
255
>format a: /u</B
256
> on DOS/Windows. If this fails, try a
257
different disk.</P
258
></BLOCKQUOTE
259
></DIV
260
></DIV
261
><DIV
262
CLASS="SECT2"
263
><H2
264
CLASS="SECT2"
265
><A
266
NAME="AEN4439">GRUB Bootloader Support</H2
267
><P
268
>If an application is built with the GRUB startup type, it is
269
configured to be loaded by the GRUB bootloader.</P
270
><P
271
>GRUB is an open source boot loader that supports many different
272
operating systems. It is available from
273
<A
274
HREF="http://www.gnu.org/software/grub"
275
TARGET="_top"
276
>http://www.gnu.org/software/grub</A
277
>.
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
281
><P
282
>To install GRUB on a floppy disk from Linux you need to execute the
283
following commands:</P
284
><TABLE
285
BORDER="5"
286
BGCOLOR="#E0E0F0"
287
WIDTH="70%"
288
><TR
289
><TD
290
><PRE
291
CLASS="SCREEN"
292
>$ <TT
293
CLASS="USERINPUT"
294
><B
295
>mformat a:</B
296
></TT
297
>
298
$ <TT
299
CLASS="USERINPUT"
300
><B
301
>mount /mnt/floppy</B
302
></TT
303
>
304
$ <TT
305
CLASS="USERINPUT"
306
><B
307
>grub-install --root-directory=/mnt/floppy '(fd0)'</B
308
></TT
309
>
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'.
315
 
316
(fd0)   /dev/fd0
317
$ <TT
318
CLASS="USERINPUT"
319
><B
320
>cp $ECOS_REPOSITORY/packages/hal/i386/pc/current/misc/menu.lst /mnt/floppy/boot/grub</B
321
></TT
322
>
323
$ <TT
324
CLASS="USERINPUT"
325
><B
326
>umount /mnt/floppy</B
327
></TT
328
></PRE
329
></TD
330
></TR
331
></TABLE
332
><P
333
>The file <TT
334
CLASS="FILENAME"
335
>menu.lst</TT
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
342
><P
343
>Applications can be installed, or updated simply by copying them to
344
the floppy disk at the location expected by the
345
<TT
346
CLASS="FILENAME"
347
>menu.lst</TT
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
352
><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
359
<TT
360
CLASS="FILENAME"
361
>/boot/grub/menu.lst</TT
362
> file that already exists.</P
363
></DIV
364
><DIV
365
CLASS="SECT2"
366
><H2
367
CLASS="SECT2"
368
><A
369
NAME="AEN4457">Debugging FLOPPY and GRUB Applications</H2
370
><P
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
376
><P
377
>To do this, set the &quot;Support for GDB stubs&quot;
378
(<TT
379
CLASS="LITERAL"
380
>CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT
381
>) configuration
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
386
><P
387
>The option &quot;Enable initial breakpoint&quot;
388
(<TT
389
CLASS="LITERAL"
390
>CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK</TT
391
>) causes the HAL
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,
397
or disable <TT
398
CLASS="LITERAL"
399
>CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS</TT
400
>.</P
401
></DIV
402
></DIV
403
><DIV
404
CLASS="NAVFOOTER"
405
><HR
406
ALIGN="LEFT"
407
WIDTH="100%"><TABLE
408
SUMMARY="Footer navigation table"
409
WIDTH="100%"
410
BORDER="0"
411
CELLPADDING="0"
412
CELLSPACING="0"
413
><TR
414
><TD
415
WIDTH="33%"
416
ALIGN="left"
417
VALIGN="top"
418
><A
419
HREF="setup-v850-cebsb1.html"
420
ACCESSKEY="P"
421
>Prev</A
422
></TD
423
><TD
424
WIDTH="34%"
425
ALIGN="center"
426
VALIGN="top"
427
><A
428
HREF="ecos-user-guide.html"
429
ACCESSKEY="H"
430
>Home</A
431
></TD
432
><TD
433
WIDTH="33%"
434
ALIGN="right"
435
VALIGN="top"
436
><A
437
HREF="setup-synth-i386linux.html"
438
ACCESSKEY="N"
439
>Next</A
440
></TD
441
></TR
442
><TR
443
><TD
444
WIDTH="33%"
445
ALIGN="left"
446
VALIGN="top"
447
>NEC CEB-V850/SB1 Hardware Setup</TD
448
><TD
449
WIDTH="34%"
450
ALIGN="center"
451
VALIGN="top"
452
><A
453
HREF="appendix-target-setup.html"
454
ACCESSKEY="U"
455
>Up</A
456
></TD
457
><TD
458
WIDTH="33%"
459
ALIGN="right"
460
VALIGN="top"
461
>i386/Linux Synthetic Target Setup</TD
462
></TR
463
></TABLE
464
></DIV
465
></BODY
466
></HTML
467
>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.