Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


mrjrt

USB experiment with RTM XP

Recommended Posts

Hello all.

 

I'm doing a bit of an experiment to see if I can backport the USB support in SP3 to previous versions of XP. It's mainly just an interesting little project, but I have a USB BD-drive, and can't use it to install from a disc pre-SP3 as setup loses the drive and BSODs. Not that I'm likely to need to, but anyway. Project. ;)

 

I've read a lot of guides on this of late, and have integrated all sorts of other things successfully elsewhere using various tools, and I've certainly read a lot of threads, but I'd like to just clarify things as I can't seem to get the basics working when I do things manually, but I like to understand how my tools work so I can troubleshoot when they don't. This is a near-as clean copy of RTM (just some multiboot tweaks to the loaders), so conflicts aren't likely.

 

As a first step, my primary objective is to get the USB2 support into RTM. To this end I've looked at how this is achieved, and have copied the relevant files into a new cab (USB.cab a-la a SPx.cab file). I later discovered that the files also seem to exist compressed in the i386 directory directly, so I copied those over from SP3 as well (USBEHCI.SY_, etc.). Two new files, and a few updated ones. To apply those files I added the following bits into my txtsetup.sif:

--- D:/Temp/XPx86/install/O200/TXTSETUP.SIF	Sat Aug 18 12:00:00 2001+++ D:/Temp/XPx86/install/O201/TXTSETUP.SIF	Sun Nov 15 03:08:04 2015@@ -3476,6 +3476,7 @@ hardware.chm = 1,,,,,,,21,0,0 harrow.cur   = 1,,,,,,,,3,3 HCAppRes.dll = 1,,,,,,,,3,3+hccoin.dll   = 1,,,,,,,2,1,3,,1,2 hcross.cur   = 1,,,,,,,,3,3 hdwwiz.cpl   = 1,,,,,,,2,0,0 Headsp~1.wmz =1,,,,,,,,3,3    @@ -7671,12 +7672,14 @@ ups.exe      = 1,,,,,,,2,1,0 ureg.dll     = 1,,,,,,,2,1,0,,1,2 urgent.cov   = 1,,,,,,,,3,3      +USB.cab      = 1,,,,,,,39,0,0 usb.inf          = 1,,,,,,,20,0,0 usb8023.sys  = 1,,,,,,,4,0,0,,1,4 usbaudio.sys = 1,,,,,,,,3,3 usbcamd.sys  = 1,,,,,,,4,0,0,,1,4 usbcamd2.sys = 1,,,,,,,4,0,0,,1,4 usbccgp.sys  = 1,,,,,,4_,4,1,3,,1,4+usbehci.sys  = 1,,,,,,4_,4,1,3,,1,4 usbohci.sys   = 1,,,,,,4_,4,1,3,,1,4 usbport.inf  = 1,,,,,,,20,0,0 usbprint.inf = 1,,,,,,,20,0,0@@ -15323,7 +15326,8 @@   -SetupSourcePath = "\"+SetupSourcePath = "\O201\"+BootPath = \O201\I386\ MajorVersion = 5 MinorVersion = 1 DefaultPath=\WINDOWS@@ -15359,7 +15363,7 @@  Architecture = i386 -DriverCabName=driver.cab+DriverCabName=driver.cab,USB.cab  ProductType = 4 DisableAsr  = 1@@ -18060,10 +18064,12 @@ *ADP4215 = "aha154x" GenSFloppy = "sfloppy" SCSI\DiskMATs***ALS-120_COSM___04 = "sfloppy"+PCI\CC_0C0320 = "usbehci" PCI\CC_0C0310 = "usbohci" PCI\CC_0C0300 = "usbuhci" USB\COMPOSITE = "usbccgp" USB\ROOT_HUB = "usbhub"+USB\ROOT_HUB20 = "usbhub" USB\Class_03&SubClass_01&Prot_02 = "hidusb" USB\Class_03&SubClass_01 = "hidusb" USB\Class_03 = "hidusb"  [InputDevicesSupport.Load]+usbehci  = usbehci.sys usbohci  = usbohci.sys usbuhci  = usbuhci.sys usbhub   = usbhub.sys@@ -18405,6 +18434,15 @@ usbport.sys,4 usbohci.sys,4 +[files.usbehci]+hid.dll,2+hccoin.dll,2+hidclass.sys,4+hidparse.sys,4+usbd.sys,4+usbport.sys,4+usbehci.sys,4+  [files.usbuhci] hid.dll,2@@ -18461,6 +18499,7 @@ kbdclass.sys = 16 mouclass.sys = 16 driver.cab = 16+USB.cab = 16   @@ -20543,6 +20582,7 @@ i2omgmt  = "Intelligent I/O Support Driver"  [InputDevicesSupport]+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

