Vector Table

James Yates j.yates at quartzuk.com
Wed Nov 12 10:22:30 UTC 2003


Thanks for your help. My big confusion here is this:

I don't understand how the whole vector mechanism works. Before I used RTEMs, my vector table was placed at 0x800200, my VBR set to this. Starting the app residing in RAM was simply a case of setting the VBR to 0x800200 and performing a jump to the address held in the first location of the vector table. The address of each vector's code stored in the vector table. As a result, when my code is copied from ROM(0x200000) to RAM (0x800000) as the vector table at 0x800200 is not valid, I can't then run the code, even if I perform a jump to the address of _start, nothing will still work due to the invalidaty of the VBR. 

   I would assume that every address stored in my vector table should be the address of a routine which then looks up the relevant address in the _Hardware_isr_Table and then jump to this address if valid. I guess i need to add some code to make my vector table valid, But I am unsure what to do.

	Have you any ideas you can offer?

	Many Thanks.


		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