WinCE 6.0 & WinCE 7.0: Image Size Comparisons
As I started to look into the differences, the first thing that struck me was the image size. I was really seeing something drastically different in the image size when I compared the Windows CE 6.0 image of the Alioth platform and the Windows Embedded Compact 7.0 of Alioth.
I created an OSDesign with selected components (not exactly minimum) for a GUI based build, in my Alioth platform in CE 6.0. The “Release” Image size was around 8.5MB. I booted up the OS and checked to find everything working as expected. A cool GUI based build in 8.5 MB without any effort to optimize it..Hmmm..Sounds good..
Then I moved on to my WEC 7 development platform and built an exact replica of the features with WEC7 BSP for Alioth. The “Release” Image size was around 25MB. Wow that was some 300% more of binary size…
This sounded strange. How could the same set of features create a 300% increase? I started to explore and found a few things which I am sharing in this blog.
As you all know Windows CE has a lot of inter-related dependencies and components keep piling up as dependencies add up as a chain. Well that’s what we used to face with Windows CE 6.0 as well. Yet… the size was never got that big for WinCE 6.0. So checked the dependencies of individual components one by one for both Windows CE 6.0 and WEC 7.0
There were 2 main components that were having a number of dependencies
- Standard Shell
I had included the ActiveSync for my connectivity and debugging and Standard Shell for the base GUI and Desktop.
The Standard Shell seemed to have the most dependencies. And many dependencies did not crop up with the WCE 6.0 image that I built. I am presenting the snapshot of the WEC 7 dependencies for you to have a look. It is marked for your convenience, to spot the new dependencies that cropped up with WEC7.
The new modules that I see on the dependency list, most of them point towards the Internet Explorer, Windows Internet Services and Cryptography (again because IPsec??).
Ieframe.dll occupies some 1.3 MB of space in the image. It seems to hold the user interface and window of IE in Internet Explorer 7, if I go by what the architecture of IE7 says. Why is the User Interface of Internet Explorer required when I have chosen only the standard shell and have not selected the Internet Explorer at all? I don’t think I have a clear answer or logic behind this as of now.
There are a host of Dlls, like the wininet, rpcrt4.dll, etc. which all have been included to support the “internet”.
All these Dlls (marked in my picture above) comes closely to 5MB of my image space.
WEC 7 forces to include the internet and IE related components even if I just enable the standard shell why is that? This was not the case with Windows CE 6.0
Apart from the size, does including these components have an effect on the security or performance? Let me delve more into this and see if I can come with another blog.
The ActiveSync has some dependencies ()as well. Some notable dependencies are
Windows Codecs – windowscodecs.dll – 1 MB
XML MIME Viewer, XQL, XSLT, etc – msxml3.dll ~ 1 MB
syncmanager.dll ~ 1MB
Database – Sqlcese35.sys.dll – 0.5MB
There are a host of other small components which all add up to the size as a whole. The ones mentioned above are the big ones and some seem out of place, especially the “Windows Codecs”. Why should be a dependency for ActiveSync?
Stripping the image of the Standard Shell and Active Sync brought the image down to 8.5 MB. That was a reduction of around 14.5 MB.
A table of the size comparisons is presented below for reference and comparison.
|Sl No||Build – Components Included||Windows Embedded CE 6||Windows Embedded Compact 7|
|1||Minimal build with Standard Shell & Active Sync||8.5 MB||25.0 MB|
|2||Minimal build with Standard Shell||7.5 MB||18.2 MB|
|3||Minimal build (No shell and No Active Sync)||4.9 MB||8.5 MB|
General Increase in Size of Dlls
While the NEW dependencies introduced in the WEC 7 contribute for one bulk of size increase, there are other factors like the size of the common dlls have gone up to an extent as well.
The common libraries like gwes.dll, coredll.dll, kernel.dll, commctrl.dll, etc. have gone up by 20 – 25% size. Ofcourse, WEC 7 has improved features and so the mild increase in size of these dlls is acceptable.
Likewise, the driver dlls that we build for our board also go up by some 10 – 20%, again owing to changes in WEC7.
I also read this post on the msdn forums
They say, the default page alignment size is 4KB in WEC7 and not 512 bytes. Some of the MVPs have already taken this size issues up with the Windows CE Core team and hoping for some solution on this.
However, more than default page alignment size, the thing that causes concern with WEC 7 size increase is the forced dependencies for common features like Standard Shell and Active Sync.
“When I build an embedded device, I would like to build things from scratch including/excluding each component voluntarily (fully knowing what its impacts are) rather than include some components just for the sake of DEPENDENCY…” –
Is there anyone from Windows Embedded Community who knows why these dependencies came to be part of the WEC7? … And throw some more light on this topic.