public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] redboot info threads problem
@ 2000-12-07  3:05 Andrew Lunn
  2000-12-07  3:11 ` Gary Thomas
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2000-12-07  3:05 UTC (permalink / raw)
  To: eCos Disuss

Hi Folks

Im trying to work out how redboot does its info threads call. I think
i understand whats going. The redboot stub calls into the RAM app
using the virtual vector support. dbg_threadinfo calls
dbg_thread_syscal which jumps through the vector thus

static __inline__ int dbg_thread_syscall(
                                     enum dbg_syscall_ids id)
{
  dbg_syscall_func f ; /* double indirect via */
  if (0 ==(f = *dbg_syscall_ptr)) return 0 ; /* no pointer to vector */
  if (0 == *f) return 0 ; /* vector not initialized */
  return (*f)(id,&tcall);
}

What im missing is when is dbg_syscall_ptr initialised? There is a
function to do it, init_threads_syscall, but its not getting
called. This should be called as part of hal_if_init but its not. Its
surrouned by conditional compilations which are evaluating to
false. The conditions are 

!defined(CYGPKG_KERNEL) && defined(CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT)

I don't have a kernel, this is plain redboot. Looking at ecos.ecc
CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT is not active.

    # ActiveIf constraint:  CYGSEM_HAL_ROM_MONITOR || CYGDBG_KERNEL_DEBUG_GD
B_THREAD_SUPPORT 
    #     CYGSEM_HAL_ROM_MONITOR == 0
    #     CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT (unknown) == 0
    #   --> 0

The redboot.txt shipped with 1.4.4 says to disable
CYGSEM_HAL_ROM_MONITOR.  CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT is
defined in kernel.cdl which since im not using it is not included.

So whats wrong?

        Thanks
                Andrew

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

* RE: [ECOS] redboot info threads problem
  2000-12-07  3:05 [ECOS] redboot info threads problem Andrew Lunn
@ 2000-12-07  3:11 ` Gary Thomas
  2000-12-07  3:35   ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Gary Thomas @ 2000-12-07  3:11 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos Disuss, eCos RedBoot

On 07-Dec-2000 Andrew Lunn wrote:
> The redboot.txt shipped with 1.4.4 says to disable
> CYGSEM_HAL_ROM_MONITOR.  CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT is
> defined in kernel.cdl which since im not using it is not included.
> 

This seems to be wrong - possibly a holdover from a previous release.
You need 'CYGSEM_HAL_ROM_MONITOR' to be defined within RedBoot, which
will turn on the thread debug support.  Are you turning this off
explicitly?  If so, try not doing so.  I just checked that a RedBoot
built "out of the box" for the EBSA does this correctly.  Note: this
symbol is only defined for RedBoot in ROM.

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

* Re: [ECOS] redboot info threads problem
  2000-12-07  3:11 ` Gary Thomas
@ 2000-12-07  3:35   ` Andrew Lunn
  2000-12-07  3:42     ` Gary Thomas
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andrew Lunn @ 2000-12-07  3:35 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Disuss, eCos RedBoot

> This seems to be wrong - possibly a holdover from a previous release.
> You need 'CYGSEM_HAL_ROM_MONITOR' to be defined within RedBoot, which
> will turn on the thread debug support.  Are you turning this off
> explicitly?  If so, try not doing so.  I just checked that a RedBoot
> built "out of the box" for the EBSA does this correctly.  Note: this
> symbol is only defined for RedBoot in ROM.

The export file given in the redboot.txt explicitly turns this off,
but in fact ecosconfig has already decided to turn it off..

lunn@tux:/lhome/lunn/ecos-work-sa-1.4.4.redboot-plain$ /usr/local/pkg/plcuts/ecos-1.4.4/tools/bin/ecosconfig new ebsa redboot
U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
U CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM, new inferred value 0
U CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS, new inferred value 1
U CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT, new inferred value 1
U CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT, new inferred value 0

When i import redboot.ROM it stays off.

If it try to turn it on with 

cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
    user_value 1 GDB_stubs
};

I get constraint conflicts it cannot resolve.

        Andrew



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

* Re: [ECOS] redboot info threads problem
  2000-12-07  3:35   ` Andrew Lunn
@ 2000-12-07  3:42     ` Gary Thomas
  2000-12-07  3:51       ` Andrew Lunn
       [not found]     ` <20001207125137.A7817.cygnus.project.ecc.redboot@biferten.ma.tech.ascom.ch>
  2000-12-07  5:43     ` Jesper Skov
  2 siblings, 1 reply; 9+ messages in thread
From: Gary Thomas @ 2000-12-07  3:42 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos RedBoot, eCos Disuss

