Wednesday, June 30, 2010

Install Windows XP on a USB flash/hard drive

I am building a new PC from old spare parts. The new PC will be used mainly for the Internet, so a hard drive won't be necessary unless there's a need to download music and movies. I'm going to put together a computer with no internal storage, but use a USB stick as the main storage. Windows XP Professional will be installed on the USB stick, and the computer will boot up from the USB stick. Here I show how to install XP onto a USB stick and boot the PC from it. You should have the following ready.





Let's begin.




  1. Get your Windows XP installation CD and copy its contents to an empty folder on the hard drive. If you don't have the CD, use utorrent or emule to download the ISO file.



    Then, use 7-zip to extract the contents of the ISO file into an empty folder.



  2. Start the Command Prompt, go to the I386 subfolder and type the following commands to uncompress the USB driver files:


    CD I386
    EXPAND -I USB.IN_
    EXPAND -I USBPORT.IN_
    EXPAND -I USBSTOR.IN_

    We'll get 3 new files: USB.INF, USBPORT.INF and USBSTOR.INF. Remove the original .IN_ files.


    ERASE USB.IN_ USBPORT.IN_ USBSTOR.IN_


  3. Edit TXTSETUP.SIF to include USB storage support at the initial stage of Windows XP installation. The highlighted entries were copied from the [InputDevicesSupport.Load] section to the [BootBusExtenders.Load] section:

    [BootBusExtenders.Load]
    pci = pci.sys
    acpi = acpi.sys
    isapnp = isapnp.sys
    acpiec = acpiec.sys
    ohci1394 = ohci1394.sys
    usbehci = usbehci.sys
    usbohci = usbohci.sys
    usbuhci = usbuhci.sys
    usbhub = usbhub.sys
    usbstor = usbstor.sys


    Likewise for [BootBusExtenders] and [InputDevicesSupport]:



    [BootBusExtenders]
    pci = "PCI Bus Driver",files.pci,pci
    acpi = "ACPI Plug & Play Bus Driver",files.acpi,acpi
    isapnp = "ISA Plug & Play Bus Driver",files.isapnp,isapnp
    acpiec = "ACPI Embedded Controller Driver",files.none,acpiec
    ohci1394 = "IEEE 1394 Bus OHCI Compliant Port Driver",files.ohci1394,ohci1394
    usbehci = "Enhanced Host Controller",files.usbehci,usbehci
    usbohci = "Open Host Controller",files.usbohci,usbohci
    usbuhci = "Universal Host Controller",files.usbuhci,usbuhci
    usbhub = "Generic USB Hub Driver",files.usbhub,usbhub
    usbstor = "USB Storage Class Driver",files.usbstor,usbstor


    Insert the following in the [HiveInfs.Fresh] section:


    [HiveInfs.Fresh]
    AddReg = hivedef.inf,AddReg
    AddReg = hivesys.inf,AddReg
    AddReg = hivesft.inf,AddReg
    AddReg = hivecls.inf,AddReg
    AddReg = hiveusd.inf,AddReg
    AddReg = dmreg.inf,DM.AddReg
    AddReg = usbboot.inf,usbservices


    Then, in the [SourceDisksFiles] section:



    [SourceDisksFiles]
    usbboot.inf = 1,,,,,,_x,3,,3
    bootvid.dll = 1,,,,,,3_,2,0,0,,1,2
    kdcom.dll = 1,,,,,,3_,2,0,0,,1,2


    Save and close TXTSETUP.SIF.



  4. Edit DOSNET.INF so that the second [Files] section looks like this:

    [Files]
    d1,usbboot.inf
    d1,_default.pif
    d1,12520437.cpx
    d1,12520850.cpx


  5. Edit USB.INF as follows:


    [StandardHub.AddService]
    DisplayName = %StandardHub.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbhub.sys
    LoadOrderGroup = Boot Bus Extender

    [CommonClassParent.AddService]
    DisplayName = %GenericParent.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbccgp.sys
    LoadOrderGroup = Boot Bus Extender



  6. Modify USBPORT.INF like this.


    [EHCI.AddService]
    DisplayName = %EHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbehci.sys
    LoadOrderGroup = Boot Bus Extender


    [OHCI.AddService]
    DisplayName = %OHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbohci.sys
    LoadOrderGroup = Boot Bus Extender


    [UHCI.AddService]
    DisplayName = %UHCIMP.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbuhci.sys
    LoadOrderGroup = Boot Bus Extender


    [ROOTHUB.AddService]
    DisplayName = %ROOTHUB.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 0 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\usbhub.sys
    LoadOrderGroup = Boot Bus Extender


  7. Edit USBSTOR.INF:


    [USBSTOR.AddService]
    DisplayName = %USBSTOR.SvcDesc%
    ServiceType = 1
    StartType = 0
    Tag = 3

    ErrorControl = 1
    ServiceBinary = %12%\USBSTOR.SYS
    LoadOrderGroup = Boot Bus Extender


  8. Create a new file USBBOOT.INF with the following contents:


    [usbservices]

    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","DisplayName",0x00000000,"USB Mass Storage Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","ImagePath",0x00020000,"system32\DRIVERS\USBSTOR.SYS"
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\USBSTOR","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","DisplayName",0x00000000,"USB 2.0 Enhanced Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ImagePath",0x00020000,"system32\DRIVERS\usbehci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","DisplayName",0x00000000,"USB2 Enabled Hub"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ImagePath",0x00020000,"system32\DRIVERS\usbhub.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","DisplayName",0x00000000,"Microsoft USB Universal Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ImagePath",0x00020000,"system32\DRIVERS\usbuhci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Type",0x00010001,1

    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","DisplayName",0x00000000,"Microsoft USB Open Host Controller Miniport Driver"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ErrorControl",0x00010001,1
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Group",0x00000000,"System Reserved"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ImagePath",0x00020000,"system32\DRIVERS\usbohci.sys"
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Start",0x00010001,0
    HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Type",0x00010001,1


  9. If you haven't erased the original .IN_ files, do so now.


    erase USB.IN_
    erase USBPORT.IN_
    erase USBSTOR.IN_

    Compress the modified files with cabarc.


    cabarc n USB.IN_ usb.inf
    cabarc n USBPORT.IN_ usbport.inf
    cabarc n USBSTOR.IN_ usbstor.inf

    You'll get 3 compressed files with IN_ extension.



  10. Put these files back into the I386 subfolder of the Windows XP installation folder.

    • DOSNET.INF
    • TXTSETUP.SIF
    • USB.IN_
    • USBBOOT.INF
    • USBPORT.IN_
    • USBSTOR.IN_


  11. You'll need this boot sector (w2ksect.bin) to make your new CD bootable. Put w2ksect.bin inside the main folder containing XP files.



  12. Now, let's burn a new CD containing Windows XP files. Start ImgBurn and select Write files/folders to disc. Click the Browser for a folder... icon and select the folder containing Windows XP files. Then, set up options as follows.










    Insert a blank CD into your optical drive and burn it.



  13. Plug in your USB flash drive or USB hard drive to your computer and run the HP USB Disk Storage Format Tool. On Windows Vista or Windows 7, run it as administrator.




  14. From the I386 folder of XP installation CD, copy the following files to the USB drive:



    • ntldr
    • ntdetect.com

    Then, create a new file boot.ini with the following contents. Put it on the USB drive.


    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

    [operating systems]
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect


  15. Run the Partition Table Editor (PTEDIT32.EXE) as administrator. Select your USB drive from Hard Disk pulldown menu.




    Change the type of primary partition on the USB drive from 00 to 80. Click the Save Changes button.



    Partition Information should read FAT16X, Bootable



  16. Remove your hard drive from the computer. Then, connect your USB flash drive directly to your computer.



  17. Change the boot order in the BIOS so that your computer can boot from a USB drive. Typical BIOS options are as follows:


    • USB HDD
    • USB Hard Drive


  18. Insert your new Windows XP CD your burned above and boot your computer with it. During installation, don't format the USB drive. Just leave it as is.



  19. After successfully installing Windows XP on your USB drive, install the EWF or FBWF filter.



