Thursday, September 18, 2008

HOWTO - Bootable Windows XP System on a USB Flash Drive

I really need to create (or bring back as it turns out) a website for tutorials on random computer-related topics. As it is, this is going on my blog for now, and I'll just crib it or link to it later if I get around to getting a website going again.

I recently had need to create a bootable Windows XP system on a 1 GB USB flash drive. Seemed like it would be pretty simple to me...turns out it isn't. Microsoft likes to mess with the USB driver on boot up which isn't a good thing when you are booting from a USB device.

After looking on the Internet for quite a while, I found a tutorial that helped me accomplish what I needed. The original tutorial I followed is at (http://www.tech-archive.net/Archive/WinXP/microsoft.public.windowsxp.embedded/2005-10/msg00332.html). While I am very thankful to have found this, I thought I could possibly write a more succinct tutorial, and that's what follows here.

Final note - this most likely isn't the best way to do this, or the simplest. It worked for me and might be useful for others, so I think it is worth posting here. I did find another tutorial that might be a more correct way to do this at (http://www.ngine.de/article/id/8). I haven't tried it though, so YMMV.


Initial preparation

  1. Make the intended target USB flash drive installable. See the following section for help with this.
  2. Boot the newly installed XP install from the hard drive.
  3. Disable the pagefile. This is done by opening the system control panel, choosing the advanced tab, clicking the top “settings” button, changing to the advanced tab, clicking the “change” button, and then choosing the “No paging file” option and clicking “Set”.
  4. Insert the intended target USB flash drive, and allow it to be fully detected by XP.

Registry modifications

  1. Backup the HKLM\System registry key before starting (just to be safe).
  2. Import or make the following modifications to 6 registry keys:


[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbehci]
"Start"=dword:00000000
"Group"="Boot Bus Extender"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbhub]
"Start"=dword:00000000
"Group"="Boot Bus Extender"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\USBSTOR]
"Start"=dword:00000000
"Group"="Boot Bus Extender"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\usbuhci]
"Start"=dword:00000000
"Group"="Boot Bus Extender"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\usb#root_hub]
"Service"="usbhub"
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\usb#root_hub20]
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"
"Service"="usbhub"

  1. Create 2 registry keys based on the specific USB flash drive that will be used. Following are 2 examples – the key names will have to be customized for the Pid/Vid and hardware ID of the specific target flash device. The ClassGUID and Service keys should be entered verbatim.


[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\USB#Vid_1058&Pid_0300]
"ClassGUID"="{36FC9E60-C465-11CF-8056-444553540000}"
"Service"="usbstor"

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDataba
se\USBSTOR#DiskWDC_____WD1600BB-00FTA0_15.0]
"ClassGUID"="{4D36E967-E325-11CE-BFC1-08002BE10318}"
"Service"="disk"

The Pid/Vid for the target USB flash device can be found in HKLM\System\ControlSet001\Enum\USB. Open the subkey for each item until you find the DriverDesc of USB Mass Storage Device, a Service of USBSTOR, and a LocationInformation that matches your specific flash drive.

The hardware ID can be found in HKLM\System\ControlSet001\Enum\USBSTOR. In this example the chosen key would look like:

Disk&Ven_WDC&Produ_WD1600BB-00FTA0&Rev_15.0

Again, find the device that matches your specific flash drive.


The Hardware ID is created as Disk(8)(16)(4) where the values are:

8 digits (in this example WDC_____ ) as the vendor of device
16 digits (in this example WD1600BB-00FTA0_ ) for the device type and
4 digits (in this example 15.0 ) for a version number.

  1. Delete key HKLM\System\MountedDevices.
  2. Delete string value HKLM\System\Setup\SystemPartition
  3. Change HKLM\System\ControlSet001\Services\USBSTOR\Start from 3 to 0.
    (THIS STEP IS IMPORTANT – YOU WILL GET A BLUE SCREEN IF THIS ISN’T CHANGED)
  4. Right-click on the HKLM\System\ControlSet001\Services\USBSTOR key and change the permissions to deny full control to the “System” group.

Preparing the target flash device

This step likely has to be done from another PC, or while booted to a different drive. Otherwise, some files end up being in use.

  1. Copy all files and folders from the completed hard drive to the USB target flash drive. Do not copy the recycled or system volume information folders.
  2. Delete \windows\system32\config\*.sav, *.log, and *.evt.


Adding support for additional USB flash devices

To add additional USB flash drive support to the original hard drive image, follow these steps:

  1. Right-click on the HKLM\System\ControlSet001\Services\USBSTOR key and remove the deny full control to the “System” group attributes that were set in step #7 in the registry section above.
  2. Insert the additional targeted USB flash drive, and allow it to be fully detected by XP as in step #4 of the initial preparation section above.
  3. Follow steps 3-7 of the registry modification section above.


EDIT: It turns out there is more to this than what I have posted. This will be limited to a specific flash drive, not just a certain PID_VID. The image will need to be recreated with each additional flash part that will be used added to the registry for this to not blue screen when moved to a different flash drive. Suck.

Thursday, September 11, 2008

Genius!

I really didn't think I would find much use for the new "Genius" feature in iTunes 8. It seemed like a gimmick, and primarily to push more stuff from the iTunes store in my mind.

However, after playing with it for less than a night I'm pretty happy with it now. I was a bit concerned when my iTunes memory usage climbed to 800 MB while it was first compiling my genius information (and if you still care about privacy of your data it will disturb you as well). After that completed though, it was pretty cool seeing it group together songs from my library based on a given song.

After playing with that for a bit, I decided to turn on the sidebar and let it show songs from the store as well. The related songs portion is only mildly interesting to me -- what I really liked was the list of other songs I might be missing from that same artist.

It was while browsing an artist I happen to have nearly everything ever made, that I noticed something else that I found amusing. It claimed there was a song I didn't have, and that it was on an album that I physically own and had ripped to my library. After being thoroughly stumped for a bit (keep in mind it's the wee hours of the morning, and I have all sound muted), I realized that it was actually a hidden track. It turns out that if you buy the album from iTunes, the last song is broken into 2 separate songs, rather than one long track. Interesting. Also cool - because I now know the title to what was previously an untitled hidden track to me.