This is what I stuck in drvindex.inf:

--- D:/Temp/XPx86/install/O200/i386/drvindex.inf	Sat Aug 18 12:00:00 2001+++ D:/Temp/XPx86/install/O201/i386/drvindex.inf	Sat Nov 14 21:45:49 2015@@ -1,6 +1,6 @@ [Version] signature="$Windows NT$"-CabFiles=driver+CabFiles=USB,driver   [driver]@@ -1995,11 +1995,8 @@ hcf_msft.sys hermes_1.ppd hermes_2.ppd-hid.dll hidbatt.sys-hidclass.sys hidgame.sys-hidparse.sys hidserv.dll hidswvd.sys hidusb.sys@@ -4368,16 +4365,10 @@ usbccgp.sys usbd.sys usbdload.hex-usbhub.sys usbintel.sys-usbohci.sys-usbport.sys usbprint.sys usbscan.sys usbser.sys-usbstor.sys-usbuhci.sys-usbui.dll usr1801.sys usr1806.sys usr1806v.sys@@ -4662,7 +4653,19 @@ xxwh1hlp.hlp zlogic.cyz -+[USB]+hccoin.dll+hid.dll+hidclass.sys+hidparse.sys+usbehci.sys+usbhub.sys+usbohci.sys+usbport.sys+usbstor.sys+usbuhci.sys+usbui.dll  [Cabs] driver=driver.cab+USB=USB.cab\ No newline at end of file

...and I'm booting from disc so strictly-speaking I don't need DOSNET.inf, but I have updated it regardless:

--- D:/Temp/XPx86/install/O200/i386/DOSNET.INF	Sat Aug 18 12:00:00 2001+++ D:/Temp/XPx86/install/O201/i386/dosnet.inf	Sat Aug 18 12:00:00 2001@@ -101,6 +101,7 @@ d1,hidparse.sys d1,usbd.sys d1,usbport.sys+d1,usbehci.sys d1,usbohci.sys d1,usbuhci.sys d1,usbhub.sys@@ -3503,6 +3504,7 @@ d1,hardware.chm d1,harrow.cur d1,HCAppRes.dll+d1,hccoin.dll d1,hcross.cur d1,hdwwiz.cpl d1,Headsp~1.wmz@@ -7938,6 +7940,7 @@ d1,urgent.cov d1,url.dll d1,urlmon.dll+d1,USB.cab d1,usb.inf d1,usb8023.sys d1,usbaudio.sys@@ -7945,6 +7948,7 @@ d1,usbcamd2.sys d1,usbccgp.sys d1,usbd.sys+d1,usbehci.sys d1,usbhub.sys d1,usbmon.dll d1,usbohci.sys

...but I keep being told that "The file usbehci.sys is corrupted". My understanding was that I didn't need layout.inf entries if they were compressed, but just in case I copied those over:

