This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to map a library to absolute address?

I need to set the address where the library I've included will reside in the code memory

Parents
  • Ok, i'm using extended 8051 microcontroller which supports MMU(memory management unit). the MMU manage the access of the memory for both System mode and User mode. the MMU is configured to enables the user mode to execute the code in defined memory area, those memory areas are defined inside MMU in records table which is limited in size. So I want to collect all the libraries in one defined area in one record to enable the user mode to use them.

Reply
  • Ok, i'm using extended 8051 microcontroller which supports MMU(memory management unit). the MMU manage the access of the memory for both System mode and User mode. the MMU is configured to enables the user mode to execute the code in defined memory area, those memory areas are defined inside MMU in records table which is limited in size. So I want to collect all the libraries in one defined area in one record to enable the user mode to use them.

Children
  • So I want to collect all the libraries in one defined area in one record to enable the user mode to use them.

    And how is the non-library code outside that region supposed to get its execution privileges?

    And once it has them, how will that set-up be any more useful than the obvious approach, in which the entire exectuable, library and all, is set up as a single MMU execution region?

  • OK - and you didn't think it necessary to mention these minor, trifling details at the start?!

    That really is a very esoteric system for an 8051!

    I would suggest that you start with the manufacturer's technical support - they should know how they expected people to be able to use this stuff...

    If you have a Keil licence, try asking Keil support (I'd imagine that you probably do need a full licence to take full advantage of such features)

    Perhaps you can look at the Linker Map file to identify the code sections from the Library, and then use Linker controls to place them...?

  • And once it has them, how will that set-up be any more useful than the obvious approach
    those libraries provides service functions for user mode. for example, one library may include a function like memcpy(). The approach is not to prevent the user mode from executing those libraries, I'm concerned to prevent the user mode from accessing the other regions.

  • first, thank you for your replies.
    That really is a very esoteric system for an 8051!
    I thought mentioning the tool c51 is enough ... my bad.

    Perhaps you can look at the Linker Map file to identify the code sections from the Library, and then use Linker controls to place them...?
    that works only with the modules included in .c files not for libraries, the linker refuse to define an absolute address for the segments of the code in the library.

    I'll try to contact keil support, thanks again.

  • I'm concerned to prevent the user mode from accessing the other regions.
    Then I suggest you put those other parts of code into a decidated region, which you can configure as system-mode only.

    But before you make any further step, you really need to sit down and learn a lot about how the '51 tools work. This is a highly unusual C toolchain, for which a lot of things that would apply cleanly on almost every other system, just don't.