Tuesday, June 06, 2006

wm5 device emulator: customization

the previous installment of this series focused on the bare-bones installation of mothership’s standalone device emulator & windows mobile 5 os images.

this one will be all about ideas for optimizing the emulation environment, with particular focus on using device emulator for demonstration & training purposes, rather than development.

if it helps, just think of this trip to the funlab like a funcave version of monster garage.


we’ll start by having a bit of a look under the hood, so to speak.

you’ll remember from last time that we tested the stability of the installation by launching a series of shortcuts, specifically the ones designated with coldboot.

we’ll look at one of these in more detail, but first…

!!! safety moment !!!

you can never be too careful in the funlab.

altho we don’t have to worry about losing fingers or eyes here…

your friendly neighborhood happyfunboy strongly recommends, whenever possible…

always always always work off a copy, rather than the original itself 

should go without saying prolly, but judging from some of the posting nazis that have shown themselves recently…

better safe than sorry, right?

so first make a copy of all the default shortcuts, using whatever method you prefer.

mine always prepends copy of to the name, which yours truly promptly changes to something like better or best or showtime or, in this case…


now that we’ve covered our hindparts, let’s take that look-see.

if we bring up the properties of the new shazam! pocketpc coldboot shortcut, we can see the following information in the target: field on the shortcut tab…

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" pocketpc.nb0 /memsize 128 /skin Pocket_PC.xml /vmid {f1b1af09-969d-4035-8223-b800c75f451f} /s pocketpc.dess /p /funckey 193

we want to start with the executable DeviceEmulator.exe listed in this command line.

if you browse to this executable and launch it directly, you should receive the following screen:


this screen lists every switch that can be set directly via the command line at application launch time.

in fact, if you happen to fubar the command line, and try to pass an invalid switch value to the executable, you will receive this screen again, with a quite helpful message at the very top that highlights which switch is malformed.

using the info from this screen, we can see that the following switches & values are enabled in the default pocketpc coldboot shortcut:

    •  binfile = pocketpc.nb0
    • /memsize = 128
    • /skin = Pocket_PC.xml
    • /vmid = not copied. i hate copying guids, and besides…it’s up above already
    • /s = pocketpc.dess
    • /p = auto

and one switch not listed in the screen above

    • /funckey = 193

thanks to the valiant efforts & ultimate sacrifices by some of the funlab’s dedicated test monkeys…

your friendly neighborhood happyfunboy can tell everyone the bare minimum command line necessary for the emulator to run at all:

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" pocketpc.nb0

which will include the following settings:

  • 64mb ram
  • 16 bit, 240 x 320 video display

of course, actually using windows mobile 5 with msfp with only 64mb causes an immediate warning about critically low storage memory.

if we actually execute the shazam! coldboot image using the bare minimum command, we can see which items can be changed, and which ones can’t, after the emulator is started.

can change

  • host key
  • shared folder
  • skin
  • skin or video
  • orientation
  • zoom
  • always on top
  • tooltips
  • enable ne2000 network adapter (usually requires a reset to activate)
  • host-only networking
  • serial port mappings

can’t change

  • os image (obviously)
  • rom image address
  • ram size
  • flash mem file
  • video resolution
  • enable cs8900 network adapter
  • map network adapters to specific mac addresses
  • text console for serial port 1

there are a couple of other options that can’t be enabled after the emulator has started at all, which don’t appear on the configuration dialog whatsoever:

  • enable save state
  • vmid
  • /funckey

of these, save state is perhaps most critical. without it, no save state file can be saved at all.

so…the funlab’s minimum recommended command line would contain the following:

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" pocketpc.nb0 /memsize 128 /skin Pocket_PC.xml /s pocketpc.dess /funckey 193

but for more advanced work, here’s the command line for the turbocharged shazam! model we prefer to use as a starting point at the funlab:

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" pocketpc.nb0 /memsize 256 /skin Pocket_PC.xml /vmid {superlong guid, whatever you need or want} /s ppc.dess /sharedfolder c:/vmshare /flash ppcflash.dess /p /z /funckey 193

the shazam! model features:

  • 256 mb of emulated ram
  • full pocketpc device skin
  • ability to save the running state of the device to a file called ppc.dess
  • flash memory enabled to a file called ppcflash.dess
  • shared folder enabled and mounted as a storage card
  • ne2000 network adapter available
  • 2x zoom

obviously, the save-state function enables you to save the running state of a given emulator, so you can save any modifications you’ve made to it for re-use later. 

by default, you can reload the save-state by using one of the shortcuts designated savestate.

looking at the default target field of the backup of the pocketpc savestate shortcut, we see the following command line:

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe" /s pocketpc.dess /nosecurityprompt

obviously, the bulk of the customization work could be done at the outset by the coldboot shortcut. once a save-state is available tho, then the savestate shortcut doesn’t need to do such heavy lifting.

so..even if you don’t need any other modifications saved, saving at least an initial save-state after the emulator finishes initializing and loading would capture all the modifications of the shazam! coldboot, plus give you an instant-on launch of the emulator.

very handy for demos...

unless part of the demo includes showing the mobile os load time, that is.


by the very nature of the save-state mechanism, the device emulator only tracks one save-state file at a time.

it’s easy enough to use different filenames with the save-state switch to keep multiple states archived, if need be.


it might require a bit more manual work on your part to use different filenames, but that’s how we do much of the archiving and swapping of different vpc builds at the funlab anyway.

and finally…

many of these same techniques obviously apply to the smartphone emulator shortcuts as well, altho hardware limitations for switch settings may be a tad different here & there.

but the real fireworks start next episode…

when we’ll be looking at enabling non-gprs internet connectivity for device emulator.

you’ll want to be sure to come back for that one…

as it’s the next logical step toward our ultimate goal of direct push using device emulator.

so don’t miss…

wm5 device emulator: connection

same fun time…

same fun channel… 



Post a Comment

Links to this post:

Create a Link

<< Home