Tuesday, March 15, 2005

The New Old Thing

Apart from Microsoft Word and Excel, I can't think of any applications that made smooth transitions from their previous, powerhouse DOS selves into Windows. In fact, every application that I can think of apart from the above two was either more awkward to use or had less features than its DOS counterpart. This was due to at least a few things:

  • Writing Windows apps (at the time) was harder
  • The Windows event model was more restrictive than a comparable (i.e., complete control) DOS app
  • The companies who produced these apps didn't fire their entire development team and hire Win16-proficient programmers. There was a natural learning curve as the programmers started learning how to program for Windows.
  • The shell, which had previously been subservient to the all-powerful application, was now the master. The applications were learning to accept their new, lesser role.
The net effect was usually that Application X for Windows, v1, was a buggy, clumsy product. It was followed a few months later by a less-buggy, clumsy product. These apps were usually written pre-MFC 1.0. They didn't understand the MDI interface. They didn't use standard Windows controls. Their dialogs tried to control the application instead of vice versa. And the print system was usually ported by someone who could print in ANSI codes in his sleep but was a novice when it came to device contexts and the Windows driver model. I could go on.

But I digress. That was just an illustration of the choices that we faced (granted, 10 years later) in moving our embedded app to CE. We decided to go with a two-pronged approach. The real-time part would run alongside the kernel and the user interface part would run as a stand-alone application. We would use some kind of shared memory (we didn't know what yet) to communicate between them.

The smallest timer resolution in CE is 1ms, but we needed something much more accurate. We included the profiler and overloaded the profiler interrupt to poll a little faster, like oh about 20,000 times per second. (Just a few snips here and there in timer.c.) I know that it's not the Windows Way, and now we won't be able to use the profiler. But hey, this is still DOS2Win, v1. We're allowed a few of these.

The CE OAL makes it easy to write kernel-level code via kernel IO control codes. (Course 2535, Lab 5) Writing code for custom control codes (called IOCTLs) in oemioctl.c compiles the code into the kernel, where you can call it in the application via KernelIOControl later.

Figuring out how to run code faster than 1ms and how to run in kernel mode were two big steps to porting our trusty old code to CE. But we still needed to get the apps to talk to each other, figure out how to control the real-time app from the UI app, and test the whole thing on some hardware to see if it ran fast enough. All of these were milestones that loomed large on our ever-diminishing horizon.

7 Comments:

At 3/19/2005 3:29 AM, Anonymous Anonymous said...

Thanks it was another fantastic post. It is better than a detective novel!:)

I realy like your style.:) Did you do other publications elsewhere?

Bálint Kátay.

 
At 3/20/2005 2:52 PM, Blogger Stacey said...

I see the blogger bug has bit you!

 
At 3/22/2005 12:25 PM, Anonymous Anonymous said...

Hi Stacey,

what is the "blogger bug"?

B.

 
At 3/23/2005 9:54 AM, Blogger Stacey said...

The Blogger Bug--

1. the inability to stop blogging, ie. You're up into the wee hours of the night blogging, telling yourself "Just one more paragraph" while your spouse has given up and closed his/her eyes and you've missed any opprotunity for romance.

2. the inability to stop thinking about blogging, like at random moments during the day you have thoughts like, "Oh man why didn't I say that in the last blog," or "Oh, I gotta remember this detail, it would make for a great blog",

3. The ability to create insightful well-read blogs that you've now created an "audience" that you feel "responsible" to...you hear them cry out in your dreams..."WE WANT MORE, WE WANT MORE...."

 
At 3/23/2005 1:37 PM, Anonymous Anonymous said...

WE WANT MORE, WE WANT MORE.... :)
B.

 
At 12/17/2005 2:43 PM, Blogger job opportunitya said...

Captivate blog. I surf the web for blogs this
nature.The site are wonderful and will be returned to
again!
I beg of you, just check out my call center conference blog.

 
At 3/15/2007 4:39 PM, Anonymous Anonymous said...

I have been looking for sites like this for a long time. Thank you! film editing classes

 

Post a Comment

<< Home