This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem running applications. Breakpoint getting setautomatically at atexit.cxx


Thankz Gary for clarifying some of my doubts.

Also I was able to build the application twothread.c as given by you.

I have one more question here.

Since you've said that kernel is not included neither in Redboot nor in
the raw GDB stubs, would that mean that the application "twothread"
would also contain the kernel in the same binary. I mean, it is the
application and the kernel together as a single binary ?.

-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com] 
Sent: Monday, April 26, 2004 7:27 PM
To: Syed Mohasin Zaki (WT01 - EMBEDDED & PRODUCT ENGINEERING SOLUTIONS)
Cc: nickg@ecoscentric.com; mohanlaljangir@hotmail.com; eCos Discussion
Subject: RE: [ECOS] Problem running applications. Breakpoint getting
setautomatically at atexit.cxx

On Mon, 2004-04-26 at 07:26, mohasin.zaki@wipro.com wrote:
> Thankz Nick,
> 
> I am new to eCos and I am kind of running wild to learn and get things
> working,  as I am running short of time.
> 
> Can you clarify some of the basic doubts that I have ?.
> 
> When I am creating a configuration for booting eCos from a floppy, I
> select i386 PC Target with Gigabit Ethernet as the hardware and in
> packages, I select Redboot. Then I import a file named
> redboot_FLOPPY.ecm for the i386 architecture. I set the startup type
to
> "FLOPPY". On building this, I get a redboot.bin file, which I copy to
> the floopy and use the same to boot.
> 
> There is an other way, where instead of selecting Redboot, I selected
> the "stubs" option to create a boot image.

These are two templates for building an embeddeded monitor environment,
either the raw GDB stubs (which can only be used with GDB), or RedBoot
which is a more complete debug & development environment.

> 
> In both of these options, I was able to load the sample applications
> like "hello" and "twothreads".
> 
> While these options are selected (reboot or stubs), I did not see the
> kernel package to be included. Ie. The eCos kernel package is not
> included.
> 
> Does that mean that the kernel is not included ?. 

Neither RedBoot nor the raw stubs use the kernel.

> 
> If the kernel is not included, then how come I am able to create 2
> threads in the twothreads sample. (Some of the questions may be very
> trivial, kindly excuse my stupidity) ?.
> 
> Now that I was able to run the sample applications, I thought I will
> repeat the same procedure with the eCos kernel package included.
> 
> This is when I ran into trouble running the applications (the head of
> this thread)

Building eCos to run applications requires a different configuration 
(i.e. template) than when one is building RedBoot.  To build the thread
test, follow something like this:

  % mkdir ecos_test
  % cd ecos_test
  % mkdir ecos_kernel
  % cd ecos_kernel
  % ecosconfig new pc
  % ecosconfig tree
  % make
  % cd
  % mkdir example
  % cd example
  % cp ${ECOS_REPOSITORY}/../examples/twothreads.c .
  % SRCS=twothreads.c DST=twothreads
${ECOS_REPOSITORY}/../examples/build_Makefile `pwd`/../ecos_kernel
  % make


For a more complete explanation and examples, see 
  http://www.mlbassoc.com/examples

> 
> 
> Thankz for all the help.
> 
> -Mohasin
> 
> 
> -----Original Message-----
> From: ecos-discuss-owner@ecos.sourceware.org
> [mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Nick
> Garnett
> Sent: Monday, April 26, 2004 2:28 PM
> To: Syed Mohasin Zaki (WT01 - EMBEDDED & PRODUCT ENGINEERING
SOLUTIONS)
> Cc: mohanlaljangir@hotmail.com; ecos-discuss@ecos.sourceware.org
> Subject: Re: [ECOS] Problem running applications. Breakpoint getting
set
> automatically at atexit.cxx
> 
> <mohasin.zaki@wipro.com> writes:
> 
> > Ummhh.. but why I am getting problem with all the executables that
> I've
> > built.
> > 
> > Also as I have mentioned earlier, I am able to load them as test
them
> as
> > long as I don't include the eCos kernel package (note that I am not
> > using redboot here).
> 
> I think you are getting confused here. You must be using RedBoot,
> since you are connecting to it when you execute
> 
> (gdb) target remote /dev/ttyS0
> 
> The breakpoint you see at 0x00006b00 is the breakpoint that RedBoot
> has used to put itself into GDB mode. After connecting GDB tries to
> interpret this address in terms of the executable it has in
> hand. Since the address is outside the executable's address range, GDB
> makes its best guess and describes it as belonging to the closest
> piece of code, which in your case just happens to be in atexit.cxx.
> 
> This address will be changed when you load the executable to be the
> start address of the program.
> 
> Clearly you will never see threads in your application if you do not
> have the kernel installed. 
> 
> I suggest that before messing about with advanced configuration
> options, like removing the kernel, that you go back and follow the
> documentation and get more familiar with eCos as is comes.
> 
> -- 
> Nick Garnett                    eCos Kernel Architect
> http://www.ecoscentric.com      The eCos and RedBoot experts
> 
> 
> -- 
> Before posting, please read the FAQ:
http://ecos.sourceware.org/fom/ecos
> and search the list archive:
http://ecos.sourceware.org/ml/ecos-discuss
> 
> 
> Confidentiality Notice 
> 
> The information contained in this electronic message and any
attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain confidential
or privileged information. If
> you are not the intended recipient, please notify the sender at Wipro
or Mailadmin@wipro.com immediately
> and destroy all copies of this message and any attachments.
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


Confidentiality Notice 

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]