Vector Table

James Yates j.yates at quartzuk.com
Thu Nov 13 10:08:18 UTC 2003


After some investigation into the Sh2 support which I am working on, it has become clear that 
the reason I am having problems is because my Vector table is infact empty. What I want to do
is add some code in start.s called just before main() is called to fill the vector table with
the address of a default ISR handler which when called will look at the hardware_vector table
and call the relevant installed ISR if there is one. I see there is a function 
void __ISR_Handler( unsigned32 vector) which does this but requires the vector number as an
argument.

Can you point me in the direction of the correct way that at runtime, or at link time I can 
make sure the vector table is filled. I am pretty stuck with this.

Running through my GDB stub via serial connection I have seen that early_hw_init() is entered,
by setting leds. As a test I modified the PC to point to the rtems_task Init() routine and 
the program ran. I think that once I manage to sort this problem out with the vector table,
everything will kick into life.

	Can anyone help? I would really appreciate it.

		James Yates

-----Original Message-----
From: Ralf Corsepius [mailto:corsepiu at faw.uni-ulm.de]
Sent: 12 November 2003 02:47
To: James Yates
Cc: Rtems Users (E-mail)
Subject: Re: Vector Table


On Tue, 2003-11-11 at 15:10, James Yates wrote:
> Can anyone tell me why my vector table is empty? When I run the hello
> sample application, it fails to run but think this is something to do
> with a missing vector table.
> 
> See part of map file below:
> 
> .monvects       0x00000000        0x0
>                 0x00000000                _monvects = .
> 
> .monram         0x008d1000        0x0
>                 0x008d1000                _ramstart = .
> 
> .vects          0x00800200        0x0
>                 0x00800200                _vectab = .
>  *(.vects)
>                 0x00800600                . = 0x800600
> 
> .interp
>  *(.interp)
Looks like an excerpt of an sh1/sh2 linker script to me (I am the
original author) ;)

The .monvects sections is assumed to be located in ROM, and therefore is
not initialized by RTEMS images.

The .vects section is assumed to be initialized by the compiler's
startup code and/or RTEMS initialization code.

Background: Our boards, the gensh1-BSP is derived from was equipped with
a ROM containing a gdb-stub, CMON-support (Hitachi debugger) and
board-initialization code. All RAM was battery-backed. We used gdb over
a serial to download images, and could boot either from ROM (through
gdb) or directly from preloaded images in battery backed RAM.

Therefore, we could use 3 different vector tables, 1 in ROM, 1 initial
vector table in battery-backed RAM (treated read-only) and the actual
(dynamic) vector table in RAM.

May-be this explains your confusion about the SH-vector tables.

Ralf





More information about the users mailing list