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

Building an OS for C164 with apps in RAM

Hi,

I'm quite new in microcontroller development so I have some question to discuss.

We are building an application for a C164 from Infineon. Where the application is split in an OS and a end user app running in RAM only. But this is not only a simple downloader as it was posted earlier.
Our evaluation got:

- OS and RAM app are in HLARGE
- OS is stored in flash and contains a few functions, which are later called from the RAM app
- the OS stores the addresses of the "exported" functions in an array of function pointers at a fixed address
- the RAM app is compiled seperately
- the startup code of the RAM app is modified, not to initialise the µc but only to set the DPP's and initialise the global variables.
- the 'main' function is called 'kmain' and linked at a fixed address and gets called from the OS after download

The problems are with the DPP's. How do I handle the DPP's?
DPP3 is always the system area, DPP0 is not used. But what is with DPP1 and DPP2? For speed reasons I want to use consts and near variables. One solution is to save and restore DPP1 and DPP2 in every "exported" OS function. Again what happens with the stack, the stack is initialised in the OS and uses DPP2. The RAM app uses the stack from the OS so DPP2 should be the same. What is with other near variables???
A lot of open questions, so who can help???

Thanks for any suggestions and hints

Bert Weber