Tag Archives: windows 8

Thoughts on the future of the Win32 platform

Overheard last week at a non-techy social event: “I have just got an iPad. It is gorgeous. It is amazing how much it can do” … conversation continues … “Trevor is always swearing at his computer. He always blames Microsoft. It doesn’t matter what the problem is, he blames Microsoft.”

This is the kind of conversation which is annoying to hear if you are remotely technical. I have and enjoy using an iPad, but it has many limitations and its own share of annoyances. Recently the iOS WordPress app crashed whenever I tried to moderate comments on this blog. On Windows I could have done some troubleshooting, but on the iPad there was little to do other than blindly try removal and reinstall, or wait for a fix. As for Windows, I find it generally reliable and the majority of issues I have with it are not the direct fault of Microsoft.

In other words, reality is not so clear cut; but there is a powerful myth out there that goes along the lines of the conversation I overheard; and it is a myth that is not entirely unfounded given the quality of Apple’s design work and the problems that surround what we might call the Windows ecosystem: foistware, hardware built down to a price, the peculiarities of Outlook, and so on.

I do not think conversations like that quoted above are exceptional and it illustrates the pressure Microsoft is under. For years Windows has been in an almost unassailable position because the alternatives were insufficiently compelling to most people: Linux too awkward and fractured, Mac/OSX too expensive. Now change has come about because of the rise of new kinds of devices, smartphones and tablets, for which Windows was unsuitable. The result is that Apple iOS and Google Android are widely used and growing fast.

That said, we still need PCs, and although the Mac is gaining ground the large majority of these still run Windows. The smartphone or tablet model does not fit all kinds of computing. In fact, if we are thinking of the iPad in particular, it is only a good fit for a minority of uses. I am not thinking of what you just about do with an iPad if you have to, I am thinking of the scenarios where it is your tool of choice. Take word processing for example: the iPad has a version of Pages and you can get an external keyboard but even so I would rather type on a PC or a Mac, or even a netbook, and will get my work done quicker that way.

image

Leaving aside the software that is available, a full PC or Mac gives you keyboard, mouse, and easily supports one or more large high-resolution screens. Whether it is Microsoft Excel, Adobe Photoshop, the latest graphics-intensive game like Bethseda’s Skyrim, CAD software, or development tools like Visual Studio or Eclipse, there are many activities for which a tablet is a poor PC substitute.

Even for things for which a tablet is generally considered good, such as web browsing, a full PC or notebook is better. When browsing the web on an iPad there are little annoyances like slower typing of search queries (and the often daft auto-correct in iOS), awkwardness of looking up a password for a login and pasting it into the browser, small screen size making you scroll around, difficulty of hitting small hyperlinks on sites like discussion forums, and so on.

All of this means that the traditional PC, Mac or notebook seems still to have a strong future, which seems further to imply that Windows also is secure.

I would argue though that this is a rose-tinted view of the future of the Win32/Win64 platform – by which I mean full desktop Windows rather than the “Metro” tablet platform which Microsoft has previewed for the dual-personality Windows 8. Here are three reasons why it is under threat:

1. Tablets will get better and will gradually encroach on the PC market as they become more capable. This process will be complemented by web sites adapting to work better for the growing number of tablet users.

2. Hybrid devices like the Asus Eee Pad Transformer, which runs Android but also docks into a laptop-like keyboard and clamshell case, will cause users to question whether they really need to replace their Windows laptop when it wears out.

3. The drive towards cloud computing will reduce our dependence on desktop applications. Although Google’s Chromebook has not yet caught on, the fact that it exists shows the progress cloud computing is making: a notebook that only has a web browser is a viable proposition.

My assumption is that many of us would like to use tablets for a greater proportion of our computing activities if we could easily do so, because we like their mobility, convenience, low power demands, and relatively low cost. This is especially true for consumers, and less applicable to more regimented offices where there is a computer on every desk.

Another factor for Win32 is that Microsoft itself will slow down its future development, concentrating instead on Metro and its Windows Runtime, as well as cloud services. There are good business reasons for this. Microsoft is not under pressure to improve Win32; users would like it to run faster and with greater reliability, but their main demand is that it continues to run their critical applications successfully.