--- D:/Temp/XPx86/install/O200/i386/layout.INF	Sat Aug 18 12:00:00 2001+++ D:/Temp/XPx86/install/O201/i386/layout.inf	Sat Aug 18 12:00:00 2001@@ -223,8 +223,8 @@ serenum.sys  = 1,,14976,,,,4_,4,0,0,,1,4 parport.sys  = 1,,76160,,,,,4,0,0,,1,4 cdrom.sys    = 1,,47488,,,,5_,4,0,0,,1,4-usbuhci.sys   = 1,,18944,,,,4_,4,1,3,,1,4-usbport.sys   = 1,,123264,,,,4_,4,1,3,,1,4+usbuhci.sys   = 1,,20608,,,,4_,4,1,3,,1,4+usbport.sys   = 1,,143872,,,,4_,4,1,3,,1,4 rasl2tp.sys  = 1,,48256,,,,,4,0,0,,1,4 ndistapi.sys = 1,,9600,,,,,4,0,0,,1,4 ndiswan.sys  = 1,,87296,,,,,4,0,0,,1,4@@ -3476,6 +3476,7 @@ hardware.chm = 1,,32139,,,,,21,0,0 harrow.cur   = 1,,766,,,,,,3,3 HCAppRes.dll = 1,,6656,,,,,,3,3   +hccoin.dll   = 1,,7168,,,,,2,1,3,,1,2 hcross.cur   = 1,,766,,,,,,3,3 hdwwiz.cpl   = 1,,150016,,,,,2,0,0 Headsp~1.wmz =1,,242446,,,,,,3,3    @@ -7677,6 +7678,7 @@ usbcamd.sys  = 1,,23808,,,,,4,0,0,,1,4 usbcamd2.sys = 1,,23936,,,,,4,0,0,,1,4 usbccgp.sys  = 1,,24960,,,,4_,4,1,3,,1,4+usbehci.sys  = 1,,30208,,,,4_,4,1,3,,1,4 usbohci.sys   = 1,,15616,,,,4_,4,1,3,,1,4 usbport.inf  = 1,,18385,,,,,20,0,0 usbprint.inf = 1,,1670,,,,,20,0,0

...but it still complains and dies. So...thanks for reaching the end. Any ideas what I'm doing wrong here?

 

Whilst I wait for replies I'm going to try uncompressing the files in I386 and seeing if that works, as that's one area I'm particularly unfamiliar with. Ideally I'd like them to remain compressed though (for de-duplication purposes), and it has to be possible, I just don't understand if setup is not recognising them as compressed (in which case they will indeed seem corrupted!) or there is some other error...

Edited by mrjrt

Share this post


Link to post
Share on other sites

Ahem. Think I've found it.

 

SP1 adds some kernel exports to NTOSKRNL.EXE, in particular KeRegisterBugCheckReasonCallback and KeDeregisterBugCheckReasonCallback. USBPORT.SYS from SP3 links to these, and USBEHCI.SYS links to that, so it fails to load due to runtime link failure. I've replaced the USBPORT.SYS with the RTM one and the error went away.  USBEHCI.sys loads up fine now. :)

Share this post


Link to post
Share on other sites

...and just in case anyone else tries this later - it's a dead end.

 

 

SYMPTOMS
When you start your computer from a Microsoft Windows Preinstall Environment (WinPE) CD-ROM, or from a Microsoft Windows Server 2003 CD-ROM, by using a USB CD-ROM device, the computer may restart. You may receive the following Stop error message on a blue screen:

STOP 0x0000007B: INACCESSIBLE_BOOT_DEVICE
Fatal System Error
CAUSE
This problem may occur when USB devices are re-enumerated after the device detection stage of setup. This action causes the USB CD-ROM device not to be found in the list of available boot devices when the computer starts.

 

