public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Running hello.c on i386
@ 2001-02-06 23:11 Philip Teng
  2001-02-09 12:08 ` Bart Veer
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Teng @ 2001-02-06 23:11 UTC (permalink / raw)
  To: ecos-discuss

I tried to make hello.c using the Makefile given in the /examples.

bash.exe-2.04$ make hello.o
i386-elf-gcc                                     -c -o hello.o -g -Wall
-I//c/us
ers/philip/ecos/stub1_install/include -ffunction-sections
-fdata-sections hello.
c
hello.c:2: stdio.h: No such file or directory
make: *** [hello.o] Error 1

I encountered some errors and I fixed it by adding one more include
path...

bash.exe-2.04$ make hello.o
i386-elf-gcc                                     -c -o hello.o -g -Wall
-I//c/us
ers/philip/ecos/stub1_install/include -I/usr/include -ffunction-sections
-fdata-
sections hello.c
bash.exe-2.04$

The compilation was successful.  The target I used is a PIII machine,
host is Windows NT.  I started up the i386 target using the gdb stub
floppy and run the following:

bash.exe-2.04$ i386-elf-gdb -nw hello.o
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-cygwin --target=i386-elf"...
(gdb) set remotebaud 38400
(gdb) target remote com1
Remote debugging using com1
0x37dc in ?? ()
(gdb) continue
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x37dc in ?? ()

Anyone has any idea why the program hit a stop?

Philip Teng
DSO National Labs
tcheewan@dso.org.sg


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Running hello.c on i386
  2001-02-06 23:11 [ECOS] Running hello.c on i386 Philip Teng
@ 2001-02-09 12:08 ` Bart Veer
  2001-02-11 17:09   ` Teng Chee Wan Philip
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Veer @ 2001-02-09 12:08 UTC (permalink / raw)
  To: tcheewan; +Cc: ecos-discuss

>>>>> "Philip" == Philip Teng <tcheewan@dso.org.sg> writes:

    Philip> I tried to make hello.c using the Makefile given in the /examples.
    Philip> bash.exe-2.04$ make hello.o
    Philip> i386-elf-gcc -c -o hello.o -g -Wall
    Philip> -I//c/users/philip/ecos/stub1_install/include -ffunction-sections
    Philip> -fdata-sections hello.c
    Philip> hello.c:2: stdio.h: No such file or directory
    Philip> make: *** [hello.o] Error 1

    Philip> I encountered some errors and I fixed it by adding one
    Philip> more include path...

    Philip> bash.exe-2.04$ make hello.o
    Philip> i386-elf-gcc -c -o hello.o -g -Wall
    Philip> -I//c/users/philip/ecos/stub1_install/include -I/usr/include -ffunction-sections
    Philip> -fdata-sections hello.c
    Philip> bash.exe-2.04$

    Philip> The compilation was successful. The target I used is a
    Philip> PIII machine, host is Windows NT. I started up the i386
    Philip> target using the gdb stub floppy and run the following:

No, that is wrong. The header file /usr/include/stdio.h will be for
use by cygwin applications, not eCos applications. I suspect that you
are trying to re-use the same configuration for the boot floppy and
for "hello world".

When targetting a PC, you are essentially building two different
applications. The first application is the gdb stub for the boot
floppy, and serves the same purpose as a ROM monitor on a conventional
embedded target. The second application is the "hello world" program.
The two applications run in very different environments, e.g. they
need completely separate startup code, so you need two different
configurations. 

First you need to create a configuration for building the gdb stub,
build that, and install the resulting executable on a floppy. It looks
like you have already done this. The requirements for the gdb stub are
fairly simple, e.g. there is no need for a C library, so the C library
does not get built and its header files do not get installed.

Now create a new configuration using the default template, i.e. a
configuration suitable for ordinary applications. This will include
the C library, so the <stdio.h> header file will get installed. The
two configurations should live in completely separate directories.

    Philip> bash.exe-2.04$ i386-elf-gdb -nw hello.o
    Philip> GNU gdb 5.0
    Philip> Copyright 2000 Free Software Foundation, Inc.
    Philip> GDB is free software, covered by the GNU General Public License, and you
    Philip> are
    Philip> welcome to change it and/or distribute copies of it under certain
    Philip> conditions.
    Philip> Type "show copying" to see the conditions.
    Philip> There is absolutely no warranty for GDB.  Type "show warranty" for
    Philip> details.
    Philip> This GDB was configured as "--host=i686-pc-cygwin --target=i386-elf"...
    Philip> (gdb) set remotebaud 38400
    Philip> (gdb) target remote com1
    Philip> Remote debugging using com1
    Philip> 0x37dc in ?? ()
    Philip> (gdb) continue
    Philip> Continuing.

    Philip> Program received signal SIGTRAP, Trace/breakpoint trap.
    Philip> 0x37dc in ?? ()

    Philip> Anyone has any idea why the program hit a stop?

Another mistake I am afraid. You are trying to debug hello.o, an
intermediate object file. You must first link the object file with the
appropriate libraries. This will give you an executable file a.out or
hello or hello.exe, depending on exactly how you drive the tools,
and it is this executable which can then be debugged with gdb.

Bart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Running hello.c on i386
  2001-02-09 12:08 ` Bart Veer