The conclusion: although Win32 will remain an important and stable platform for many years to come, it is now in slow decline. This will be the case whether or not Microsoft manages to bring Windows itself back on track with a success for Windows 8 on tablets, and overturns the assumption reflected in my initial quote: that an Apple iPad is delightful and Windows nothing but problems.

Windows 8 Tablet in June 2012? If so, I am betting ARM not Intel x86

An interview with Paul Amsellem, new boss at Nokia France, includes this remark:

Et en juin 2012, nous aurons une tablette fonctionnant sous Windows 8

which even my schoolboy French can translate:

and in June 2012 we will have a tablet running Windows 8

Now, that is sooner than I had expected based on what we saw at the BUILD conference in September, and on past experience of Windows beta cycles. Windows 7, for example, was previewed in October 2008 and went into public beta in January 2009. A release candidate arrived in May 2009, and the gold release (the first production release) was towards the end of July 2009.

Although that does not sound much different from September 2011 to June 2012, bear in mind that the gold release is the moment when PC manufacturers can test their hardware with the production code. They still have to manufacture, package and distribute the machines, which is why the first machines with Windows 7 pre-installed did not arrive until October 2009. Hence the “general availability” date for Windows 7 of October 22 – three months after the gold release.

In order to achieve a June release for Windows 8 then, you would expect Microsoft to be done by March 2011. We have yet to see the first beta (the BUILD version is a preview) and a gold release for the x86 Windows 8 in March seems to me most unlikely. Of course it could be done, but only by compromising quality. The quality of the Windows 7 first release was excellent, and Microsoft is smart enough not to jeopardise its Windows 8 launch with a sub-standard product.

Is the Nokia man then either mis-informed or mis-quoted? Either is possible; but I also wonder whether Windows 8 on ARM will play by different rules. Microsoft said little about the ARM release at BUILD, though it was on show in the exhibition.

My impression is that the ARM release will be locked-down and that the only way to install apps will be via the app store. It will also be designed for specific hardware, unlike Windows x86 where people may grab an install CD and set it up on any old PC they can find; it is not guaranteed to work, but often it does.

That means Microsoft has much less to do in terms of compatibility testing, both for hardware and applications.

It follows that, despite being a new platform for Windows, the ARM release might actually be quicker to build than the x86 release. I can just about believe that Microsoft could be ready to hand over a gold build to Nokia in March 2012.

If that is the case, then the big risk is that apps will be scarce. It would give developers little time to create apps for the new platform, and it would also be interesting to see if the Office team at Microsoft could deliver something of real value by then.

Microsoft is under intense pressure from Apple’s iPad as well as Android competitors in tablets. Although it will want to get to market quickly, the company must also realise than a botched first release makes recovery hard. This will be interesting to watch.

Blue screen, Windows 8 style

This is what happens when Windows 8 crashes:

image

The restart message proved false, and I had to reset the virtual machine.

I did the search, which told me:

The CLOCK_WATCHDOG_TIMEOUT bug check has a value of 0x00000101. This indicates that an expected clock interrupt on a secondary processor, in a multi-processor system, was not received within the allocated interval.

This proves that you make give blue screens a prettier face, but that does not make the error messages any more helpful to a non-expert user. Or should I head for my nearest computer store and ask if they have a spare clock interrupt?

The closest I got to Windows on ARM at Microsoft BUILD 2011

A couple of the stands in the exhibition at Microsoft’s BUILD conference last week were showing Windows on ARM. This one was on the NVIDIA stand and was most likely running its Tegra 2 SoC (System on a Chip) though Tegra 3 (code-name Kal-El) is apparently now in production. The tablet was displayed under a plastic shroud which could only be lifted when someone from Microsoft was present, though I was able to get this snap of the machine sans shroud. I was not permitted to handle the machine.

image

I have blanked out part of the background because it was black on black.

My main observation: it looks just like the Intel version. This screen shows a Metro app running side by side with the Windows desktop, and showing the “charms” on the right.

Gartner reports that Apple will have the tablet market almost to itself in 2011 (73.4% market share). I believe Windows on ARM is critical to Microsoft’s strategy to compete. In principle, it should be cheaper and more efficient than an Intel device, and one that is more locked-down in the style to which Apple has made us accustomed.

