This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Stand-alone application working from RAM


> >>>>> Jesper Skov wrote:
>
> Jurica> forgot to write it?). So, now I am going to link my
> Jurica> application to 0x80000000 (my rom_vectors section is at the
> Jurica> beginning of code) and hope that it will work.  Otherwise, I
> Jurica> will have to go deeper into HAL...  Anyway, I wonder is there
> Jurica> maybe anything else that I should care about?
>
> Yes, that might do it.
>
> Alternatively have the hal_memc_init macro copy the vectors there. I
> have the below (in a still not published platform HAL):
>
> (from platform.inc)
>
> #if !defined(CYG_HAL_STARTUP_RAM) || !defined(CYGSEM_HAL_USE_ROM_MONITOR)
>         .macro  hal_memc_init
>         <possibly init memory controllers here!>
> #if !defined(CYGSEM_HAL_USE_ROM_MONITOR)
>         // If we don't play nice with a ROM monitor, copy the required
>         // vectors into the proper location.
>         la      t0,0x80000000           # dest addr
>         la      t1,utlb_vector          # source addr
>         la      t3,utlb_vector_end      # end dest addr
> 1:
>         lw      v0,0(t1)                # get word
>         addi    t1,t1,4
>         sw      v0,0(t0)                # write word
>         addi    t0,t0,4
>         bne     t1,t3,1b
>         nop
>
>         la      t0,0x80000180           # dest addr
>         la      t1,other_vector         # source addr
>         la      t3,other_vector_end     # end dest addr
> 1:
>         lw      v0,0(t1)                # get word
>         addi    t1,t1,4
>         sw      v0,0(t0)                # write word
>         addi    t0,t0,4
>         bne     t1,t3,1b
>         nop
> #endif
>         .endm
> #define CYGPKG_HAL_MIPS_MEMC_DEFINED
> #endif
>


Thank you for the code - it helped me a lot since I didn't have to write it
by myself :-).
Only thing I had to modify is destination address of 'other_vector' because
my MIPS R3041 has general exception vector at 0x80000080.
Nevertheless, I am worried about using cached kernel segment in
'hal_memc_init' because cache is not yet initialized ('hal_cache_init' is
called latter).

Best regards,
Jura



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]