Configure Windows to boot from a USB

The Feedster

Active Member
Premium Member
Joined
Jun 26, 2007
Messages
26,190
Reaction score
6
Points
38
Age
62
The availability of high capacity USB memory sticks has inquiring minds asking the question: can I run Windows from a fast solid state device?
If you could, the advantages would be huge – think of the speed and convenience. Unfortunately, Windows Vista and Windows XP currently both have restrictions by design and by licensing to prevent direct booting from a USB device.
However, it’s been shown on the Internet how to hack the Windows XP installation to make it run from a stick, and in the presence of another hard disk. If you intend on doing what Microsoft doesn’t want you to, you can find out more details on the Channel 9 forums.
Enter Windows XP Embedded
We can still legally explore Windows booting from a USB 2.0 device with Windows XP Embedded (XPe) – an operating system and development platform in componentised form.
Based on the same binaries as Windows XP Professional, Windows XPe enables developers to choose from over 10,000 feature components to maximise functionality and reduce footprint for a specific device implementation.
There is, however, a restriction – we can use XPe as long as the final runtime system we're using it in is not ‘a general purpose computing device’. So as long as the piece of kit we run our XPe operating system from is a custom device we’re in the clear.
And we can do this for free thanks to the open-ended evaluation licence for the XPe tools – only the created XPe installations expire between 90 and 180 days after first boot.
The tools never expire, which means we can simply refresh our OS images when they expire.
Rules to remember
There are some positives to using XPe. For one, the wealth of Windows applications and your existing development skills can all be used on the system built.
Also, by including the Generic Device Driver Support component in an OS image specification you get Drivers.Cab deployed – just in case there are a variety of ‘specific computing devices’ you wish to use it with during development.
You’ll also need to think about the PC you intend using for the project. Although USB storage devices are becoming available, their performance is entirely dependent on the host’s USB controllers. Most machines today do not support high speed USB 2.0 booting in the BIOS.
Basic USB 2.0 BIOS support allows for booting at USB 1.1 speeds, and once the OS is loaded additional drivers bring the USB 2.0 functionality on line. This is the case for many machines.
To boot from USB 2.0 and take full advantage of devices such as the fast Corsair Survivor sticks, the motherboard BIOS must support high speed USB 2.0 pre-OS. So let’s think of some specific devices we’d like to build.
Well, there’s that unobtrusive PVR, that mega hi-res digital photo frame, an IP webcam using that old laptop motherboard and webcam, a solar-powered weather monitoring station and a digital home control kiosk.
There are tons of scenarios where the hobbyist can use Windows XPe from a USB stick. In this case, I’m going to build an XPe image that boots from USB and provides a simple PVR using a Hauppauge USB Nova-T.
Only my newest laptop – a giant Toshiba X200-219 – has adequate USB 2.0 booting support. So this is going to be my ‘development system’.
Your OS your way
Now a successfully built and booting XP Embedded image is ready, customisations to support our specific device can be made.
The base image I have built is 592MB in size. This incorporates most of the typical XP features – login, Windows shell, applications etc; so apart from the evaluation message on the desktop and being labelled Windows XP Embedded – it looks and feels like XP Pro.
All the PVR drivers and support files need to be added to the Target Designer specification in the XPe image just built to have the complete PVR OS build. The basic Hauppauge drivers have INF scripts.
These need to be turned into a component definition using the Component Designer – this can consume the INF file, process its dependencies and produce an SLD component definition file.
Specific driver files are added to a repository directory and this is also recorded in the SLD file before it’s imported into the component database. The Hauppauge component can now be added to the OS specification in the Target Designer.
Next steps
The Hauppauge applications for viewing TV, scheduling, recording and codecs are all provided as WISE installation EXEs. There are three options for handling this:
? Use a tool such as Inctrl5 to snapshot your machine before installing the applications, then go through the install process and use Inctrl5 to ‘diff’ your development machine. This will list out the files and registry entries created during the install of the application/codec – you could then build a component based on the files and registry entries
? Add the components to the operating system to allow the installers to run on the booted XPe operating system image. If you boot to a custom shell then you’ll need to allow an ‘administrator option’ that gets you out to a command prompt so you can run the installers
? Add the installers to the ‘run once’ key so they get installed on first boot
For simplicity, my OS image is using the Windows XP Explorer User Interface shell, which will allow me to use option 2. If I was building a more customised OS image I would have to explore implementing options 1 and 2. Because the Hauppauge application software uses an MDB database file to store channel data, we also need to add the Microsoft Data Access Component install to the image. This can be obtained from the Microsoft website.
Now our PVR OS image is complete, it can be built by pressing [F7] in the Target Designer. This causes a complete OS image to be assembled in the C:\Windows Embedded Images directory. The contents of this directory can then be copied to the boot-prepared USB Stick. For this PVR project I’m using the enormous 32GB Corsair Survivor.
When you first boot the created image, the OS needs to configure itself using the ‘First Boot Agent’. This takes a while. After this, boot times are typical of XP.
Once MDAC and the Hauppauge applications are installed, we can configure them to view and record TV. The system takes 40 seconds to boot. The image size is 682MB.
So, we’ve built a specific Windows XP Embedded OS image to provide a custom device with Windows functionality, all booting from a USB stick. This works smoothly, particularly with the Corsair sticks, which have good performance. However, your motherboard BIOS must support booting devices at high speed USB 2.0 to make this function well.


More...
 
Top