If Microsoft and its hardware partners can get the size, weight and design details right, I suspect I would rather have a Windows 8 tablet than an iPad. One advantage is the ability to have two apps side by side. Microsoft’s new user interface works really well with touch. I will expect to find a Windows remote desktop client there by default, and better support for Microsoft Office and SharePoint than I find in the iPad.

By the time Windows 8 comes out though, we will likely have iPad 3 with who-knows-what improvements; Apple has all the apps; and breaking into this market will not be easy.

Finding apps in Windows 8

I’ve been spending some time in Windows 8, complete with the Metro-style Start menu. The new Start menu is not great in a virtual machine without touch. You have to navigate with the horizontal scroll bar at the bottom of the screen, which I find somewhat jerky. DirectX is not particularly fast on the VM, which I view using Remote Desktop. Another puzzle is that many apps are not represented by tiles on the big menu. How do you find them?

The answer is that the tiles are not exactly equivalent to the items on a Windows 7 Start menu. They are more equivalent to the items that you have pinned to the taskbar in Windows 7; and in fact, if you pin an app in Windows 8, it appears as a tile. To get the full list of Start menu items you are meant to start typing.

image image

When you press a key in the Metro Start menu, the tiles disappear, and you get a list of all the apps that match what you have typed. The match seems to be based on words with initial letters that match your string. So if you type CL you match Disk Cleanup, but typing PAD does not find WordPad.

If you press Windows key – Q it brings up the Search Apps screen with an empty search box, and lists all your apps in a columnar A-Z view.

image

Now, the thing that gives me hope here is that the search is very fast, much faster than I am used to with search in the Windows 7 start menu. It could almost convert me.

Search is baked into Metro, and searching apps is only one of the options. You can also search settings and files (though files seems to mean documents), and any applications that implement the search contract. For example, from the same search pane, you can search the custom BUILD app for c#:

image

One other thing: “All Apps” is not really all apps, of course; just the ones that would have been in the Windows 7 Start menu. If you want, say, Dxdiag, you will have to press Windows Key – R and type it in there. It would be nice if typing DX would find it, but it is not that smart unfortunately (update – but see comments below).

Installing Windows 8 developer preview on VirtualBox

I have installed the Windows 8 developer preview on Oracle VirtualBox. It does not work on Virtual PC since 64-bit guests are not supported. It is probably fine on Hyper-V, but I don’t have spare Hyper-V capacity for it at the moment.

image

I had a few hassles and thought it would be worth sharing my notes.

I gave the VM 2GB of RAM, 2 processors, and the maximum amount of video ram, but these settings are up to you.

The main problem I encountered was with the mouse. I found that it worked a bit in the Windows 8 guest, but only a bit. The pointer jumped around and was too frustrating to use.

The solution I found was to remote desktop to the VM from my Windows 7 desktop. I could not get the remote desktop built into VirtualBox to work, on a brief try, so I used pure Windows to Windows.

In order to do this, I first set networking in VirtualBox to Bridged. This means it is on the same subnet as the host computer. Then I enabled remote desktop access in the Windows 8 control panel. I opened a command prompt to check the IP address – Windows key + R opens the Run prompt and is a useful combination when the mouse is not working.

Then I was able to use remote desktop to that IP address. Note that unless you join the Windows 8 machine to a domain, the username is:

machinename\email address

or alternatively

WindowsLiveID\email address

presuming you do the default thing, which is to hook up Windows 8 to a Live ID.

Now, if you do this you will have two GUIs showing, which is untidy. You can fix this by running the VM headless. Shut down the VM, navigate to the VirtualBox directory and run the following command:

vboxheadless –startvm yourvmname

Now you can log on to the Windows 8 VM without having any other instance on the screen.

You might not have the same problem with the mouse, of course.

Incidentally, I am not sure what is the best way to shutdown the VM, but I use a command prompt or WindowsKey – R and type:

shutdown /s

My final observation: Windows 8 with just mouse and keyboard is a lot less fun than on a real tablet. It raises the question of just how much value there is in Windows 8 for non-tablet users. I suspect rather little, which is why Windows 7 is set for a long life on the corporate desktop, and for other users who do not have touch screens.

No plugins in Metro-style IE, and here is why

