X
Business

Windows XP: under the bonnet

Windows XP is not a revolutionary product. Rather, it builds on existing code and incorporates many features that have previously been available across different platforms.
Written by Rupert Goodwins, Contributor

Windows XP is not a revolutionary product. Rather, it builds on existing code and incorporates many features that have previously been available across different platforms. It also adds some ideas from applications software. The kernel is substantially the same as that in Windows 2000, which is itself a substantial reworking of NT 4.0: Windows 2000 has proved itself to be a stable OS, and that stability could be endangered by too many changes.

The XP kernel gets going a lot faster than previous versions, as the boot sequence has been streamlined. As well as remembering what happened during the last boot -- and thus knowing when it's safe to omit diagnostic tests -- the kernel optimises the sequence in which it starts up peripherals, loads files from disk and initialises drivers and protocols. In many cases, it can load multiple components in parallel and start them running without having to wait for previous components to finish their initialisation, and can pre-fetch drivers from disk to be in memory before they are required. XP remembers details of the previous eight boot sequences and knows to stop pre-fetching files that are no longer required, or to modify the sequence when new drivers are added. A utility -- bootvis.exe -- gives a graphical view of what processes are doing what and when during boot.

Much the same technique is used when XP loads an application. It remembers what system resources are required, such as registry entries, DLLs, chunks of EXE files and so on, and loads as much as possible into memory as soon as possible. It also defragments the disk during idle times and moves application components around to group them for swift loading. This fine-tuning goes on continually.

XP also tries hard to optimise memory usage. Like all modern operating systems, it manages virtual memory, which copies the least-used contents of real memory to hard disk, freeing up RAM for other uses, and copying back data into the RAM when the application wants it. Managing this efficiently is vital to system performance, and previous versions of Windows could be less than stellar here. XP's memory manager constantly monitors RAM usage and is aggressive about releasing memory if it looks as though an application isn't using it. XP also maintains two pools of memory, one for small allocations and one for large ones, to prevent multiple small requests fragmenting memory space for large requests and thus reducing efficiency.

Low memory situations -- which for most Windows users means most situations -- are handled with more aplomb. Older versions of the operating system supported 'must succeed' memory requests, whereby a driver or kernel code could force the OS to hand over memory. If there wasn't enough free memory for the request, the system could become unstable and deliver the dreaded 'blue screen of death'. XP doesn't support 'must succeed' requests, and it's now up to software writers to sort out what to do if there's not enough memory for their task. XP also supports 'hot-add' memory: if your hardware is compatible, you can add memory to your computer without turning off and it becomes available to the OS there and then.

When suspending to disk, XP first makes sure all unused memory is released, so it won't be saved, and then compresses used RAM before storing it. By compressing one block while writing another, the whole process is speeded up.

XP's device driver model is much the same as with Windows 2000, although the perennially problematic Plug and Play system has been yet further fine-tuned to make it more reliable -- or so Microsoft says. I/O in general has been reorganised, with the system allocating as much spare memory as possible to allow different I/O requests to complete in parallel. When memory is low, XP throttles back by serialising I/O requests, allowing greater memory reuse at the expense of speed.

Application compatibility has been the subject of some attention. Windows monitors the way an application uses the operating system API, and will automatically work round a number of errors that happen when the application mistakes the OS version. Additionally, Windows XP can disguise itself as an earlier version of Windows -- you can pick ME, 98, 95, NT 4.0 or Windows 2000 modes on an application-by-application basis. And if that's not good enough, Windows XP can store old DLLs and other OS library components in the WinSxS (Windows Side by Side) folder. If an application relies on an old DLL but a newer version is part of the operating system, XP will spot this and divert DLL calls as appropriate to the old version while leaving the new version in place for other software.

Driver rollback is another feature that improves reliability. Here, when a driver is updated the old version is archived in a special directory and can be reinstated if any problems are found with the new version. Rollback only works for the immediately previous driver, and doesn't work for printer devices. Some other system features introduced in Windows ME have been updated -- automatic updating over the Web, system checkpointing and restoring back to earlier configurations, and Automated System Recovery (ASR) can save and restore applications, including their Registry entries.

The Registry itself has been substantially overhauled. Size limitations have been removed and it's now limited by available hard disk space. Appropriately, its database engine has been improved to speed things up: related items are grouped together so that accesses are faster, and fragmentation is reduced by a more intelligent space allocation algorithm.

Very little of the above will be immediately apparent to the user. However, if Microsoft has been successful in its aims Windows XP should feel slicker, crash far less often and almost never get in the way of useful work. That might not seem glamorous, but for an operating system one of the highest accolades you can bestow is to hardly notice it's there.

Editorial standards