From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernd Sprenger To: ecos-discuss@sourceware.cygnus.com Subject: [ECOS] Problems with the PowerPC simulator Date: Thu, 04 Nov 1999 12:39:00 -0000 Message-id: <3821EEFF.57B6A468@robotics.stanford.edu> X-SW-Source: 1999-11/msg00013.html 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