Where can I learn about memory mapping principals?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where can I learn about memory mapping principals?

963 Views
VTS
Contributor I

I’m a Windows app developer and now I have to take on HC08 firmware after the previous developer has quit. My problem is that I don’t understand memory mapping. I can see in the .map file how linker puts various functions/variables into the sections defined in .prm file and those sections match CPU’s memory map. But where is it defined where every particular function or variable will be placed by the linker? Then, there is .text or .rodata sections not defined in .prm file – what are those?

 

Please advise of any learning resources I can use that’d address my ignorance.

 

Thank you.

Labels (1)
0 Kudos
1 Reply

206 Views
J2MEJediMaster
Specialist I

You have your work cut out for you. Let us see what can be done to help.

 

First and as an immediate answer to your question, the section .text is where program code goes. The .rodata section means read-only data, which is generated by the compiler in response to constant declarations in the source code. Those objects show up automatically as part of the code-generation process. You might normally not see anything on them in the .prm file, because in many cases the linker is going to pack the invariant code and data constants into a part of the memory map where the Flash memory resides. In special cases, you can add commands to the .prm file to affect where these items go in the memory map.

 

The major thing to do right now is Google for "ELF file format", which is the format most embedded tools generate as the final executable or library. Study those references to become familiar with the various elements of the ELF file, such as .bss, .data, and others. Good luck!

 

---Tom

Message Edited by J2MEJediMaster on 2009-06-23 11:23 AM
0 Kudos