On 07-Dec-2000 Andrew Lunn wrote:
>> This seems to be wrong - possibly a holdover from a previous release.
>> You need 'CYGSEM_HAL_ROM_MONITOR' to be defined within RedBoot, which
>> will turn on the thread debug support.  Are you turning this off
>> explicitly?  If so, try not doing so.  I just checked that a RedBoot
>> built "out of the box" for the EBSA does this correctly.  Note: this
>> symbol is only defined for RedBoot in ROM.
> 
> The export file given in the redboot.txt explicitly turns this off,
> but in fact ecosconfig has already decided to turn it off..
> 
> lunn@tux:/lhome/lunn/ecos-work-sa-1.4.4.redboot-plain$
> /usr/local/pkg/plcuts/ecos-1.4.4/tools/bin/ecosconfig new ebsa redboot
> U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
> U CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM, new inferred value 0
> U CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS, new inferred value 1
> U CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT, new inferred value 1
> U CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT, new inferred value 0
> 
> When i import redboot.ROM it stays off.
> 
> If it try to turn it on with 
> 
> cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
>     user_value 1 GDB_stubs
> };
> 
> I get constraint conflicts it cannot resolve.

You definitely need STARTUP=ROM for it to work, otherwise you'll get
those unresolvable conflicts.

How new is your 'ecosconfig' (did you get a new one with 1.4.4)?

I can send you [privately] a RedBoot to try which I built here, just to
verify that the thread stuff works as expected.

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

* Re: [ECOS] redboot info threads problem
  2000-12-07  3:42     ` Gary Thomas
@ 2000-12-07  3:51       ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2000-12-07  3:51 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Andrew Lunn, eCos RedBoot, eCos Disuss

> > When i import redboot.ROM it stays off.
> > 
> > If it try to turn it on with 
> > 
> > cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
> >     user_value 1 GDB_stubs
> > };
> > 
> > I get constraint conflicts it cannot resolve.
> 
> You definitely need STARTUP=ROM for it to work, otherwise you'll get
> those unresolvable conflicts.

Yes, i have this. My redboot.ROM file has at the end

cdl_component CYG_HAL_STARTUP {
    user_value ROM
};
 
> How new is your 'ecosconfig' (did you get a new one with 1.4.4)?

Yes. 

ecosconfig --version
ecosconfig 1.4.4 (Nov  1 2000 12:30:05)
Copyright (c) 2000 Red Hat, Inc.

> I can send you [privately] a RedBoot to try which I built here, just to
> verify that the thread stuff works as expected.

Thats not so interesting for me. What i want to do is extend redboot
to include the kernel so i can give it much more functionality. Before
i do that i want to be able to compile just plain old redboot. No
point walking until i can crawl.

        Andrew

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

* Re: [ECOS] redboot info threads problem
       [not found]     ` <20001207125137.A7817.cygnus.project.ecc.redboot@biferten.ma.tech.ascom.ch>
@ 2000-12-07  4:33       ` Hugo Tyson
  2000-12-07  4:52         ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Hugo Tyson @ 2000-12-07  4:33 UTC (permalink / raw)
  To: egcs; +Cc: Andrew Lunn, eCos Disuss

The following message is a courtesy copy of an article
that has been posted to cygnus.project.ecc.redboot as well.


andrew.lunn@ascom.ch (Andrew Lunn) writes:
> > I can send you [privately] a RedBoot to try which I built here, just to
> > verify that the thread stuff works as expected.
> 
> Thats not so interesting for me. What i want to do is extend redboot to
> include the kernel so i can give it much more functionality.

I have to interject: Andrew, if this is related to the issues with using
code that has mutexes &c in, in RedBoot, without starting the kernel, that
we've discussed elsewhere and that I suspect may be contributing to
problems with the thread debugging, I'd like to restate this recommendation
for the list:

Don't put the kernel in RedBoot.  Use the device driver kernel API for
doing synchronization.  That's what it's for (OK, maybe it's misnamed.)
That way you'll be able to use the same sources with safe no-ops for
synchronization primitives, compiled for running in both a single-context
boot ROM sans kernel, or in a threaded application.

OTOH, what functionality is it you want in RedBoot that needs the kernel?

	- Huge

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

* Re: [ECOS] redboot info threads problem
  2000-12-07  4:33       ` Hugo Tyson
@ 2000-12-07  4:52         ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2000-12-07  4:52 UTC (permalink / raw)
  To: Hugo Tyson; +Cc: Andrew Lunn, eCos Disuss

On Thu, Dec 07, 2000 at 12:32:53PM +0000, Hugo Tyson wrote:
> I'd like to restate this recommendation
> for the list:
> 
> Don't put the kernel in RedBoot. 

Yes, in an ideal world, i would not even try. Its not been designed
for this so at the moment im just exploring the posibilities. 

