Friday, 27 February 2009

Windows CE 5.0: Virtual Memory Consideration

Windows CE is a 32-bit OS so we can address 4 GB (0x0000.0000 to 0xFFFF.FFFF) of virtual memory. The Windows CE 5.0 Virtual Memory Map looks as follows:

  • The upper 2 GB is kernel space

  • The lower 2 GB is user space which is separated into 34 slots of 32 MB each for application execution and shared memory. In slot 0 resides a pointer to the currently executed application, slot 1 is used for shared user DLLs (called XIP = execution in place) so that those DLLs do not need to be loaded into each process space again. Slot 2 to slot 34 can be used to load applications. So you can run up to 32 applications with 32 MB of virtual memory each.


Now I want to focus on slot 0. Each DLL that is loaded into your system that is NOT an XIP DLL (those are in slot 1) will be loaded into slot 0 from top down. This is also true for DLLs that your currently running process has NO access rights for: if your process were to load an additional DLL it will be placed below the already loaded DLLs regardless of whether or not your process has access rights to them. This is to prevent your process from overwriting any preloaded DLLs. So you see in order to ensure that your process is capable of loading DLLs, it is necessary to reserve the space where preloaded DLLs reside even though your process might not have access rights to all of them. This of course reduces your 32 MB of virtual memory process space. This problem is known as the congestion of slot 0. To make things worse each DLL will be loaded 64 KB aligned and therefore decrease virtual memory even further due to fragmentation.


So, what can we do to solve this problem? Well the easiest way would be to move all DLLs to the XIP slot which can only be done in the image namely by placing them in the MODULES section in the corresponding .bib file.
But what if we do not have the sources for the image? How now brown cow??
Well in this case we have really got a problem and we have to bite the bullet one way or another:
  • We could at least create one large DLL rather then a lot of small DLLs to avoid fragmentation. The downside of this solution is that applications that do not need the functionality still have the virtual memory reduction.

  • Or we could build a LIB rather than a DLL and link that LIB to each application that needs the functionality. As you probably guessed, there is also a downside to this solution namely that you will need the extra physical memory for each application that links to the here created LIB. Of course applications that do need the functionality exported in the LIB still need the virtual memory as well but this time in there process code which is loaded from bottom up.

So you see either way you are not in the clear here; quite the conundrum!

Have fun!
Read more! Post this to a friend!

Can't find import 2508 in coredll.dll using Windows CE 5.0

Hello guys,

during build of Windows CE 5.0 image I got the following error:
Error: Can't find import 2508 in coredll.dll

This message indicates that some symbols required by the components of the Windows CE Image have "unresolved" symbols. Usually the easiest way to find out the missing function names is to check the correspondig *.def file.
In our case: coredll.def, it can be find under:
%WINCEROOT%\PUBLIC\COMMON\OAK\LIB\%CPU%\...
Open the coredll.def and check wich function has ordinal number 2508. "Usually" :) you fill find the number, the name of the required function and name of the SYSGEN variable and this is the hint for you which catalog item is missing in you Windows CE Image.

But ...
in our case (= ordinal numer 2508), under circumstances you won't find this ordinal number in your coredll.def file.
The ordinal numer 2508 represents "CeSafeCopyMemory" function which is already included in CE 6.0, but not supported "out of the box" in CE 5.0.

But ...
the "CeSafeCopyMemory" function has been added to the coredll.def file by MS thru the QFE (May 2008). Unfortunately this *.def file "update" was not mentioned in the corresponding QFE summary htm file or the list of "modified" source files (which is displayed after succesful QFE installation).

Summary:
if you're missing the ordinal numer 2508 in your Windows CE Image, then install the dedicated QFE (May 2008) or even better install the yearly QFE package which includes all QFEs!
This problem shows again how important is the installation of the latest QFEs just to keep your Windows CE environment up to date!

Thanks!
Read more! Post this to a friend!

Thursday, 26 February 2009

DevKit for the .NET Micro Framework 3.0 available

The guys from AUG Elektronik in Austria have just started delivering their AMI DevKit for the .NET Micro Framework 3.0. They've done a really good job and you really get your money's worth. The Kit comes in a ESD-Box along with power supply, cables and a USB-stick containing documentation and installation files.

Have a look at the benchmarking they did using Pavel Bansky's Tetris.

Look forward to seeing you at the Embedded World, Andreas.

