public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problems with the PowerPC simulator
@ 1999-11-04 12:39 Bernd Sprenger
  1999-11-05  1:28 ` Jesper Skov
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Sprenger @ 1999-11-04 12:39 UTC (permalink / raw)
  To: ecos-discuss

I have a problem using eCos together with the PowerPC simulator (and
GDB). I have installed the sourceware distribution of ecos-1.2.1 and
ecosSWtools-990319. Everything went smoothly.

I configured eCos for: --target=powerpc --platform=sim --startup=ram

When I try to run the tutorial I encounter a problem with the powerpc
simulator and gdb
(ecos-1.2.1/doc/tutorials/ecos-tutorial/run-an-ecos-test-case.html):

  >powerpc-eabi-run install/tests/kernel/bin_sem0
     core_find_mapping() - access to unmaped address, attach a default
     map to handle this - addr=0xf000101a nr_bytes=0x1 processor=
     0x40118008 cia=0x55b4 

The same happens when running with gdb.

I debugged this test program and found out, that the error happens in
the macro HAL_DIAG_WRITE_CHAR defined in the file
ecos-1.2.1/packages/hal/powerpc/sim/v1_2_1/include/hal_diag.h:

  #define OEA_DEV          0xf0001000

  #define HAL_DIAG_WRITE_CHAR(_c_)                        \
  CYG_MACRO_START                                         \
      volatile unsigned char *tty_buffer =                \
          (unsigned char*)(OEA_DEV + PAL_WRITE_FIFO);     \
      volatile unsigned char *tty_status =                \
          (unsigned char*)(OEA_DEV + PAL_WRITE_STATUS);   \
      unsigned long __state;                              \
                                                          \
      HAL_DISABLE_INTERRUPTS(__state)                     \
      if( _c_ != '\r' )                                   \
      {                                                   \
          while( *tty_status == 0 ) continue;             \
          *tty_buffer = _c_;                              \
      }                                                   \
      HAL_RESTORE_INTERRUPTS(__state);                    \
  CYG_MACRO_END

This lead me to the realization, that the simulated hardware in psim
might not be the one required by eCos. Searching the hal source code 
I found the file ecos-1.2.1/packages/hal/powerpc/sim/v1_2_1/runtime/tree
with the following content:

  /#address-cells 1 
  /openprom/init/register/pc 0x100
  /iobus@0xf0000000/reg 0xf0000000 0x01000000
  /iobus/pal@0xf0001000/reg 0xf0001000 32

Using this definition I was able to run the test program via the
following command line:

  >powerpc-eabi-run -o '/#address-cells 1' \
                    -o '/openprom/init/register/pc 0x100' \
                    -o '/iobus@0xf0000000/reg 0xf0000000 0x01000000' \
                    -o '/iobus/pal@0xf0001000/reg 0xf0001000 32' \
                    install/tests/kernel/bin_sem0     

The same is true for the gdb using these paramaters when selecting the
target.

Now my question:

Is there a possibility to configure psim that it uses this device-tree
by default?

Is there a better documentation of psim available than the files its
source directory
(Bugs, Install, Readme, Run and Psim.texinfo)?

Thanks a lot for your help,

Bernd
sprenger@robotics.stanford.edu

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

* Re: [ECOS] Problems with the PowerPC simulator
  1999-11-04 12:39 [ECOS] Problems with the PowerPC simulator Bernd Sprenger
@ 1999-11-05  1:28 ` Jesper Skov
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Skov @ 1999-11-05  1:28 UTC (permalink / raw)
  To: Bernd Sprenger; +Cc: ecos-discuss

>>>>> "Bernd" == Bernd Sprenger <sprenger@Robotics.Stanford.EDU> writes:

Bernd> Using this definition I was able to run the test program via
Bernd> the following command line:

>> powerpc-eabi-run -o '/#address-cells 1' \
Bernd>                     -o '/openprom/init/register/pc 0x100' \ -o
Bernd> '/iobus@0xf0000000/reg 0xf0000000 0x01000000' \ -o
Bernd> '/iobus/pal@0xf0001000/reg 0xf0001000 32' \
Bernd> install/tests/kernel/bin_sem0

This can be reduced to:

 -o '/iobus/pal@0xf0001000/reg 0xf0001000 32'

Bernd> The same is true for the gdb using these paramaters when
Bernd> selecting the target.

Bernd> Now my question:

Bernd> Is there a possibility to configure psim that it uses this
Bernd> device-tree by default?

I don't know, but it shouldn't really matter. In GDB you can make a
macro instead of typing in the runes by hand (as suggested in the
Getting Started Guide). For the stand-alone simulator you can create a
shell alias or a shell script with the necessary runes.

Bernd> Is there a better documentation of psim available than the
Bernd> files its source directory (Bugs, Install, Readme, Run and
Bernd> Psim.texinfo)?

There's sourceware.cygnus.com/psim, but I suspect it's the same
documentation as distributed with the sources.

Jesper

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

end of thread, other threads:[~1999-11-05  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-04 12:39 [ECOS] Problems with the PowerPC simulator Bernd Sprenger
1999-11-05  1:28 ` Jesper Skov

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