@ 2001-02-11 17:09   ` Teng Chee Wan Philip
  0 siblings, 0 replies; 5+ messages in thread
From: Teng Chee Wan Philip @ 2001-02-11 17:09 UTC (permalink / raw)
  To: Bart Veer; +Cc: ecos-discuss

I thought that I made a mistake with the header files and tried to change the
Makefile.  Yes, I made the hello application under the environment as the stub.

Thanks a lot for the helpful advice.  I will try it out.

Philip Teng

Quoting Bart Veer <bartv@redhat.com>:

> >>>>> "Philip" == Philip Teng <tcheewan@dso.org.sg> writes:
> 
>     Philip> I tried to make hello.c using the Makefile given in the
> /examples.
>     Philip> bash.exe-2.04$ make hello.o
>     Philip> i386-elf-gcc -c -o hello.o -g -Wall
>     Philip> -I//c/users/philip/ecos/stub1_install/include
> -ffunction-sections
>     Philip> -fdata-sections hello.c
>     Philip> hello.c:2: stdio.h: No such file or directory
>     Philip> make: *** [hello.o] Error 1
> 
>     Philip> I encountered some errors and I fixed it by adding one
>     Philip> more include path...
> 
>     Philip> bash.exe-2.04$ make hello.o
>     Philip> i386-elf-gcc -c -o hello.o -g -Wall
>     Philip> -I//c/users/philip/ecos/stub1_install/include -I/usr/include
> -ffunction-sections
>     Philip> -fdata-sections hello.c
>     Philip> bash.exe-2.04$
> 
>     Philip> The compilation was successful. The target I used is a
>     Philip> PIII machine, host is Windows NT. I started up the i386
>     Philip> target using the gdb stub floppy and run the following:
> 
> No, that is wrong. The header file /usr/include/stdio.h will be for
> use by cygwin applications, not eCos applications. I suspect that you
> are trying to re-use the same configuration for the boot floppy and
> for "hello world".
> 
> When targetting a PC, you are essentially building two different
> applications. The first application is the gdb stub for the boot
> floppy, and serves the same purpose as a ROM monitor on a conventional
> embedded target. The second application is the "hello world" program.
> The two applications run in very different environments, e.g. they
> need completely separate startup code, so you need two different
> configurations. 
> 
> First you need to create a configuration for building the gdb stub,
> build that, and install the resulting executable on a floppy. It looks
> like you have already done this. The requirements for the gdb stub are
> fairly simple, e.g. there is no need for a C library, so the C library
> does not get built and its header files do not get installed.
> 
> Now create a new configuration using the default template, i.e. a
> configuration suitable for ordinary applications. This will include
> the C library, so the <stdio.h> header file will get installed. The
> two configurations should live in completely separate directories.
> 
>     Philip> bash.exe-2.04$ i386-elf-gdb -nw hello.o
>     Philip> GNU gdb 5.0
>     Philip> Copyright 2000 Free Software Foundation, Inc.
>     Philip> GDB is free software, covered by the GNU General Public
> License, and you
>     Philip> are
>     Philip> welcome to change it and/or distribute copies of it under
> certain
>     Philip> conditions.
>     Philip> Type "show copying" to see the conditions.
>     Philip> There is absolutely no warranty for GDB.  Type "show
> warranty" for
>     Philip> details.
>     Philip> This GDB was configured as "--host=i686-pc-cygwin
> --target=i386-elf"...
>     Philip> (gdb) set remotebaud 38400
>     Philip> (gdb) target remote com1
>     Philip> Remote debugging using com1
>     Philip> 0x37dc in ?? ()
>     Philip> (gdb) continue
>     Philip> Continuing.
> 
>     Philip> Program received signal SIGTRAP, Trace/breakpoint trap.
>     Philip> 0x37dc in ?? ()
> 
>     Philip> Anyone has any idea why the program hit a stop?
> 
> Another mistake I am afraid. You are trying to debug hello.o, an
> intermediate object file. You must first link the object file with the
> appropriate libraries. This will give you an executable file a.out or
> hello or hello.exe, depending on exactly how you drive the tools,
> and it is this executable which can then be debugged with gdb.
> 
> Bart
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Running  hello.c on i386
  2001-02-05  5:16 JITENDRA kanitkar
@ 2001-02-05 11:05 ` Jonathan Larmour
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2001-02-05 11:05 UTC (permalink / raw)
  To: JITENDRA kanitkar; +Cc: 'ecos-discuss@sourceware.cygnus.com'