> OTOH, what functionality is it you want in RedBoot that needs the kernel?

Backward compatibility. I had my own bootloader long before redboot
came along. This used a full eCos ROM app to load the RAM app and
start it. It would be nice if i could use the ethernet debugging from
redboot but remain backward compatible with my old bootloader. The old
code assumes there is a kernel and the rest of eCos. So i have two
options. Rewrite the code so that it only uses the driver API, or try
to get the kernel running on redboot. 

Anyway, all the questions i have asked so far have been about plain
redboot. Im just trying to understand how it sets up the machanisms
for calling between the ROM redboot and RAM application.


        Andrew

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

* Re: [ECOS] redboot info threads problem
  2000-12-07  3:35   ` Andrew Lunn
  2000-12-07  3:42     ` Gary Thomas
       [not found]     ` <20001207125137.A7817.cygnus.project.ecc.redboot@biferten.ma.tech.ascom.ch>
@ 2000-12-07  5:43     ` Jesper Skov
  2000-12-07  6:13       ` Andrew Lunn
  2 siblings, 1 reply; 9+ messages in thread
From: Jesper Skov @ 2000-12-07  5:43 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Gary Thomas, eCos Disuss, eCos RedBoot

>>>>> "Andrew" == Andrew Lunn <andrew.lunn@ascom.ch> writes:

>> This seems to be wrong - possibly a holdover from a previous
>> release.  You need 'CYGSEM_HAL_ROM_MONITOR' to be defined within
>> RedBoot, which will turn on the thread debug support.  Are you
>> turning this off explicitly?  If so, try not doing so.  I just
>> checked that a RedBoot built "out of the box" for the EBSA does
>> this correctly.  Note: this symbol is only defined for RedBoot in
>> ROM.

Andrew> The export file given in the redboot.txt explicitly turns this
Andrew> off, but in fact ecosconfig has already decided to turn it
Andrew> off..

Andrew> lunn@tux:/lhome/lunn/ecos-work-sa-1.4.4.redboot-plain$
Andrew> /usr/local/pkg/plcuts/ecos-1.4.4/tools/bin/ecosconfig new ebsa
Andrew> redboot U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0 U
Andrew> CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM, new inferred value 0 U
Andrew> CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS, new inferred value 1 U
Andrew> CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT, new inferred value 1 U
Andrew> CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT, new inferred value 0

Andrew> When i import redboot.ROM it stays off.

Andrew> If it try to turn it on with

Andrew> cdl_option CYGSEM_HAL_USE_ROM_MONITOR { user_value 1 GDB_stubs
Andrew> };

Andrew> I get constraint conflicts it cannot resolve.

CYGSEM_HAL_ROM_MONITOR != CYGSEM_HAL_USE_ROM_MONITOR

You are trying to set the wrong option.

RedBoot is a ROM monitor so (CYGSEM_HAL_ROM_MONITOR=1) and it cannot
rely on a ROM monitor so (CYGSEM_HAL_USE_ROM_MONITOR=0).

Jesper

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

* Re: [ECOS] redboot info threads problem
  2000-12-07  5:43     ` Jesper Skov
@ 2000-12-07  6:13       ` Andrew Lunn
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2000-12-07  6:13 UTC (permalink / raw)
  To: Jesper Skov; +Cc: eCos Disuss, eCos RedBoot

> CYGSEM_HAL_ROM_MONITOR != CYGSEM_HAL_USE_ROM_MONITOR
> 
> You are trying to set the wrong option.
> 
> RedBoot is a ROM monitor so (CYGSEM_HAL_ROM_MONITOR=1) and it cannot
> rely on a ROM monitor so (CYGSEM_HAL_USE_ROM_MONITOR=0).

That solved it.

So the redboot.txt in 1.4.4 is wrong. It does not say anything about
setting this option when building the ROM version.

Looking at sources.redhat.com its been corrected on the online
documentation.

I was just unlucky when i decided to use official supported
documentation rather than the best effort documentation on the web :-(

Thanks for your help

        Andrew        



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

end of thread, other threads:[~2000-12-07  6:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-07  3:05 [ECOS] redboot info threads problem Andrew Lunn
2000-12-07  3:11 ` Gary Thomas
2000-12-07  3:35   ` Andrew Lunn
2000-12-07  3:42     ` Gary Thomas
2000-12-07  3:51       ` Andrew Lunn
     [not found]     ` <20001207125137.A7817.cygnus.project.ecc.redboot@biferten.ma.tech.ascom.ch>
2000-12-07  4:33       ` Hugo Tyson
2000-12-07  4:52         ` Andrew Lunn
2000-12-07  5:43     ` Jesper Skov
2000-12-07  6:13       ` Andrew Lunn

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