The fix unfortunately is in Ntoskrnl.exe / Ntkrnlmp.exe / Ntkrnlpa.exe / Ntkrpamp.exe, and the hotfix is for SP2, which would explain why SP3 works fine but nothing else does. I should be able to apply the hotfix to my SP2 images, but my RTM and SP1 images are SOL. :(

Share this post


Link to post
Share on other sites

A lot of time has passed, and I don't think (or cannot remember) if attempts with RTM were made at the time, but the whole stuff began (and was tested) with XP SP1 AFAICR.

 

 

Anyway the "right" place is here (if you are talking of "installing from"):

http://www.msfn.org/board/forum/157-install-windows-from-usb/

and this thread (if you are talking of "install to"):

http://www.911cd.net/forums//index.php?showtopic=14181

 

It is entirely possible that the USB CD-ROM is a "special case" though :unsure: all experiments/tests/whatever were made with USB sticks or hard disks but -at least on this topic of USB booting - the good MS guys have often published deceiving, incorrect or plainly wrong information, so I wouldn't trust them at face value.

 

The BSOD 0x0000007b is often generated by the "standard" NTDETECT.COM on some systems, so using the "modified" one is always suggested, see also FAQ #3 here:

http://www.msfn.org/board/topic/116766-faqs/

 

jaclaz

  • Upvote 1

Share this post


Link to post
Share on other sites

Thanks for that - much obliged.

 

Unfortunately doesn't seem to have made much difference - RTM still 0x7Bs, with:

a) NTDETECT.COM from SP3

b) Modifed NTDETECT.COM from the threads mentioned above

c) The kernels from that KB hotfix.

d) The SP3 kernels and SP3 NTDETECT.COM

 

Given your comments I might have a play with SP2 (and if that works, working back to SP1), but I'm tempted at this point to just include a note that you need an IDE optical drive to install anything older than SP3 :)

Share this post


Link to post
Share on other sites

Or you could change the install approach, in the mentioned sub-forum there are quite a bit of alternative ways, namely I would guess that a machine with an USB CD drive is likely to have more than 1 Gb of RAM so this way would do:

http://www.msfn.org/board/topic/137714-install-xp-from-a-ram-loaded-iso-image/

but also this way (adapted):

http://www.msfn.org/board/topic/121446-install-from-usb-after-booting-with-pe/

could work fine.

 

As a side note - and notwithstanding what you might find here and there - the "right" way (IMNSHO) to install an XP (but actually almost *any* OS) is to do so from a "local" (saved on the machine internal storage) copy because before or later it may happen that you need a file from the original install source (because of WFP or for some other reason) and then the OS will ask you to insert the install CD (unless you installed from local source, keeping a copy)  and in your case not only you will have lost or misplaced the actual CD disk :w00t: but you will also have not handy the USB CD drive :ph34r:.

 

JFYI, there is a thread:

http://www.msfn.org/board/topic/121502-install-xp-from-usb-the-easy-way-with-sandisk-cruzer/

about abusing of some USB stick controllers (the ones with two LUNs, 1 CD+1 HD like, often labeled "U3") to install from the CD like device, but it is entirely possible that the tests and reports were relative to SP3 source :unsure:

 

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites

Thanks for the ideas.

 

Basically, my ultimate aim is indeed installing from a USB stick, but I want to reserve the option of installing to a older machine when required, hence my decision to go down the route of building an ISO (that could be burnt to disc), and then using Firadisk to make said ISO available as a first option for the USB stick. This also enables hardlink-style de-duplication, letting me get 5 or so increasingly-tweaked versions of 15-odd variations of XP in a single 3GB ISO.) Having had some troubles with the initial Firadisk approach I decided to ensure a traditional CD-based fallback for troubleshooting, and given the issues I'm experiencing with my USB optical drive I'm beginning to suspect the problem is indeed the USB side of things (and indeed, file-mapped ISOs on the stick also seem to fail in a similar way).

 

In truth, I've not had to restore a file from the install media for over 15-odd years, so I'm not to bothered about that. A couple of my USB sticks stashed away and 7zip to extract from the ISO should suffice :)

 

I'll have a look at the PE-route, but my current plan works well enough if you install on hardware of an appropriate vintage...I'm just seeing how far back I can push that threshold. ;)

Share this post


Link to post
Share on other sites

Another couple things that you could/should verify may be (now that you mension the "huge" 3 Gb .iso):

  1. FiLeNaMe CaSe
  2. Isolevel
  3. Actual LBA in the .iso
  4. Non-iso-hardlinked sources

