Tuesday, May 20, 2008

WinCE - Share a data segment in a DLL

Introduction
A DLL can be loaded by more than one process. For every process the DLL's code segment is shared but each process gets its own data segment by default. Therefore if one process changes the value of the DLL's global variable, the other process can not get the modified value. For sharing some global variables of the DLL among several processes, we can use the shared data segment.

Example Code
// Global and static member variables that are not shared defined here.
...
// Begin the shared data segment
#pragma data_seg("SHARED")
// Define simple variables, the variable must be initialized here, otherwise it will not be shared.
int gSharedTest = 0;
// Do not define classes that require 'deep' copy constructors.
#pragma data_seg()
// End the shared data segment and default back to the normal data segment behavior.
// Tells the linker to generate the shared data segment.
#pragma comment(linker, "/section:SHARED,RWS")

Remarks
1) The upper "SHARED" is the name of the segment, you can use another name. It should be appeared both in the data_seg and comment part.
2) The address of the shared variable must lie in this data segment, so variables allocated from heap can not be shared.
3) The variable must be initialized otherwise it won't be shared.
    

Wednesday, May 7, 2008

Major automaker adopts Microsoft Auto















Microsoft has announced a new design win for its Windows CE-based automotive technology, Microsoft Auto. The Hyundai-Kia Automotive Group (HKAG) will use the product in a voice-controlled infotainment system to be available in its 2010 vehicles, the companies announced.



HKAG has primarily been associated with economy cars, but recently introduced a flagship, rear-wheel-drive sedan, the Genesis (shown above), in which Microsoft Auto-based technology is likely to make its debut. Calling HKAG's forthcoming infotainment system "comparable to a mini PC," Microsoft said the system will boast firmware updates via USB storage devices, a claimed first for in-car systems.

The as-yet-unnamed HKAG system will be based on Microsoft Auto, recently quietly updated to version 3.0. The software now allows a USB device to be brought into a car as a means of updating installed programs. Uninstallation of applications is another new feature, according to Microsoft.

Other features listed by the company for Microsoft Auto 3.0 include:
  • Bluetooth integration, allowing music streaming and Internet access via a mobile phone
  • Control of media players such as the Microsoft Zune, Apple iPod, and Creative Zen, along with multiple audio zones
  • Cellular phone control, including conferencing, call waiting, and text-to-speech reading of SMS messages
  • The .NET Compact Framework
  • Internet Explorer-based web browsing
  • GPS

Microsoft Auto technology has had many names
(Click image for further information)
Microsoft Auto was originally referred to by Microsoft as Windows Automotive (2003) and Windows Mobile for Automotive (2006). Rebranded by auto manufacturers, it first made its debut in Europe and South America on Fiat vehicles, where it is known as Blue&Me. More recently, it has been offered in the U.S. by Ford as Sync, on passenger cars, and as Ford Work Solutions on pickups and vans.

According to data sheets published by Microsoft, a key part of the Microsoft Auto reference design is the i.MX31 SoC (system-on-chip), first shipped in 2006. The i.MX31 integrates an ARM1136 processor core along with a Java accelerator, a vector floating point math coprocessor, and a video processing engine that supports full-motion (30 frames/sec) VGA video. It also contains a host of system functions and peripheral interfaces .

Freescale says its automotive-grade versions of the i.MX31 have achieved the Automotive Electronics Council (AEC) Q-100 qualification. Among the parameters required to achieve this rating, operating temperature is said to range from -40 degrees to 85 degrees C temperature range.

A Microsoft Auto reference platform offered by Microsoft is said to include:
  • Windows CE 6.0 core operating system
  • 256 MB NAND flash memory, 64 MB DDRAM
  • Bluetooth connectivity
  • Vehicle bus interface
  • Microphone for voice interaction with system
  • Support for multiple audio zones
  • USB 2.0 host connections
  • JTAG, Ethernet, and serial debug interfaces
  • DVI output
  • Cell phone module compatiblity
  • GPS receiver capable
In-car applications using Microsoft Auto are not likely to start resembling desktop editions of Windows. The technology offers a "clear separation of the human-machine interface from the core application logic," allowing automakers to easily differentiate their systems, says Microsoft.

Martin Thall, general manager of Microsoft's automotive business unit, said "These new systems will redefine consumer experiences in the car. Since the spring of 2006, HKAG and Microsoft have been sharing their vision for the future of in-car technology. We're now aligned to develop the next generation of in-car infotainment systems."