So long and thanks for all the fish!

Read more! Post this to a friend!

Monday, 23 February 2009

Countdown commencing ...

in just over a week The embedded world 2009 Exhibition&Conference - the world's biggest get-together for the international embedded community - takes place in Nuremberg from 3-5 March with some 700 exhibitors.

As there will be a lot going on around Windows Embedded I wanted to make sure you get all the information you need to make sure your trip to Nuremberg is every penny worth.

The Microsoft Windows Embedded Team, Hall 11, booth 11-318 will be presenting together with their partners solutions around Windows Embedded CE, Windows Embedded Standard, PosReady and NavReady.

Microsoft's Automotive Business Unit, Hall 11, booth 11-414 will be presenting the latest version of their Microsoft Auto platform, alongside a variety of partners showing different integration solutions that are based on the Microsoft Auto platform.

Continental will be introducing its latest version of the Multi Media Platform while Elektrobit will be demonstrating a fully integrated navigation solution with LS4D. K2L will be showing its MOST-Integration and Magneti Marelli will demonstrate its Automotive-grade internet-capable in-dash computer based on Microsoft Auto. Nuance will be demonstrating its one shot voice destination entry solution.

In addition , Microsoft is taking part in the daily Forum Speeches in Hall 11, covering the following topics:


Tuesday, 03/03/2009

10.00 - 10.30 Olivier Bloch Using Windows Embedded to build Industrial solutions from Sensors to Servers
13.30 - 14.00 Greg Baribault Adding Value to Microsoft Auto through Partner Innovations

Wednesday, 03/04/2009

10.30 - 11.00 Dr. Frank Prengel How to build custom Windows devices with Windows Embedded Standard
13.30 - 14.00 Walter Sullivan Announcing Microsoft Auto 4.0

Thursday, 03/05/2009

10.00 - 10.30 Olivier Bloch Building Real Time Systems with Windows CE
13.30 - 14.00 Greg Baribault Microsoft in Automotive – The Road Ahead

And, if that isn't enough you can cut through to the technical realities of the Windows Embedded operating systems in a training workshop delivered by Microsoft and Gold Partner Direct Insight:
Tuesday, 03/03/2009
10.00 - 13.00

Wednesday, 03/04/2009
10.00 - 13.00
14.00 - 17.00

Thursday, 03/05/2009
10.00 - 13.00

So, get your bags packed and I'll see you in Nuremberg!

So long and thanks for all the fish!

Read more! Post this to a friend!

Saturday, 21 February 2009

There's a new blog in town ...

Hi folks,

for those of you who haven't been following Stefan's post on the .NET MicroFramework and GCC Support but are interested Kevin Townsend has started a new blog and added some more information around this topic.

So lets welcome this new blog and thank Kevin for sharing his experiences wih everyone.

Look forward to reading some good posts.

So long and thanks for all the fish!
Read more! Post this to a friend!

Thursday, 19 February 2009

About Optional OAL Functions

Setting up a new hardware is always fun.

You have to start with OEMInit() but you cannot debug it because KITL isn't running at this time.

All you have is some serial output and some LEDs blinking. But wait, there is no blinking ...
In OEMInit() you may initialize some optional OAL functions by assigning some global pointers.
Under CE 6 this pointers are collected to the global struct g_pOemGlobal.

I remember the first days of CE 6 with a lot of porting hints for BSP developers. But some knowledge must have vanished. You can try to search the online help for g_pOemGlobal. No results 8-(

But you can also have a look at the private code: OemGlobal.c unveils the struct and it's default values.
Now it's easy to port this CE 5 line from OEMInit():

pWriteDebugLED = OEMWriteDebugLED;

to this under CE 6:

g_pOemGlobal->pfnWriteDebugLED = OEMWriteDebugLED;

The alive LED is back to life now and I'm happy with my powerful grep tool.

Tschüß Holger
Read more! Post this to a friend!

Wednesday, 18 February 2009

Getting Started: creating your first Windows Mobile 6 app

Hallo guys,

for all of you which are new to Windows Mobile application developement, take a look at the MSDN Code Galery and get started with this overview of Windows Mobile 6 application development.
At the following link you will find a video that shows you how to create your first Windows Mobile 6 (Professional) application using Visual Studio 2008. It's very good point to start WM6 application, then this video and the sample code (shown in the video) are available for download.

Check this out!
Read more! Post this to a friend!