#1 may depend on #2 (original disks were iso-level 1 and thus FILENAMES WERE 8.3 AND ALL CAPS, while later versions were either iso-level 2 or 3, cannot remember exactly but this was a common enough issue in the good ol' days of BartPE) but it is entirely possible that pre-SP2 (or whatever) the CDROM.SYS (or again whatever) cannot read/access properly an isolevel higher than 1 or - and this comes to #3 - access particularly "high" LBA's in the .iso/CD, and the same could happen with hardlinks (because the actual file is beyond a given LBA).

 

 

Still in the good ol' times there was a file (a script for mkisofs) pe_sort.txt to put "key files" in a given order (which was to make PE's boot faster) but that you might find of use, see:

http://www.911cd.net/forums//index.php?showtopic=6869

which later proved to be of good use for sticks too:

http://reboot.pro/topic/6041-a-question-or-advice-for-pe-builds/

 

Just ideas... :unsure:

 

jaclaz

  • Upvote 1

Share this post


Link to post
Share on other sites

AFAIK, *all* Released XP's were made the same way (#1/#2) unless they were SlipStreamed.

Is there a tool that would indicate Level1-vs-Level2? My CD's are originals (as are my backup ISO's). IsoBuster only indicates ISO-9660. I will *assume that they're Level-2 and ASCII. (yes, all original made with associated CDIMAGE). And since XP only upgraded from 98+ I'll also assume that Level1 wasn't used. At all, ever. :unsure: As for points #3 and #4, as you said...

Share this post


Link to post
Share on other sites

Well, as always it is not something extremely clear.

 

The point is (or should be) that the actual driver used in the early part of setup only understands a given isolevel (and/or Joliet or not).

 

Files used in the early phases of setup need to be UPPERCASE and 8.3, and there are (were) tools (like toupper.exe or uppercase.exe or filecase.exe or similar) to make sure that this was the condition.

 

Now, for no apparent reason :w00t:, dashun9.cmd :yes: :

http://www.msfn.org/board/topic/171435-allow-lowercase-on-multiboot-dvd/

http://www.911cd.net/forums//index.php?showtopic=25612

 

jaclaz

Share this post


Link to post
Share on other sites

So...

 

...we seem to have some progress, and some accidental bonuses.

 

First up, I just installed SP2b from a USB-BD drive successfully.

 

What was needed were the following files from SP3 (5.1.2600.5512) replacing the SP2 (5.1.2600.2180) versions:

  1. NTKRNLMP.EX_ - SMP NT kernel
  2. NTOSKRNL.EXE_ - Uniprocessor NT kernel
  3. USBEHCI.SY_ - USB Enhanced Host Controller Interface (aka. 2.0 aka. high-speed) driver
  4. USBOHCI.SY_ - USB Open Host Controller Interface (aka. 1.1 aka low-speed/full-speed) driver

...and of course the smattering of additions to the hardware IDs DB in txtsetup.sif.

 

The updated SP3 kernel alone is insufficient, and will BSOD in the same way as the stock SP2 kernel, suggesting that jaclaz is indeed correct - MS lies and the updated drivers are required to avoid the re-enumeration. I suspected this would be the case when I found that the kernel from their hotfix that supposedly resolved the problem actually pre-dated SP2, which still had it (the hotfix is build 1524 and SP2 is 2180).

 

As the intent of my experiments is to have a clean install for compatibility testing (in this case, of SP2), having those files from a later version wasn't ideal in the end installation. Earlier failed attempts with more files and unsigned driver bypasses left me with those files in the resulting installation, so I was just about to do some trickery using renamed source files (as the kernel and drivers only need to exist during the initial read from disc - when the files are copied to mass storage I intended to overwrite them with the correct SP2 versions), I thought I'd try something and lo and behold - the install had lost the unsigned driver prompts and left me with the SP2 copies of the files, exactly as I wanted.

 

