EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Remapping to Processor code region Vs Without remapping

Started by mohsenzandie December 7, 2017
What is the differences between:  
1.Remapping memories to processor code region and 
2.Executing the program code built with absolute addresses without
remapping
I read something about executing multiple image in a microprocessor (ARM
Cortex-M3) and i'm ambiguous about differences between executing with
remapping image to "code space" and without remapping?
I would be grateful if you help me to understand these two concept
clearly
thanks


---------------------------------------
Posted through http://www.EmbeddedRelated.com
On 12/7/2017 7:42 AM, mohsenzandie wrote:
> What is the differences between: > 1.Remapping memories to processor code region and > 2.Executing the program code built with absolute addresses without > remapping > I read something about executing multiple image in a microprocessor (ARM > Cortex-M3) and i'm ambiguous about differences between executing with > remapping image to "code space" and without remapping? > I would be grateful if you help me to understand these two concept > clearly
It sounds like you're asking about how relocatable code works. Relocatable code is code that has little to no absolute memory references. That means it can (in theory) run successfully at any start address and references memory objects loaded at user defined addresses. I'm no expert about relocatable code technology. Google will probably give you a sufficient number of matches if you give it "how does relocatable code work". I believe many modern tool sets can build relocatable code as an option. JJS
On 08/12/17 02:42, mohsenzandie wrote:
> What is the differences between: > 1.Remapping memories to processor code region and > 2.Executing the program code built with absolute addresses without > remapping > I read something about executing multiple image in a microprocessor (ARM > Cortex-M3) and i'm ambiguous about differences between executing with > remapping image to "code space" and without remapping? > I would be grateful if you help me to understand these two concept > clearly
It sounds like you are asking about Harvard architecture machines. These have program memory, and data memory. Instructions are fetched from program memory, never from data memory. Data cannot be fetched from or written to program memory (except using special features). That means to be able to load and execute a program, there must be some special way to store data into program memory before executing it.
On 07.12.2017 г. 19:59, John Speth wrote:
> On 12/7/2017 7:42 AM, mohsenzandie wrote: >> What is the differences between: >> 1.Remapping memories to processor code region and >> 2.Executing the program code built with absolute addresses without >> remapping >> I read something about executing multiple image in a microprocessor (ARM >> Cortex-M3) and i'm ambiguous about differences between executing with >> remapping image to "code space" and without remapping? >> I would be grateful if you help me to understand these two concept >> clearly > > It sounds like you're asking about how relocatable code works. > Relocatable code is code that has little to no absolute memory > references. That means it can (in theory) run successfully at any start > address and references memory objects loaded at user defined addresses. > > I'm no expert about relocatable code technology. Google will probably > give you a sufficient number of matches if you give it "how does > relocatable code work". I believe many modern tool sets can build > relocatable code as an option. > > JJS
Not so sure this is what he is asking but in my vocabulary this is called "position independent code", that's how it was called back in my 6809 days :-). Means exactly the same thing of course. Last 20+ years I have been writing essentially position independent code (which is also reentrant), under dps this is "normal". One can run fixed address code and is allowed to write non-reentrant code as well but I don't know it these features work, never tried them out... :). The OP seems to ask just about pages (4k on ARM?) being mapped as executable or not, I am not familiar with the ARM MMU so this is better explained by someone else. Dimiter ====================================================== Dimiter Popoff, TGI http://www.tgi-sci.com ====================================================== http://www.flickr.com/photos/didi_tgi/
On Fri, 8 Dec 2017 08:32:19 +1100, Clifford Heath <no.spam@please.net>
wrote:

>On 08/12/17 02:42, mohsenzandie wrote: >> What is the differences between: >> 1.Remapping memories to processor code region and >> 2.Executing the program code built with absolute addresses without >> remapping >> I read something about executing multiple image in a microprocessor (ARM >> Cortex-M3) and i'm ambiguous about differences between executing with >> remapping image to "code space" and without remapping? >> I would be grateful if you help me to understand these two concept >> clearly > >It sounds like you are asking about Harvard architecture machines. >These have program memory, and data memory. Instructions are fetched >from program memory, never from data memory. Data cannot be fetched >from or written to program memory (except using special features). > >That means to be able to load and execute a program, there must be >some special way to store data into program memory before executing >it.
Some DSP's can run code from data memory, I guess it's dependant upon processor type. Cheers
On 08/12/17 11:23, Martin Riddle wrote:
> On Fri, 8 Dec 2017 08:32:19 +1100, Clifford Heath <no.spam@please.net> >> It sounds like you are asking about Harvard architecture machines. > Some DSP's can run code from data memory, I guess it's dependant upon > processor type.
In which case they aren't (strict) Harvard architectures, as I pointed out. The AVR is like that; special instructions support data reads on instruction space, which is annoyingly poorly handled by compilers for accessing constant data tables.
On 07/12/17 16:42, mohsenzandie wrote:
> What is the differences between: > 1.Remapping memories to processor code region and > 2.Executing the program code built with absolute addresses without > remapping > I read something about executing multiple image in a microprocessor (ARM > Cortex-M3) and i'm ambiguous about differences between executing with > remapping image to "code space" and without remapping? > I would be grateful if you help me to understand these two concept > clearly > thanks >
I think you are going to have to try again, explaining in a lot more detail what you are trying to do. Give information about the processor in question, and how you hope the code will work. Also make sure you are online and checking regularly for replies so that you can add information as requested. This is easier if you use a proper newsreader and newsclient, rather than a web interface like EmbeddedRelated. There are plenty of knowledgeable people here who will help you if they can, but we need to know what you are asking! (And if this is homework for a course of some sort, say so. People will try to give you helpful hints if you are honest about it.)

The 2024 Embedded Online Conference