Tuesday, June 29, 2010

Dumping the Contents of a Data CD into an ISO file

ISO files are used to burn Data CD's. If you want to share software CD's with someone far away, you can dump the contents of the CD into an ISO file and then transfer the ISO file to him.


For this job, readom from the cdrkit package can do. If you use Windows, download cygwin1.dll and readom.exe, then put them in C:\Windows and start the Command Prompt. Put the Windows XP CD in your CD-ROM (Assume CD-ROM's drive letter is D:) and run the following commands:

readom dev='D:' f='/home/Public/Downloads/dumped.iso' speed=2 retries=8 -noerror -nocorr

Assuming we're using Windows Vista or Windows 7, we'll find the dumped ISO file at C:\Users\Public\Downloads\dumped.iso.


Alternatively, we can use WinImage to dump the CD contents. From the Disk menu of WinImage, make sure “use CD-ROM D:” is checked. Then, select “Create CD-ROM ISO image...” from the Disk menu. If you get an access error, close any Windows Explorer, Media Player or file manager.


We can also use CDBurnerXP, InfraRecorder or ImgBurn to dump the CD contents to an ISO file.

Wednesday, June 2, 2010

Compiling GTK+ Theme Engines

The GTK+ widget library supports diverse customization of look and feel for GTK+ applications. This is achieved by installing a shared library (*.so or *.dll) that provides a particular GTK+ theme style. The default GTK+ theme engine (Raleigh) is too generic and old-fashioned to suit my style. The pixmap engine is too much of a resource hog, and the Wimp engine doesn't seem to work for GTK+ 2.18 and later releases.


My favorite GTK+ theme engines are thus:



  • Aurora engine
  • Candido engine
  • CleanIce engine
  • Clearlooks engine
  • Lighthouseblue engine
  • MagicChicken engine
  • Murrine engine
  • Nodoka engine
  • Rezlooks engine
  • Smooth engine
  • Wonderland engine


Compiling GTK+ Theme Engines 2.20.1


After building GTK+ 2 library, I can compile GTK+ theme engines, including Clearlooks and Lighthouseblue. I couldn't find the upstream release of gtk2-engines, so I downloaded the source from Debian Sid's page.


gtk2-engines requires intltool, so I compiled intltool first.


tar xzvf intltool-0.41.1.tar.gz
cd intltool-0.41.1
./configure --prefix=/mingw
make
make install

configure script will complain if xgettext, msgmerge and msgfmt are not found. I got these programs from my static gettext package I compiled previously.



Then, I compiled gtk-engines as follows:


tar xzvf gtk2-engines_2.20.1.orig.tar.gz
cd gtk-engines-2.20.1/
./configure --prefix=/mingw --disable-deprecated --enable-animation
make

I only wanted clearlooks, so I copied libclearlooks.dll.


find -iname \*dll
cp ./engines/clearlooks/.libs/libclearlooks.dll /mingw/lib/gtk-2.0/2.10.0/engines


Compiling Aurora Theme Engine


I downloaded the Aurora source from here and unpack it. I compiled Aurora like this:


./configure --prefix=/mingw --enable-animation
make
make install


Cygwin: Compiling Smooth Theme Engine


The source code of smooth theme engine can be downloaded from here. Compiling is easy:


./configure --prefix=/usr
make
make install

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger