H8SX porting effort stumped

Steven Grunza grunza at ulticom.com
Wed May 7 17:14:02 UTC 2008


Hello,
  I'm working on porting RTEMS to the Renesas H8SX and I've hit a bug I
can't figure out.

Background:
  The RTEMS data structure _Configuration of type
rtems_configuration_table is created in the
examples-4.7.99.2/hello_world_c/test.c file by including
<rtems/confdefs.h>

  After passing the --save-temps directive into the build I can see the
following in test.s:


        .global _Configuration
        .align 2
        .type   _Configuration, @object
        .size   _Configuration, 56
_Configuration:
        .long   16719872
        .long   17624
        .long   0
        .long   10000
        .long   50
        .long   1
        .long   1
        .long   _Device_drivers
        .long   1
        .long   _Configuration_Initial_Extensions
        .long   0
        .long   _Configuration_RTEMS_API
        .long   0
        .long   0


  In hello.num I can see the following addresses:

	00015430 T _rodata_start
	00480000 D _data_start
	004800a0 D _Configuration

  So it appears that the _Configuration is stored in SRAM (which starts
at 0x0048_0000) at 0x0048_00a0.  Given the simple block copy done to get
the initialized data from the read only area to the initialized area my
guess is that the initialization data for the _Configuration structure
should be at

	0x0001_54d0  which is 0xa0 bytes into the read only data area


  I took the S-record format of the hello.exe ELF executable and used
objcopy to make a binary image of it.  I then used hexedit to look at
the binary image.  Since my executable begins with a vector table at
0x0000_0000 there shouldn't be any offsets to worry about.

  Thanks for reading this far...

  Here's the issue:

  At 0x0001_54d0 there's ASCII data, not the data necessary to setup the
_Configuration structure.  My guess is that since the first long word
appears to be intended to be an address, bad things are happening in my
code because the _Configuration structure is really hosed...

00015430   0A 0A 2A 2A  2A 20 48 45  4C 4C 4F 20  57 4F 52 4C  ..***
HELLO WORL
00015440   44 20 54 45  53 54 20 2A  2A 2A 00 48  65 6C 6C 6F  D TEST
***.Hello
00015450   20 57 6F 72  6C 64 00 2A  2A 2A 20 45  4E 44 20 4F
World.*** END O
00015460   46 20 48 45  4C 4C 4F 20  57 4F 52 4C  44 20 54 45  F HELLO
WORLD TE
00015470   53 54 20 2A  2A 2A 00 00  00 00 00 00  00 00 00 00  ST
***..........
00015480   00 00 07 82  00 00 06 B6  00 00 00 00  00 00 00 00
................
00015490   00 00 00 00  00 00 00 00  6D 69 6E 6F  72 20 3C 3D
........minor <=
000154A0   20 31 00 2E  2E 2F 2E 2E  2F 2E 2E 2F  2E 2E 2F 2E
1.../../../../.
000154B0   2E 2F 2E 2E  2F 2E 2E 2F  2E 2E 2F 72  74 65 6D 73
./../../../rtems
000154C0   2F 63 2F 73  72 63 2F 6C  69 62 2F 6C  69 62 62 73
/c/src/lib/libbs
000154D0   70 2F 68 38  33 30 30 2F  68 38 73 78  5F 72 73 6B
p/h8300/h8sx_rsk
000154E0   2F 2E 2E 2F  2E 2E 2F 73  68 61 72 65  64 2F 63 6F
/../../shared/co
000154F0   6E 73 6F 6C  65 2D 70 6F  6C 6C 65 64  2E 63 00 2F
nsole-polled.c./
00015500   64 65 76 2F  63 6F 6E 73  6F 6C 65 00  52 54 45 4D
dev/console.RTEM
00015510   53 00 61 73  73 65 72 74  69 6F 6E 20  22 25 73 22
S.assertion "%s"
00015520   20 66 61 69  6C 65 64 3A  20 66 69 6C  65 20 22 25   failed:
file "%
00015530   73 22 2C 20  6C 69 6E 65  20 25 64 0A  00 2E 2E 00  s", line
%d.....
00015540   4D 61 6C 6C  6F 63 20 73  74 61 74 73  00 20 20 61  Malloc
stats.  a
00015550   76 61 69 6C  3A 25 6C 75  6B 20 20 61  6C 6C 6F 63  vail:%luk
alloc
00015560   61 74 65 64  3A 25 6C 75  6B 20 28 25  6C 64 25 25  ated:%luk
(%ld%%
00015570   29 20 6D 61  78 3A 25 6C  75 6B 20 28  25 6C 75 25  )
max:%luk (%lu%
00015580   25 29 20 6C  69 66 65 74  69 6D 65 3A  25 6C 6C 75  %)
lifetime:%llu
00015590   6B 20 66 72  65 65 64 3A  25 6C 6C 75  6B 0A 00 20  k
freed:%lluk..


  This message is already long but if anyone is interested in helping I
can send whatever files would be useful, such as the linker command
script.



------------------------------------------------------------
"Unix is user friendly, it's just  Steven Grunza
particular about with whom it      voice: (856) 787 - 2759
makes friends."                    fax:   (856) 866 - 2033
- Unknown                          mailto:grunza at ulticom.com
                                   flames:/dev/null
------------------------------------------------------------



More information about the users mailing list