This evening was Ask the Experts time at Microsoft’s BUILD conference in Anaheim, California, so I took the opportunity to ask the Internet Explorer (IE) team why the Metro-style IE does not support plugins such as Adobe Flash and even Microsoft’s own Silverlight.

I find it puzzling since the desktop IE in Windows 8 does support plugins, and when a page is open in Metro-style IE there is an option to open it in desktop Windows, in which case all the ActiveX controls start working.

The reason I was given is that Microsoft cannot control or predict the user experience if these plugins are running. For example, a Silverlight applet might have a user interface designed for mouse and keyboard. Microsoft has built in touch gestures that work for HTML in IE but cannot do so for plugins.

Once a user takes the decision to open in desktop Windows, these considerations change since desktop Windows is a mouse and keyboard environment.

I expect performance was also a consideration.

I was also told that Apple has made the no-plugins option viable by taking the same line in the iPad. Sites have been forced to offer iPad-friendly versions of their sites, which will also work in Windows 8 Metro.

Data Access in Windows 8 WinRT

I’ve been teasing out details about the Windows Runtime (WinRT) here at Microsoft’s BUILD conference in Anaheim, California.

WinRT is the runtime for touch-friendly Metro-style apps, in effect Microsoft’s operating system for tablets, though it has a dual personality and full desktop Windows is also available.

Microsoft experts told me that there is no client for SQL Server or other network databases in WinRT. To access such databases, you have to create a web service and call that. This is similar to the Silverlight model. The .NET Framework in WinRT will support WCF RIA Services, which is one option for this.

If you only want to store and retrieve data locally, there seems to be a JET API, or you could use something like SQLite or roll your own simple database manager. HTML and JavaScript apps support IndexedDB. All these options read and write data to the app’s isolated storage; they do not enable free access to the file system.

LINQ (Language Integrated Query) is supported but of course that is only as useful as the data it can connect to.

A few facts about Microsoft’s new Windows Runtime

I’ve just come out of Martyn Lovell’s talk on WinRT internals here at BUILD in Anaheim, California.

Make no mistake: Microsoft has re-invented the Windows API in WinRT. Just to recap, WinRT is the API for Metro-style applications, the touch-centric, app-centric API for tablets and, one presumes, eventually for Windows Phone (though Microsoft has yet to admit it).

WinRT is only useable from Metro applications. You cannot call WinRT from a Win32 application, nor vice versa*. I think it is reasonable to assume that a future version of Windows which runs only WinRT is a possibility; and that Windows 8 on ARM will look a bit like that even though Win32 will still be there, but mainly out of sight; but I am speculating.

Does that mean Win32 is now legacy? In a way, but such a huge legacy that for the moment we should think of Windows 8 as two platforms side by side.

There is no inter-app communication in WinRT other than by the pre-defined contracts built into the system (though Lovell noted that you could always use the file system and polling for a crude inter-process communication).

There is no way to install a shared dynamic library. Apps can only use the system libraries together with what you install with the app. Each app lives in its own context and is isolated. In other words, WinRT is not extensible, other than within your app’s code*.

If you figure out a way to bypass limitations of WinRT by calling other Windows APIs, your app might work but the submission process for the Windows Store will prohibit it.

Versioning is built into WinRT. This means that when Windows 9 comes along, you will be able to code just against the Windows 8 versions of the classes, for compatibility, and your IDE can support this by only exposing the Windows 8 version of the API.

The CLR exists in the Metro environment, for use by .NET applications, complete with JIT (Just in time) compilation. However only a subset of the .NET Framework libraries are included. Microsoft aimed to include only what was necessary for Metro. I am not sure yet what is included and what is not, beyond the obvious (no Windows Forms, for example) but will be investigating what is documented. The native WinRT APIs look similar to a COM callable wrapper from the .NET side. That said, you do not normally need to care about WinRT interfaces, even though these are there in WinRT. Normally you interact with WinRT classes, making it more natural for .NET than working with COM.

WinRT is full of asynchronous calls. Lovell told us that Microsoft had seen in the past that if both synchronous and asynchronous APIs are available for the same function, then developers often use the synchronous version even when they should not, making applications less responsive. The new await keyword in C# makes this easy to code.