Wednesday, July 2, 2008

Now I know I've lost my mind

Yep - it's gone. I've gone off the deep end into the esoteric world of geekdom. Even true geeks now laugh at how far gone I am.

I love learning new computer languages, I should do it far more often than I do. Practicality often gets in the way of my true self. I of course almost always learn with some form of a hello world. If you don't know what that is, quit reading. Seriously, you will only find yourself in pain from this point forward. Just quit.

While waiting for a backup to finish tonight, not particularly wanting to do anything else, I stumbled upon a Brainfuck page. I had actually been here before after linking there from Eric Raymond's (ESR) INTERCAL webpage (don't ask - it's easier that way).

So - I decided to write a hello world in Brainfuck...and I enjoyed it. I'm sick. Here it is:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++
>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
+++++++++++++++++++++++++++++++++
>
+++++++++++++
>
++++++++++
>
<<<<<<<<<<<<<< [.>]
Hopefully Blogger doesn't screw up the format. You'll probably think it did anyway, it basically just looks like line noise. I kid you not though, compile this bad boy (here's a link to the compiler I used), and it will output "Hello World!\r\n" (rendered appropriately by your terminal).

Only after I was finished did I go check out the wiki for Brainfuck, and see that they had their own version of a hello world.

Anyway, if you are sick like me, seek help. Otherwise, follow these steps to validate I'm not lying to you:

1. Download the compiler from the link above. Rename from bf.asm.txt to bf.asm.
2. Look at the assembly source and verify there is no voodoo trickery going on - it really is a compiler.
3. Run "nasm bf.asm" to create the bf executable (your compiler). Make it executable.
4. Copy my source into a file named HelloWorld.b or something similar.
5. Run "cat HelloWorld.b | bf > hell.elf
6. Run "./hell.elf"
7. Run screaming from the room as you realize what you have become.

Monday, June 30, 2008

Goodbye Smoky Air - You Won't Be Missed

Today is the last day of dirty, stinky public air. No, sorry, I can't promise that actually. I can say though that tomorrow is the first day where the fantastic new Iowa smoking ban will be in effect.

I'm freaking thrilled about this. Any public place is basically now a safe haven from something I despise. Despised isn't actually strong enough - pure hatred is better. In fact, after my introductory post, the very first post on this blog was against smoking.

Some will say this goes too far and infringes on personal liberties. They'll say that it is a slippery slope of government control. I don't give a rats ass. I'm normally very careful about allowing government to get into our affairs too. The difference here is that this is something that effects others, not just the brain dead who is puffing away. I'm still not legally allowed to beat the hell out of them or defecate on them, so I think it fair that they can't smoke around me.

The only disappointing thing to me in this is the very few loopholes that still made it in. Casinos and hotels still have exemptions. F the casinos, I'll stay away from your smoky, old folk piss establishments. Now I just need to find a hotel chain that positions themselves as non-smoking.

Saturday, June 28, 2008

How to make music fun

I know - it looks like I'm just padding my posts count at this point. I'm on track to have as many posts this month as I have the entire rest of the year. Have to take advantage of it when the ambition is there.

Parts of the music industry (mostly the evil parts who hide behind a shell company known as the RIAA) are bemoaning the fact that people are not buying their music anymore, and that interest in their manufactured crap is on the decline. [completely wacky sidenote: I realized yesterday you can't say "Fiduciary Duty" without saying "douche"]. This zombified race of former humans can't figure out what they should do to get people to enjoy music again, so they err on the side of suing everyone and introducing painful and ugly DRM into their music.

Well, as I again realized over the past few days, that's completely the opposite direction to go. Music is a social creature. Just like the scorpion, that it's nature. Music is not really appreciated until it shared and experienced by many people. The RIAA is running scared and doing exactly the wrong approach.

I've enjoyed some fantastic musical sharing over the past few days, and I haven't even been to any concerts. My daughter loves all kinds of music, and I have been making CDs for her lately. There's not much more fun than doing that. It started with some bedtime music. Initially I started pretty mainstream, but more recently we ended up with a Marley (Bob and Ziggy) CD that she loves. Yesterday and today we created a "rock" CD for her. It turns out she has inherited her dad's wide range of musical taste - we have everything from pop, to 70's hard rock, to some modern and classic country.

The other sharing dropped in the form of a new 5 of the now from Ryan. Ryan came up with the 5 of the now a few years ago on his blog, and it's great both from the creating and listening perspective.

As his post and my previous post demonstrate, there is no lack of free music out there. Have no fear - music wants to be free and always will be in the end. Wise up RIAA.

Digital Battlefield

It's too bad other companies did not have the foresight and unique position of Apple to make their online music stores truly succeed. I say this not because I don't like iTunes, I've said before how it is pretty much my primary source if at all possible. However, some other companies are starting to do some good things and it is just a nearly insurmountable obstacle for them to overcome, which I think limits some progress that we should be seeing.

Okay - that was a long run-on way of getting to my real point. Amazon continues to improve and add to their excellent MP3 download service - yet I still basically forget about them entirely unless something pokes me to remind me. This is especially weird given that for almost all of my other online shopping, I prefer to use them first.

I received an email pointing out that Amazon has weekly album deals that are really good. We're talking $5 or $7 full album, non-DRM downloads of some really good artists. I assumed these would be pop radio schlock, but they actually have a good assortment of some good music.

Then, on top of that, I find out that Amazon has weekly free songs, just like iTunes, except again they are DRM-free of course. These songs change weekly (and possibly daily, some that I saw yesterday are no longer featured). Here is a link where you can find some, or signup for their weekly newsletter if you're like me and need a poke to look outside the iTunes garden and see the other music all around.

iTunes is still the simplest path around for me, without question. Nobody else can yet pull off having a single app where I can search their store, manage my music, and drop it on my device all in a well-designed interface. Amazon's downloader does a decent job, but I still consider it somewhat of a hack. However, low-priced DRM-free music is a good way to at least get me looking at them.

Adding on quick - here's another link to 30 free hip-hop/R&B songs courtesy of AllHipHop.com. A bit of a pain, you have to get your iTunes code via email - but some pretty good songs.

Wednesday, June 25, 2008

Quick Techie Splatter

After changing something on my Linux home router today, I realized I should make a post about the Tomato replacement firmware. Yes, I realize most people have no idea what I'm talking about right now, but for those that do, keep reading.

Tomato is one of many replacement open source firmwares available for the Linksys WRT54G family of access points and routers (among other devices). Most people are familiar with this little ubiquitous device, and many are aware that you can replace the firmware on it thanks to open source software (and some people behind the scenes who poked Linksys until they "did the right thing" with their open source support).

DD-WRT has been one of the most popular of these firmware packages for quite some time. I was a big fan myself. However, a few things began to sour me on it. First and foremost, DD-WRT does a fair job of stepping all over the spirit of open source. Yes, it is technically possible to get the source, but good luck ever figuring out how to get it to build. Moreover, I have seen many (possibly rumored) reports of less than desirable behavior related to the DD-WRT codebase.

Over time, a "subscription" version of the firmware has become available. I see any new features in the future likely only being available to people willing to pay for this, and the free version simply stagnating. This along with the firmware itself having an ever-growing amount of services that bordered on adware made me want to look elsewhere.

It turns out unless you really needed every last knob of DD-WRT, Tomato is both far simpler and equally fully featured. In addition, its hot-set capability for nearly all parameters is very slick.

I won't go into exhausting details feature by feature of the two. I'll suffice it to say that I see no reason why someone wouldn't be equally or more satisfied by using Tomato vs. DD-WRT. A quick Google search of "tomato wrt" brings up others opinions on this subject as well.