Installing Windows Drivers From a USB Drive
Using TBOSDT for DOS/TBOS
Note: This article is obsolete. Use the OSDTOOL.TBS script instead. For an example video click here.
Overview: This tutorial covers installing a Windows XP storage driver by using the DOS/TBOS version of
TBOSDT from a bootable USB flash drive containing all files required to install the driver. The USB drive boots using TBOS, which is a small operating system from
TeraByte Unlimited included in the TeraByte OS Deployment Tool Suite (TBOSDTS).
While scripting is powerful and flexible, TeraByte plans on
providing an interactive wizard in the first quarter of 2009 for
those individuals users who don't understand or need scripting.
Starting Point: A typical scenario for using the procedures below would come about when
an existing Windows installation (for which an image exists) needs to be restored on a system where the
storage controller is not compatible with storage driver used on the original system. Such conditions
could occur when the motherboard or entire system has been replaced. Because the target system has a different
mass storage controller (for example, a SATA controller rather than an IDE controller), the restored image
will not boot because it lacks the correct driver. This is where TBOSDT comes in.
The starting point for the procedures outlined below will be an image of a Windows XP partition that has been
restored to the boot drive (HD0) of the target system. Since the driver for the new hard drive controller has
not yet been installed, the Windows partition will not boot on the target system.
When restoring the Windows image, you should ensure that the restored partition is set active, and that
the standard MBR code has been installed. When restoring a single partition with any of the TeraByte
Unlimited image products, the Set Active and Write Standard MBR Code restore options can be used to ensure
those conditions. They are not needed nor available when restoring an entire drive.
This tutorial will use the specific example of installing the driver for the
Intel SATA AHCI Controller on a restored image of Windows XP (this is the driver
most users require for Windows XP to run on a new SATA system. To locate
that driver, see the Creating a Windows XP Slipstreamed Disc using nLite tutorial).
In addition to this tutorial, please refer to Application Example #2 near the end of the TBOSDT manual (tbosdt.pdf),
where you will find a description of this overall process.
Software Requirements:
TeraByte OS Deployment Tool Suite (TBOSDTS)
Storage drivers for the new system (.INF, .CAT, .SYS file types)
System Requirements:
The target system must support booting from a USB drive
Step 1: Extract the TBOSDTS distribution file
Starting with the downloaded TBOSDTS distribution file (tbosdts_en.zip), extract the contents to a convenient location,
such as a folder on the desktop. Note that the actual TBOSDTS programs and support files will need to be extracted from
tbosdts.zip, which is a secondary zip file contained inside of tbosdts_en.zip.
This file requires a password to unzip,
and that can be found in the readme.txt file inside of tbosdts_en.zip. Once extracted, you should have a folder
(typically named tbosdts), with the following contents:
Step 2: Create the TBOS boot disk on a USB flash drive
In this step, there is a choice of creating the boot disk on the USB flash drive in “Partition” mode, “Floppy” mode,
or “Normal” mode. All systems capable of booting from a USB drive should work with at least one of these modes, but some
may not work with all three of them. This situation is BIOS dependent, and is why more than one mode is offered.
The characteristics of the three modes can be summarized as follows:
Mode | Formatted Size | BIOS Emulation Type |
Normal | Floppy diskette size (1.44MiB). Space for driver files is approximately 600KiB | Floppy |
Floppy | Full size of USB flash drive. | Floppy |
Partition | Full size of USB flash drive. | Hard Drive. (may shift internal HD0 to HD1) |
Which mode to use will depend upon which one(s) boot successfully on your system, as well as the space required to hold the Windows driver files for the specific driver being installed. The driver files for the Intel SATA Matrix driver used in this tutorial require about 370KB, and would therefore would fit on the flash drive using Normal Mode if desired.
The difference between Partition mode vs. the Floppy and Normal modes is that Partition mode causes the drive to be seen as a hard drive by the BIOS. When the drive is booted from, it will usually become HD0 and cause the internal Windows drive to shift to HD1. This does not happen with the Floppy and Normal modes. Therefore, which mode is used will affect the contents of the Stage 1 script, because it needs to mount the Windows partition from the correct drive. The contents of the Stage 1 script are covered in Step 5.
To create the boot disk, connect the USB flash drive, and start up the maketbos.exe (MakeDisk) program located in the dos_tbos folder.
After the License screen, select all three options on the TeraByte OSD Tool on the “Select the optional components” screen.
On the “Select target” screen, select the USB flash drive, and
then select Normal, Floppy, or Partition mode under USB Mode. We'll select the
Partition option here as it is the most compatible option.
Click Finish to create the boot disk
In My Computer open the drive letter corresponding to the USB flash drive. In some cases (depending on the previous format of the flash drive)
you may need to safely remove and then reinsert the flash drive before the contents of the drive can be viewed in Windows. The contents of
the USB flash drive should now be as shown below. The file tbosdt.exe is the DOS/TBOS version of TBOSDT:
Step 3: Copy the additional required files to the USB flash drive
The files listed in the required files section above must now be copied to the USB flash drive. These can be located as follows:
drvins_1.run and drvins_2.run: Located in the tbosdts\scripts folder
tbosdtw.exe (Windows version): Located in the tbosdts\win folder. This file
is named tbosdtw to differentiate it from the DOS/TBOS version already on the
boot disk.
iaahci.inf, iaahci.cat, iastor.sys: These are the specific driver files needed to install the Intel SATA driver used in this example.
These files will be named differently for other drivers.
When all of the above files have been copied to the boot disk, the contents should be as shown below. Note again that tbosdt.exe is
the DOS/TBOS version of TBOSDT, and tbosdtw.exe is the Windows version of TBOSDT:
Step 4: Boot from the USB flash drive
To boot from the USB flash drive, you will typically need to enter the BIOS setup and change the boot order so that the
system will boot from the USB drive. Some systems may also provide a key to press during boot, which will bring up a menu
of devices to boot from. If so, you can select the USB flash drive from that menu, rather than entering BIOS setup.
If the flash drive does not boot, and you know the BIOS settings are correct, return to Step 2 and try a different mode.
If the boot is successful, it should leave you at the TBOS Command Interpreter
prompt. From there, you can launch TBOSDT.EXE
to determine/verify the hard drive number and partition ID for the Windows drive/partition. To do that, type TBOSDT and press
enter.
Step 5: Determine the location of the Windows partition
Once at the TBOSDT Command Prompt run the commands: list hd 0and list hd 1
Those two commands
will list the partitions on BIOS drives HD0 and HD1 respectively. Observe which drive is the internal drive (the Windows drive),
based on the partition(s) it contains. In most cases, the Windows drive will be HD1
when the system is booted from the USB flash drive created using the Partition
mode, and will be HD0 otherwise. However, this should always be verified,
and not assumed.
A typical output for a drive with one primary partition will look similar to the following:
Name Size Typ ID File System ---------------- ---------- --- ------ ------------------ WinXP 17602MB Pri (01) HPFS/NTFS
The line above is showing a drive with one primary NTFS partition of approximately 17 GiB, and a partition ID of 01.
Make a note of the hard drive number and partition ID for
the Windows partition, they will be used in Step 6 when editing the
drvins_1.run script. On a drive with just one primary partition
(as this example is assuming), the ID will be 01, but could be a different value with other partition layouts.
When finished, type ‘exit’ and press <enter> to quit TBOSDT. This will return you to the TBOS
command prompt.
For my example below I found the Windows partition is on HD 1 with the ID of 02
by looking at the Size and File System:
Step 6: Edit the TBOSDT scripts on the USB flash drive
Edit the drvins_1.run file by typing 'ezedit drvins_1.run' at the TBOS command prompt.
Once the file is open make the following changes:
- Adjust the mount command under Step 1 to use the information you obtained in Step 5 above
- Remove the "a:\" from the copy commands under Step 3a
- Remove the comment character ";" from the lines
under the following Steps:
- Step 1 (one line)
- Step 2 (one line)
- Step 3a (three lines)
- Step 4 (two lines)
- Step 5 (one line)
- Step 6 (one line)
- Step 7 (two lines)
- Step 8 (one line)
- Step 9 (four lines)
- Press Alt-S to save the changes.
The file should look like the following:
Edit the drvins_2.run file (assumes the editor is still open from editing drvins_1.run above)
- Press Alt-O to bring up the open file dialog
- Type "drvins_2.run" and press enter.
- Remove the comment character ";' from the line under Step 1
- Press Alt-S to save the changes
- Press Alt-X to exit the program and return to the TBOS command prompt
The file should look like the following:
Step 7: Run the Driver Installation Script.
From the TBOS command prompt, run the command ‘tbosdt drvins_1.run’ to execute the Stage 1 script.
Observe the output of the script as it executes, and watch for any error messages. Common causes for errors include:
- Attempting to mount the wrong drive/partition (Step 1 in drvins_1.run)
- Failing to uncomment one or more commands in drvins_1.run
- Syntax and/or typing errors in drvins_1.run
The script must run without errors before the target partition can be expected to boot successfully.
When finished, type ‘exit’ to exit the command prompt. This will cause TBOS to prompt for a reboot by
pressing <Enter>.
Before proceeding to Step 8, change the BIOS boot order back to what it was before
so Windows will boot. If you selected the USB drive from a
menu during boot (rather than entering BIOS setup), this should not be necessary.
Step 8: Boot from the target partition to execute the Stage 2 script
Once the Stage 1 script has executed successfully in Step 7, it should now be possible to boot from the target partition. The following sequence of steps is recommended:
- Boot the system from the target partition. On first boot, a terminal window will appear, and the Stage 2 script will be executed.
After a typical delay of a few seconds, the system should reboot automatically. (This will only happen once, on the first boot).
- On reboot, boot Windows into Safe Mode. Using Safe Mode allows Windows to detect the new hardware without
hanging and/or other issues that can arise due to certain types of new hardware, particularly video adapters.
To boot to Windows XP Safe Mode: As the computer is booting (just after the post), continuously tap the "F8 Key" which should bring up the "Windows Advanced Options Menu". Use your arrow keys to move to "Safe Mode" and press your Enter key.
If you can't boot in to safe mode it may be due to the fact that the HAL also needs to be replaced. While the details are outside the current scope of this article, this is basically done by copying the correct file to the \windows\system32\hal.dll. The HAL files available (through Win2003) are HAL.DLL, HALAPIC.DLL, HALMPS.DLL, HALACPI.DLL, HALAACPI.DLL, HALMACPI.DLL. The most common file needed for modern systems is HALACPI.DLL, HALAACPI.DLL or HALMACPI.DLL which can be found in the \windows\servicepackfiles\i386 folder. You can use TBOSDT to mount the partition and copy the file needed.
- Once up and running in Safe Mode, allow Windows to complete detection of the new hardware.
Reboot when prompted.
- On reboot, allow Windows to boot normally. The driver installation should now be complete.
Please note that WPA (Windows Product Activation) may be tripped because of the new hardware detected, and if so, Windows will need to be reactivated.