JITENDRA kanitkar wrote:
> I am trying to load ecos on PIII m/c currently running RH6.2
> I followed the documentation(I belive) following are the snapshots of some
> of the commands o/p. When i tryied to compile hello.c as per the document
> with prefixing i386-elf- to gcc it gives errors(regarding paths).

You will need to give more details than that.

 The other
> issue is I copied gdb stub on floppy and tryied to boot it from that, it
> doesn't work. It gives some garbage(according to me) on the left top of the
> screen and hangs.

No that's correct. At this point it is now waiting for you to connect to it
via a serial line from another PC to download the program, as described in
the getting started guide.
 
> [root@jitu ecos-work]# ecosconfig new pc
> 1 conflict(s) resolved:
>  CYGSEM_HAL_I386_PC_STARTUP_RAM:
>   Requires constraint not satisfied:
> !CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
> 
> [root@jitu ecos-work]# ls
> ecos.ecc
> 
> [root@jitu ecos-work]# vi ecos.ecc
> 
> c[root@jitu ecos-work]# ecosconfig tree
> 5 conflict(s) resolved:
>  CYGSEM_HAL_I386_PC_STARTUP_RAM:
>   Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
>  CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT:
>   Requires constraint not satisfied: !CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
>  CYGSEM_HAL_I386_PC_STARTUP_RAM:
>   Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
>  CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT:
>   Requires constraint not satisfied: !CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
>  CYGSEM_HAL_I386_PC_STARTUP_RAM:
>   Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
> 
> [root@jitu ecos-work]#

This output is all correct and expected.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ECOS] Running  hello.c on i386
@ 2001-02-05  5:16 JITENDRA kanitkar
  2001-02-05 11:05 ` Jonathan Larmour
  0 siblings, 1 reply; 5+ messages in thread
From: JITENDRA kanitkar @ 2001-02-05  5:16 UTC (permalink / raw)
  To: 'ecos-discuss@sourceware.cygnus.com'

Hi there,

I am trying to load ecos on PIII m/c currently running RH6.2
I followed the documentation(I belive) following are the snapshots of some
of the commands o/p. When i tryied to compile hello.c as per the document
with prefixing i386-elf- to gcc it gives errors(regarding paths). The other
issue is I copied gdb stub on floppy and tryied to boot it from that, it
doesn't work. It gives some garbage(according to me) on the left top of the
screen and hangs.

Pl. suggest some pointers.

Thanks in advance,
jitendra.

[root@jitu ecos-work]# ecosconfig new pc
1 conflict(s) resolved:
 CYGSEM_HAL_I386_PC_STARTUP_RAM:
  Requires constraint not satisfied:
!CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK

[root@jitu ecos-work]# ls
ecos.ecc

[root@jitu ecos-work]# vi ecos.ecc 

c[root@jitu ecos-work]# ecosconfig tree
5 conflict(s) resolved:
 CYGSEM_HAL_I386_PC_STARTUP_RAM:
  Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
 CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT:
  Requires constraint not satisfied: !CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
 CYGSEM_HAL_I386_PC_STARTUP_RAM:
  Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
 CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT:
  Requires constraint not satisfied: !CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
 CYGSEM_HAL_I386_PC_STARTUP_RAM:
  Requires constraint not satisfied: CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT

[root@jitu ecos-work]# 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-02-11 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-06 23:11 [ECOS] Running hello.c on i386 Philip Teng
2001-02-09 12:08 ` Bart Veer
2001-02-11 17:09   ` Teng Chee Wan Philip
  -- strict thread matches above, loose matches on Subject: below --
2001-02-05  5:16 JITENDRA kanitkar
2001-02-05 11:05 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).