From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jurica Baricevic" To: "Jesper Skov" Cc: "Ecos" Subject: RE: [ECOS] Stand-alone application working from RAM Date: Thu, 20 Jul 2000 07:52:00 -0000 Message-id: <002801bff259$d0cefb20$6b00a8c0@JURA> References: X-SW-Source: 2000-07/msg00195.html > >>>>> 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 > > #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