Determine OS Size Using Viewbin (Compact 2013)
3/26/2014
Windows Embedded Compact 2013 provides two tools that you can use to determine total OS size in ROM, the Viewbin tool and Platform Builder. This topic discusses how to use the Viewbin tool to determine the total amount of ROM space that an image occupies on a device. The Viewbin tool provides the most accurate information about ROM usage by displaying usage data, such as the Table of Contents pointer (pTOC) information, in the nk.bin header.
Viewbin is provided with Compact 2013 in %_WINCEROOT%\public\common\oak\bin\i386. For more information, see Viewbin Tool.
Tip
In addition to using the Viewbin tool, you can open the nk.bin file in Platform Builder to view such information as file names and attributes or registry entries. You can use this information to determine whether your image contains unnecessary files or modules, or whether a module is larger than expected, for example. For more information, see Determine OS Size Using Platform Builder.
To determine ROM image size using the Viewbin tool
In Platform Builder, right-click the name of your OS design in Solution Explorer, and then click Open Release Directory in Build Window.
At the command prompt, type viewbin -t nk.bin. The
-t
option prints a table of contents for the OS image.You can also use Viewbin with the
-t
option to display other information about the contents of ROM, such as the total number of modules and files that are included in the OS. For example, you can use these totals to determine whether any modules or files were added between builds. However, because the Makeimg process strips out most of the file information, only limited information is available in nk.bin to perform a detailed size analysis. Therefore, you may want to analyze the individual module and file sizes and the OS configuration as described in Determine Module or File Size in ROM to gain more detailed information about what is contributing to the OS size.Examine the output: The entries for
Physical First
andPhysical Last
indicate the exact start and end addresses of your OS in ROM on the device. The difference betweenPhysical First:
andPhysical Last:
is the actual size of your ROM image. In the example below, the size of the ROM image is 0x2AF3828 (approximately 45 MB).
Found pTOC = 0x8aaf1800
ROMOFFSET = 0x00000000
ROMHDR ----------------------------------------
...
Physical First : 0x88001000
Physical Last : 0x8AAF4828
...
Num Modules : 282
Num Files : 115
CPU : 0x01c2 (Thumb)