In embedded systems, like Windows CE, it is possible to have more bytes in the Operating System (OS) than there is space to store the OS on the device. It is also possible to have more bytes in the OS than you have allocated for saving the OS on the device. The first could be a bigger problem than the second.
The Board Support Package (BSP) contains a file that allocates space for the OS. The file is config.bib (for more on config.bib see Platform Builder: Config.bib.) The space for the OS is allocated by defining a RAMIMAGE memory section. Example:
        NK      8028D000 01900000 RAMIMAGE     ; 25MB image space
The example allocates 25MB of space in RAM at virtual address 0x8028D000 for the OS, but the space could also be allocated in ROM or flash.
If at some point in the development process the OS size becomes larger than 25MB makeimg will tell you about the problem. In Windows CE 6.0, makeimg will fail with a message in the output that says “Error: Ram start overlaps rom binary.” But in previous versions makeimg will simply output a warning message that says “Warning: Image exceeds specified memory size by 14386724 bytes and may not run.” In both cases makeimg will create an nk.bin, but it will most likely not run on the device.
The options that you have when this happens are:
  1. Allocate more space for the OS
    This option is available to you if you have more space available to allocate.   If this is an option for the device, then the nk.bin that was created can be helpful because its size is approximately the size that the OS needs. So if the nk.bin is 29.5MB, change config.bib to:
   NK      8028D000 01E00000 RAMIMAGE     ; 30MB image space
But, this change might mean that the RAM allocation must also change or that the starting address of the OS must change, or both. If the OS is in ROM, then other things might need to change as well, like allocation of a flash disk.
2. Reduce the size of the OS
This most likely means removing catalog features that have been added to the OS
3.       Turn on AUTOSIZE
In the bib file CONFIG section set AUTOSIZE=ON. This tells makeimg to automatically adjust the RAMIMAGE and RAM settings to either add more RAM to the system if the OS is smaller than the allocated space, or make RAM smaller if the OS is larger than the allocated space. AUTOSIZE is only an option of the OS runs in RAM though.
4.       Change the hardware
This option usually is not easy, but you could add more RAM or ROM to the system.
You may also want to look at my Summary of BIB File Posts
For more on the Platform Builder build system take a look at: Summary of Building Windows CE which lists the articles that I have written about building Windows CE using Platform Builder.
All Rights Reserved
Copyright © 2009 – Bruce Eitman