WinRT makes use of the ILDasm metadata format which is also used by .NET. This means you get rich metadata for IntelliSense and debugging, but note that the actual runtime is not .NET; they just borrowed the same metadata format.

WinRT objects are reference counted like COM for memory management, with weak references to avoid circularity. You should not have to worry about this; you can code according to the conventions of your language.

There are three ways to write WinRT applications. One is C++, in which case you write directly to the “projection” of WinRT into your language. The second is .NET, in which case your code goes via the CLR. The third is HTML and JavaScript, in which case your code goes via the “Chakra” JavaScript engine also used by Internet Explorer 9 and higher. Lovell assured me that there is little difference in performance in most cases, though there could be advantages for C++ in certain niche scenarios. Of course we heard that story for .NET as well, but from what I have seen it is more plausible in WinRT.

There is no message loop in WinRT. There is no GDI in WinRT. All graphics are via DirectX. XNA, the .NET games framework, is not supported. It seems that you will need to use C++ for fancy DirectX coding, though this is not confirmed. Of course your XAML or Canvas code will be rendered by DirectX under the covers.

It is fascinating to see how Microsoft has borrowed XAML and ILDasm from .NET, but that WinRT is native and not .NET at its core. My take on this is that Microsoft intended to preserve the productivity of .NET, but without any performance compromise.

Despite the inclusion of .NET though, the fact that only a subset of the Framework is available, and that interop to the Windows API will not work*, means that most existing apps will need considerable work to be ported to Metro.

*Updates

A few clarifications.

It has been shown that you can call WinRT from Win32 (the favoured word for Win32 seems to be “desktop applications”) though I’m not sure how useful it is.

Concerning P/Invoke (Platform Invocation) to Win32 APIs, apparently this does work for a certain specified, small subset of the Windows API. It also works for your own native code DLL, with the proviso that if your native code DLL calls a disallowed Win32 API it will raise an error.

WinRT is partially extensible. A Framework Extension is a library which you can reference as a dependency in your app’s manifest. When the app is deployed it will download this dependency from the Windows Store. An example is the C Runtime Library. An extension library installs into its own directory, and can be used by multiple WinRT apps provided each one also references it in their manifests. However, the caveat is that only Microsoft can create these extensions: there is no way to create your own shared extension for general distribution, though an enterprise can deploy a shared extension internally.

Here comes Windows 8 – but what about the apps?

I’ve spent what feels like most of the night trying out the first developer preview of Windows 8, using an Intel tablet PC loaned by Microsoft for that purpose. The early preview is frustrating, in that many of what will be standard apps like Mail and Contacts are missing, but it is already obvious that Microsoft has done a great job with what I am calling the “Metro” platform within Windows 8. Here is Control Panel in the new user interface:

image

This is the touch-optimized personality of tthe new operating system, featuring a Start menu with live tiles like an evolved Windows Phone 7, apps that run full-screen to create an "immersive user interface", and swipe control to show application menus, switch apps, or access standard features.

It is a delight to use; but this is Metro, with its own Windows Runtime (WinRT), a native code API which is wrapped for access by either HTML and JavaScript apps (which also use the IE 10 runtime), or by C/C++, VB or C# apps driving XAML-defined user interfaces – yes, kind of like Silverlight but not Silverlight.
What about all our Windows apps? For that we need the desktop personality in Windows 8. Tap the Desktop tile, or launch a "Desktop" app, and it suddenly appears, looking much like Windows 7.

The problem: while Windows 8 "Metro" looks great, there are currently zero apps for it, or at least only those supplied with the preview, because it is brand new.
In truth then, Microsoft has not quite done what would have been ideal, which is to make Windows touch-friendly. That would have been impossible. Instead, it has integrated Windows with a new touch-friendly platform.

The key question: will this new platform attract the support it needs from developers in order to become successful in its own right, so that we can do most of our work there and retreat to the desktop only for legacy apps, or apps which really need mouse and keyboard?

It is a big ask, and we have seen HP with WebOS, and probably RIM with PlayBook, fail at this task.

Of course it is still Windows; but I do have a concern that a proportion of users will try Windows 8, find the transitions between Desktop and Metro unsettling, and stick with version 7.0.

Let me add these are very much first impressions; and that Metro really does look good. Perhaps it will win; but a lot of momentum has to build behind it for that to be possible.