Thursday, 11 December 2008

Windows CE: Config.bib best practice

Hi everybody,

In this post I want to talk a little about the AUTOSIZE macro which can be used in the CONFIG section in the config.bib file. But let’s start with the MEMORY section which can also be found in your platforms config.bib file.

Here are, amongst others, the defines for where your image will run (NK) and where your images RAM will be located (RAM), of course none of the regions defined here should overlap or else it is possible to overwrite your own memory and crash your system. Initially, the memory regions for NK and RAM are fixed up as you set them up here; hence you might waste some memory at the top of the NK region as your image might not be exactly as large as you defined the NK region to be. This is where the AUTOSIZE macro in the CONFIG section comes into play: it increases the RAM of your image by the unused size of your NK region. But why am I telling you this? You can easily find this in the MSDN!

Well this is where it gets interesting as there is ONE pitfall here:

The AUTOSIZE macro only works if:

  • The NK region is BELOW the RAM region AND
  • The NK region and the RAM region are adjacent

Have fun!

1 comment:

Anonymous said...