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: Redboot GDB stubs for non-ecos application


John Newlin <jnewlin@rawbw.com> writes:

> I'm working on getting GDB stubs working for a non-ecos application, and
> trying to figure out how to make this work.
> 
> It looks as if the applicaiton needs to enable interrupts, at least for
> the serial port, so that control-c work.  Possibly for Ethernet for same
> reason, but I'll deal with that later.

RedBoot will have enabled the interrupts it is interested in for
Ctrl-C handling by unmasking them in the interrupt controller, but it
will leave the CPU interrupt flag disabled. These interrupts will not
be delivered until the application enabled CPU interrupts itself.

> 
> Does Redboot put breakpoint instructions at the vectors, so the
> application can load it's own vectors, or does the application need to use
> the same VSR table that redboot/ecos use?

RedBoot will set up the interrupt vectors to pass control to its own
internal ISRs which will look for Ctrl-C events. It doesn't set
breakpoints or anything. Depending on the architecture, applications
can handle interrupt by either plugging directly into the hardware
entry points or by installing their own entries in the VSR table. This
may, of course, render Ctrl-C inoperable, and the app may need to do
all the interrupt source decoding itself.

> 
> If Redboot puts the break instructions on the vectors, when the
> application exits, does redboot rewrite those vectors, or I guess it
> doesn't really need them since it's running with interrupts off?

It is usually the application's job to restore the vectors. It is
usually cleaner and simpler to do a hardware reset to get the machine
back intot a known state.

> 
> If someone has an example of how another Architecture does this and I
> could look at that.

ARM, MIPS and SH, at least, all have the necessary gubbins to support
newlib based applications built with the GNU tools.

-- 
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


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