Having done a lot of reading the last few days, I'm fairly certain I know what has happened. The stock disc contains the updated versions of the files in the SP2.cab file, and these will be extracted over the separate files copied earlier from I386. Additionally, when there are multiple candidates for a driver Windows will rank them, with valid, signed drivers having a higher score. I suspect that if it isn't just a simple overwrite from the SP2.cab file then Windows is finding the SP3 drivers, deciding they're unsigned, and ranking the SP2 drivers higher and installing those instead.

 

Regardless, it works, leaves me with a stock install, and has only 4 files replaced from stock, which is nice.

 

Onwards to SP1. ;)

Edited by mrjrt

Share this post


Link to post
Share on other sites

Regardless, it works, leaves me with a stock install, and has only 4 files replaced from stock, which is nice.

Onwards to SP1. ;)

Nice :thumbup

If I may :unsure: this is something that you could (of course only if you have the time and dedication for it) check before "going back in time":

...and of course the smattering of additions to the hardware IDs DB in txtsetup.sif.

ideally the modifications to txtsetup.sif (and/or to the other files you mentioned) should be verified to be the bare minimum required (and no more) or if needed trimmed down to only what is actually needed.

 

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites

If I may :unsure: this is something that you could (of course only if you have the time and dedication for it) check before "going back in time":

ideally the modifications to txtsetup.sif (and/or to the other files you mentioned) should be verified to be the bare minimum required (and no more) or if needed trimmed down to only what is actually needed.

I can certainly have a look for you, but I deliberately went through the USB ID database at http://www.linux-usb.org/usb.ids to hunt down all known floppy, optical, bridge et al IDs so that XP would know how to handle the devices with the existing usbstor.sys driver. I suspect all I personally would require would be the bridge ID for the USB-SATA enclosure my optical drive uses, but those IDs are freebies that don't require modification to any installed files, so I'm not too fussed about those.

In other news: SP1 completes text mode successfully (yay!), but BSODs in GUI mode setup near the end of the devices phase with a 0x0A (IRQL_LEVEL_NOT_EQUAL). I've confirmed the files on disk copied from text mode are the original SP1 ones, so I may have to do a bit more experimenting there. Perhaps installing SP1 from a SATA drive and then seeing what happens when I plug the optical drive into a running SP1 system...?

 

Interestingly, if I leave the optical drive unplugged that phase doesn't crash, but obviously setup can't find files on the disc until I connect it.

Edited by mrjrt

Share this post


Link to post
Share on other sites

So...I identified the cause of the SP1 failures.

 

If I switch HAL during setup, it installs fine. Doing a spot more digging identified the issue is that when using the ACPI Multiprocessor HAL setup crashes when installing cpu.inf (which installs a driver specific to your CPU, processr.sys for Intel CPUs, or a special alternative if needed). Removing the inf file enables SP1 setup to complete successfully. I might do a bit more digging to see why it seemingly has no issues on SP2 & SP3.

 

So now I'm back, at last, to RTM. Alas, text mode fails with: 0x0000006B ( PROCESS1_INITIALIZATION_FAILED ), and from the params (0x7A (STATUS_PROCEDURE_NOT_FOUND), 0x8 (?), 0x0, 0x0) I can tell that it can't find a procedure, so probably just need ot copy over another setup-related binary.

Share this post


Link to post
Share on other sites

Just thought I'd come back to this as I don't like finding abandoned threads...

Basically, I think I was being an id*** and confusing myself. I'm not sure.

Suffice to say, I cleared everything down to stock and started again and found that it was more likely related to the USB3 support than anything else, but in the process have ended up in a bit of a quandary with RTM USB2. If I add in USB3 support as well, then I currently lose all USB1 & USB2 until GUI PnP setup, but it's fine from then on. If I don't patch in USB3, then my backported USB2 works fine. Hmm.

As for the HAL issues, I found that backporting processr.sys from SP2 (and tweaking CPU.inf to not overwrite it!) solves that issue perfectly.

I'm currently integrating more USB3 drivers, but that's not related to RTM so I'll leave it there.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...