mvme2306
D. Peter Siddons
siddons at bnl.gov
Thu Apr 19 22:07:35 UTC 2001
Hi Joel,
> Refer to the make/custom/mcp750.cfg for some "advice". There
> mvme2307.cfg file was not updated to reflect the way to build
> a downloadable image in a manner that would work both before
> and after the RTEMS install.
>
> The basic idea is that you need a binary image with the bootloader
> and a zipped image of the executable. The mcp750.cfg make-exe
> rule is the one to use as a baseline.
OK, so I took the mcp750.cfg and the mvme2307.cfg and came up with
something that at least produces a file which looks reasonable.
Here are the bits I had to hack to make it complete. It generates
a file called hello.bin, simply left in the o-optimize directory.
-------------------------------------------------------------------
# NOTE2: some level of -O may be actually required by inline assembler
(at least
# -O2 so far.
# NOTE2 Apparently nobody really knows the status or r2 and r13.
# As far as I know, small data are pointer impose a very specific
compliation
# model => not used.
# Currently the sdata2 and sbss2 sections are empty => r2 is not used...
CFLAGS_OPTIMIZE_V=-O4 -mmultiple -mstring -mstrict-align
# debug flags: typically none, but at least -O1 is required due to this
# BSP using inlined code
CFLAGS_DEBUG_V = -O1 -mmultiple -mstring -mstrict-align
# profile flags: typically none, but at least -O1 is required due to
this
# BSP using inlined code
CFLAGS_PROFILE_V = -O1 -mmultiple -mstring -mstrict-align
# The following is a ld command file which works without using the
# -specs system in gcc 2.8. IT HAS NEVER BEEN TESTED WITH THIS BSP!!!
# $(LD) $(XLDFLAGS) -T $(LINKCMDS) \
# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
# $(LD) $(XLDFLAGS) -Ttext 0x20000 \
# -o $@ -u atexit -u __vectors -u download_entry $(LINK_FILES)
# $(CC) -mmvme -mrtems -nostartfiles -mcpu=603 \
# -o $(basename $@).exe -L $(PROJECT_RELEASE)/lib \
# $(START_FILE) $(LINK_OBJS) \
# $(LD_LIBS) \
# -Wl,-\( -Wl,-lc -Wl,-lrtemsall -Wl,-lgcc -Wl,-\)
define make-exe
$(LINK.c) $(AM_CFLAGS) $(AM_LDFLAGS) \
-o $(basename $@).exe $(LINK_OBJS) $(LINK_LIBS)
$(NM) -g -n $(basename $@).exe > $(basename $@).num
$(SIZE) $(basename $@).exe
$(OBJCOPY) $(basename $@).exe rtems -O binary -R .comment -S
gzip -vf9 rtems
$(LD) -o $(basename $@).bin $(PROJECT_RELEASE)/lib/bootloader.o
--just-symbols=$(basename $@)
.exe \
-b binary rtems.gz -T $(PROJECT_RELEASE)/lib/ppcboot.lds \
-Map $(basename $@).map && chmod 755 $@
rm -f rtems.gz
endef
# Miscellaneous additions go here
---------------------------------------------------------
The .map file shows:-
----------------------------------------------------------
Allocating common symbols
Common symbol size file
fixed_td 0x4
../../../../../mvme2307/lib/bootloader.o
fixed_tl 0x4
../../../../../mvme2307/lib/bootloader.o
fixed_mem 0x1090
../../../../../mvme2307/lib/bootloader.o
fixed_bl 0x4
../../../../../mvme2307/lib/bootloader.o
v86_private 0x94
../../../../../mvme2307/lib/bootloader.o
fixed_bd 0x4
../../../../../mvme2307/lib/bootloader.o
Memory Configuration
Name Origin Length Attributes
*default* 0x00000000 0xffffffff
Linker script and memory map
LOAD ../../../../../mvme2307/lib/bootloader.o
LOAD o-optimize/hello.exe
TARGET(binary)
LOAD rtems.gz
.text 0x00000000 0xc98c
0x00000000 0x4 LONG 0x48000400 (0x48000000+start)
*fill* 0x00000004 0x1ba
0x000001be .=0x1be
0x000001be 0x1 BYTE 0x80
0x000001bf 0x1 BYTE 0x0
0x000001c0 0x1 BYTE 0x2
0x000001c1 0x1 BYTE 0x0
0x000001c2 0x1 BYTE 0x41
0x000001c3 0x1 BYTE 0x1
0x000001c4 0x1 BYTE 0x12
0x000001c5 0x1 BYTE 0x4f
0x000001c6 0x4 LONG 0x0
0x000001ca 0x1 BYTE 0x1
(((_edata+0x1ff)>>=0x9)&0xff)
0x000001cb 0x1 BYTE 0x1
(((_edata+0x1ff)>>=0x11)&0xff)
0x000001cc 0x1 BYTE 0x0
(((_edata+0x1ff)>>=0x19)&0xff)
*fill* 0x000001cd 0x31
0x000001fe .=0x1fe
0x000001fe 0x1 BYTE 0x55
0x000001ff 0x1 BYTE 0xaa
0x00000200 0x1 BYTE 0x0 (start&0xff)
0x00000201 0x1 BYTE 0x4 ((start>>=0x8)&0xff)
0x00000202 0x1 BYTE 0x0 ((start>>=0x10)&0xff)
0x00000203 0x1 BYTE 0x0 ((start>>=0x18)&0xff)
0x00000204 0x1 BYTE 0xf8 (_edata&0xff)
0x00000205 0x1 BYTE 0x1 ((_edata>>=0x8)&0xff)
0x00000206 0x1 BYTE 0x2 ((_edata>>=0x10)&0xff)
0x00000207 0x1 BYTE 0x0 ((_edata>>=0x18)&0xff)
0x00000208 0x1 BYTE 0x0
0x00000209 0x1 BYTE 0x0
0x0000020a 0x1 BYTE 0x4c
0x0000020b 0x1 BYTE 0x69
0x0000020c 0x1 BYTE 0x6e
0x0000020d 0x1 BYTE 0x75
0x0000020e 0x1 BYTE 0x78
*fill* 0x0000020f 0x1f1
0x00000400 .=0x400
*(.text)
.text 0x00000400 0xc58c
../../../../../mvme2307/lib/bootloader.o
0x00004d04 PnP_find_packet
0x0000c540 vsprintf
0x000044d0 gunzip
0x00009c64 early_setup
...
...
...
...lots of symbol definitions here
...
...
_gz_start)
0x0002f6a0
_rtems_size=(__rtems_end-__rtems_start)
.bss 0x00020200 0x1154
*(.sbss)
.sbss 0x00020200 0x10
../../../../../mvme2307/lib/bootloader.o
0x0 (size before relaxing)
0x00020200 fixed_td
0x00020204 fixed_tl
0x00020208 fixed_bl
0x0002020c fixed_bd
*(.bss)
.bss 0x00020210 0x4
../../../../../mvme2307/lib/bootloader.o
0x00020214 .=ALIGN(0x4)
*fill* 0x00020214 0xc
COMMON 0x00020220 0x1134
../../../../../mvme2307/lib/bootloader.o
0x0 (size before relaxing)
0x00020220 fixed_mem
0x000212c0 v86_private
0x00000455
__bss_words=(SIZEOF(.bss)>>=0x2)
0x00021354 __size=.
/DISCARD/
*(.comment)
OUTPUT(o-optimize/hello.bin binary)
.stab 0x00021354 0x14fc4
.stab 0x00021354 0x14fc4
../../../../../mvme2307/lib/bootloader.o
.stabstr 0x00036318 0x25322
.stabstr 0x00036318 0x25322
../../../../../mvme2307/lib/bootloader.o
-------------------------------------------------------------------------------
If I load this and run it from 00000000 it hangs. There ws a suggestion
that the
entry might be at 00003000; running it from there gives illegal
instructions.
Does it look like the script does the right things? If so, what am I
doing wrong
with the load process?
> As an aside, the current .exe is probably in elf and is being
> loaded raw into your PPC memory. That is the reason for the fault.
Yes, of course, you are right. The 'illegal instructions' were 'E' 'L'
'F'.
Pete.
More information about the users
mailing list