This evening someone posted a question about setting IMGRAM64 in the Platform Builder newsgroup. The environment variable IMGRAM64 has always intrigued me for several reasons, so I thought that I would examine some of those reasons.
1.       IMGRAM64 is in the project settings Build Options. In Platform Builder 6.0 it is in Project\Properties and in previous versions of Platform Builder it is in Project\Settings. This has amazed me since the first time I saw it there because most BSPs do not support this variable.
2.       The description of IMGRAM64 is extremely vague. The description is “Run-time image can be larger than 32 MB (IMGRAM64=1).” What does that mean and why would anyone select it without needing more information?
3.       Why isn’t IMGRAM64 a catalog component for the BSPs that support it. That would really make sense wouldn’t it? If it were a catalog component, then there could also be catalog components for the other image sizes that the few BSPs that support it also support. CEPC, one of the rare BSPs that do support IMGRAM64, also supports IMGRAM16 and IMGRAM32 but there isn’t a built in method to set those.
Okay, so I vented about IMGRAM64. Now what does it actually do?
To answer what IMGRAM64 does, I strongly recommend obtaining and using a good search tool. There are just too many files and file types in a Platform Builder project and BSP. If you don’t have a good search tool to find things that you need, you are going to have trouble developing a Windows CE project.
The search tool in Visual Studio is okay, but I have a lot more success with Grep. Grep is a command line search tool, and as such is a cryptic to use so I actually use Examine32. Examine32 performs Grep like searches within a GUI. When I search, I usually include the following file types: *.c *.h *.cpp *.hpp *.bat sources *.bib *.reg *.s *.inc *.def. *.pbcxml. That isn’t a complete list of the file types that need to be searched with developing a Windows CE project, but it gets most of what I need.
Now that we have a good search tool, we can search the build tree to find out how IMGRAM64 is used. I will give you some of my expertise here and tell you that it is only used in the Platform folder, so you can restrict your search. But you really only care about the BSP that you are developing against, so search it. Since I want to find an instance of IMGRAM64, and since I already said that the CEPC uses it, search the CEPC BSP.
The CEPC has exactly on instance of IMGRAM64, it is in Files\config.bib. The section of config.bib that uses looks like this:
    #if defined IMGRAM16
       ; 16 MB of RAM (note: AUTOSIZE will adjust boundary)
       NK       80220000 009E0000 RAMIMAGE
       RAM      80C00000 00400000 RAM
    #elif defined IMGRAM32
       ; 32 MB of RAM (note: AUTOSIZE will adjust boundary)
       NK       80220000 009E0000 RAMIMAGE
       RAM      80C00000 01000000 RAM
       UMABUF   81C00000 00400000 RESERVED
    #elif defined IMGRAM64
       ; 64 MB of RAM (note: AUTOSIZE will adjust boundary)
       NK       80220000 009E0000 RAMIMAGE
       RAM      80C00000 03000000 RAM
       UMABUF   83C00000 00400000 RESERVED
       ; 28 MB of RAM (default) (note: AUTOSIZE will adjust boundary)
       ; This value will cause the RAM auto-detect feature to trigger
       NK       80220000 009E0000 RAMIMAGE
       RAM      80C00000 01000000 RAM
Ordinarily, I don’t post the code installed with Platform Builder, but this seems harmless and really adds to the discussion.
What we can see from this is that when IMGSIZE64 is set, or defined, the RAM size is larger than it is with other sizes. That makes sense. More important we can see that there are only 4 sizes that are predefined for the CEPC; 28 MB (The default), 16 MG, 32 MB and 64 MB. That means that we cannot just make up a new IMGRAMXX without also adding it to config.bib.
For more on config.bib see Platform Builder: Config.bib
Copyright © 2009 – Bruce Eitman
All Rights Reserved