QUOTE (raskren @ Feb 9 2004, 09:59 PM)

SEE ATTACHMENT - HEREWITH
A while back I posted
how to add 3rd party SATA/RAID/SCSI/IDE drivers that were not included with Windows. This involved making changes to the TXTSETUP.SIF file located in the i386 directory.
Let's look at adding the driver file in the [SourceDisksFiles] section....
The txtsetup.sif explainedBackground:
Windows Setup uses a number of key files to control how the Windows Setup behaves. This mechanism dates back to the Windows NT era. If you are able to control these files, you are controlling how Windows Setup behaves. For now you need to be aware of three files:
DOSNET.INF - Used by WINNT.EXE/WINNT32.EXE during the file copy phase of the Setup.
LAYOUT.INF - Used as a template for file copy operations. DO NOT EDIT THIS FILE!
TXTSETUP.SIF - Used by the textmode phase of the Setup and prepares for the GUI phase of the Setup.
The textmode phase is invoked after the reboot from the copy phase or when booting from the installation CD-ROM. This article will be limited to adjusting the txtsetup.sif file only, since most installations will be initiated from a bootable installation CD-ROM.
Textmode and the txtsetup.sif file:
As mention before the txtsetup.sif file is used by textmode phase of the Windows Setup and largely controls how the Windows Setup behaves. Among the tasks the textmode phase performs, are the following:
Preparing the filesystem for installation (formatting, creating folders).
Copy the basic Windows files needed to start the GUI phase to the destination folders.
Loading setupreg.hiv needed by the GUI phase and preparing the Initial Registry configurations.
Txtsetup.sif sections:
Every information file is divided into sections. Sections can be identified by brackets, eg. '[MySection]'. For adding OEM drivers so the storage hardware can be used by the Textmode phase of the Windows Setup the following sections are important to be aware of:
CODE
[WinntDirectories]
1 = "\"
2 = system32
3 = system32\config
4 = system32\drivers
20 = inf
[SourceDisksFiles]
dummy.sys = 1,,,,,,3_,4,1,,,1,4
[HardwareIdsDatabase]
PCI\VEN_9999&DEV_1234 = "dummy"
[SCSI.load]
dummy = dummy.sys,4
[SCSI]
dummy = "Robert's Dummy Storage Driver"
Although 'Dummy' is used as an example entry, if a 'dummy.sys' would actually exist on the installation media and the above entries would have been added to the 'txtsetup.sif' the Textmode phase of the Windows Setup would have displayed in the status bar of the screen 'Loading Robert's Dummy Storage Driver ...'.
[WinntDirectories]:
This section maps a physical directory, either absolute like '\' or relative to %SystemRoot%. The folder is identified throughout the Windows Setup by the number it was assigned to. Eg. '4 = system32\drivers' maps the number '4' to '%SystemRoot%\system32\drivers'.
[SourceDisksFiles]:
This section controls how source files are copied to their destination and what their properties will be, eg. The file 'dum__.inf' can be copied to '%SystemRoot%\Inf\dummy.inf' with the line: 'dum__.inf = 1,,,,,,,20,0,0,dummy.inf'.
[HardwareIdsDatabase]:
This sections holds the mapping of physical PCI resources that will be controlled by the various drivers. In the above example the driver identified by the name 'dummy' controls a piece of hardware that identified by the following PCI Vendor ID and PCI Device ID: 'PCI\VEN_9999&DEV_1234'. If there are multiple drivers that control the same PCI Vendor ID and PCI Device ID we can expect a bugcheck. If the wrong information is entered here for Storage hardware, you definitely get a bugcheck '0x0000007B' better known as: 'INACCESSIBLE_BOOT_DEVICE'.
[SCSI.load]:
You can add as many drivers as you want, but if the Windows Setup doesn't load them, they can not be used during the setup. This section controls if the various drivers are loaded during initialization and in what order. This section is processed from top to bottom, so drivers listed first are loaded first. So, dummy = dummy.sys,4 loads the driver 'dummy.sys' from the folder '%SystemRoot%\System32\Drivers'
Note: It's relative to the destination folder!.
[SCSI]:
If Windows Setup would display 'Loading dummy.sys...' we still wouldn't know what kind of driver (except for its name) is being loaded. Displaying something like 'Loading Robert's Dummy Storage Driver ...' looks much better. That is the primary function for this section, displaying a 'friendly name'. The format is something like: 'driver_name = "Friendly Name"'. The 'Friendly Name' part can be any text, but it's custom to use a string that can be found in either the drivers 'txtsetup.oem' or 'driver.inf', but more about that in the next part of this article.
Modifying the txtsetup.sifBackground:
As mentioned before the Windows Setup exist from two phases know as the 'Textmode' phase and the 'GUI' phase. Adding storage drivers Textmode phase doesn't necessarily mean that the GUI phase is aware of the storage device presented by the driver. So if you add a driver to the Textmode phase of the setup and install Windows on the device presented by that driver, after the GUI phase has completed successfully and Windows has been installed, you will not be able to boot because the driver is not installed correctly. To avoid this, the driver must also be installed during the GUI phase.
If you're familiar with unattended installation you probably know about a feature called: 'OemPnPDriversPath', but unfortunately that option is not available in attended installations. So we have to come up with another solution. The GUI phase parses the %SystemRoot%\Inf folder for any information files present, if we could make sure the Textmode phase copies the driver .inf file to that folder, we would be save. Well that is, almost save. Actually there are two solutions; one simple and another more complex but more elegant. Both methods will be discussed here, the former being mandatory:
Preparing the modifications:
In the previous section we saw how the txtsetup.sif is constructed. So somehow we need to obtain the information to be able to modify our own txtsetup.sif and add our own driver. What we require is outlined below:
Obviously we need the 'Promise' SATA driver, which can be downloaded here or here.
We also need the setup information file from the downloaded 'Promise' driver zip file, fasttx2k.inf.
And the driver file itself, fasttx2k.sys.
The textmode OEM information file, txtsetup.oem.
The entire content of the Windows Server 2003, Standard x64 Edition copied to a temporary folder. Keep in mind that files copied from CD-ROM have the 'Read only' attribute set.
Extracting the required information:
Now execute the following steps one-by-one.
Extract the downloaded driver zip file, 1_FastTrakS150TX-Series-PDC2037x-1.00.1.39.zip to a temporary folder.
Open the txtsetup.oem with a text editor. Notepad.exe is adequate.
Search for a string that looks like this: driver = d2, fasttx2k.sys, fasttx2k.
This gives us the driver file name, fasttx2k.sys and the internal driver name, fasttx2k. Take note of these filenames.
Now search for a string that looks like this: FastTrak_TX2K_net = "Promise FastTrak 378/TX4000/S150 TX Series Controller", fasttx2k.
Now we have the drivers Friendly name, Promise FastTrak 378/TX4000/S150 TX Series Controller. Save the friendly name.
Look for any line that starts with: id="PCI\VEN_" and save those too. These are the unique PCI Vendor ID's and PCI Device ID's that identify a certain adapter.
Now that we have the required information we can proceed with the next step.
Modifying the txtsetup.sif file:
First we need to add the files to the [SourceDisksFiles] section of the txtsetup.sif. To do that, open any text editor and add the two lines under the [SourceDisksFiles] section below in the txtsetup.sif file. The txtsetup.sif can be found in the \AMD64 directory of the installation source.
CODE
[SourceDisksFiles]
fasttx2k.sys = 1,,,,,,3_,4,1,,,1,4
fasttx2k.inf = 1,,,,,,,20,0,0
The line fasttx2k.inf = 1,,,,,,,20,0,0 has been added, although not necessary for Textmode mode storage detection, it is necessary by the GUI mode hardware detection. Remember, it parses the %SystemRoot%\Inf folder for existing .inf files. Notice the numbers 4 and 20 being bold. This is the destination folder where the files will be copied to. As mentioned in the previous section, folders are mapped to numbers. For the complete list look at the [WinntDirectories] of the txtsetup.sif.
CODE
[WinntDirectories]
4 = system32\drivers
20 = inf
Also notice the 1 being bold. Of course the Windows Setup needs to know where the files are copied from. This is being controlled from the first field after the '=' sign. Now take a look at the list below.
CODE
[SourceDisksNames]
1 = %cdname%,%cdtagfilea%,,
7 = %cdname%,%cdtagfilea%,,\lang
8 = %cdname%,%cdtagfilea%,,\lang
8 = %cdname%,%cdtagfilea%,,\lang
10 = %cdname%,%cdtagfilea%,,\lang
11 = %cdname%,%cdtagfilea%,,
As we can see from the list above, 1 equals: 1 = %cdname%,%cdtagfilea%,, The line under [SourceDisksFiles] section, fasttx2k.sys = 1,,,,,,3_,4,1,,,1,4 copies the fasttx2k.sys from the folder to %SystemRoot%\Systems32\Drivers folder. Note: Changing the value of 1 to 11 would also work.
Now we need to add our own hardware ID's to the [HardwareIdsDatabase] section of the txtsetup.sif. The format should be similar to the following:
CODE
[HardwareIdsDatabase]
PCI\VEN_105A&DEV_6629 = "fasttx2k"
PCI\VEN_105A&DEV_3371 = "fasttx2k"
PCI\VEN_105A&DEV_3319 = "fasttx2k"
PCI\VEN_105A&DEV_3373 = "fasttx2k"
Next the driver needs to be loaded during the Textmode phase. To accomplish that, add the following entry to the [SCSI.load] section of the txtsetup.sif:
CODE
[SCSI.load]
fasttx2k = fasttx2k.sys,4
I would suggest to place this line direct below the atapi = atapi.sys,4 line. The atapi.sys is the first driver that is loaded, adding our driver direct below it, would make our Promise driver the 2nd driver loaded during the Textmode phase.
The last entry we have to add is the drivers Friendly name under the [SCSI] section of the txtsetup.sif file. To accomplish that, add the following line:
CODE
[SCSI]
fasttx2k = "Promise FastTrak 378/TX4000/S150 TX Series (tm) Controller"
Now that we have our modified version of the txtsetup.sif file, save it and close the text editor.