• Please review our updated Terms and Rules here

How to restart the floppy service in Windows NT 3.51

maxtherabbit

Veteran Member
Joined
Apr 23, 2019
Messages
1,898
Location
VA, USA
I'm trying to be able to adjust the FDD configuration parameters in NT. They are read from the registry by the floppy driver at startup. The floppy driver must be run as a system service in order to provide drive letters for the disk drives.

If I change the configuration data in the registry after the service is started, it does not pick up the new values.
If I change the startup type of the driver to 'manual' it does not assign drive letters. (After starting it manually)
If I let the service start as normal as a system service, then change the registry data, and then attempt to stop the service (to ultimately restart it) I get the error: "the requested stop or pause is not valid"


Any thought on how to get around this? Is it as simple as changing a flag on the service somewhere to mark it "stoppable"? If so, where?
 

maxtherabbit

Veteran Member
Joined
Apr 23, 2019
Messages
1,898
Location
VA, USA
Why not restart the service and reboot? It's been a long time since I wrote drivers for 3.51, but some things need to be done that way.

If I reboot, the changes I made to the registry are overwritten by the information that NT grabs from the system BIOS. My purpose is to NOT use the BIOS information, and provide my own values.
 

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
39,801
Location
Pacific Northwest, USA
Hmmm, I wonder if you could layer in a driver and override the values in floppy.sys.

Alternatively, you could simply insert your own version of floppy.sys, since the source, IIRC, is in the DDK.
 
Last edited:

bakemono

Experienced Member
Joined
Jan 19, 2020
Messages
172
Location
USA
I wonder why it doesn't provide a drive letter when started manually. Could there be some alternate \\foo\bar sort of device name to get access to the floppy instead of A: ? Getting FAT32 partitions to come up involved adding a DosDevices value under the local_machine\system\mounteddevices key... maybe something there?

If the floppy.sys is reading values from the registry which were written there earlier in the boot process, then rather than trying to intercept the values themselves I would say it is probably easier to hack floppy.sys so it reads the values from a different location. That is, find the name with a hex editor and change it, then add the tweaked values in the registry under the new name. Of course this would still need a reboot for the tweaks to take effect.
 

maxtherabbit

Veteran Member
Joined
Apr 23, 2019
Messages
1,898
Location
VA, USA
Hmmm, I wonder if you could layer in a driver and override the values in floppy.sys.
Not sure what you mean by layer exactly? How would I ensure the other driver loads before floppy.sys?

Alternatively, you could simply insert your own version of floppy.sys, since the source, IIRC, is in the DDK.
Yes I can, in fact you directed me to the source in the DDK months ago. I was trying to attempt a "smaller hammer" solution before rewriting floppy.sys but that is indeed my backup plan
 

maxtherabbit

Veteran Member
Joined
Apr 23, 2019
Messages
1,898
Location
VA, USA
I wonder why it doesn't provide a drive letter when started manually. Could there be some alternate \\foo\bar sort of device name to get access to the floppy instead of A: ? Getting FAT32 partitions to come up involved adding a DosDevices value under the local_machine\system\mounteddevices key... maybe something there?
Maybe, I'm not super familiar with the early NT registry layout. All I know is when I booted up with floppy.sys not set to "system" as the start type and then started the driver manually, I got no error, but also no drives.
 

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
39,801
Location
Pacific Northwest, USA
"Layered" is something that is probably NT-specific (maybe later Windows 9X). For a time (up through W2K) we sold a custom driver layered over the standard NT floppy driver that provided support for low-level control of floppy drives. This was mostly sold to embroidery software outfits who needed to support various old floppy formats. Basically, it inserts itself between the Windows API and the kernel-mode device driver and is essentially a duplicate of the logic in the floppy driver, but with a set of APIs all its own.

So what I'm suggesting is that you should take the floppy.sys source and see if there's an IRP that will do the job, then write a layer to issue it. As I said, this has been nearly 30 years from NT 3.51, so I may not remember much.
 

alank2

Veteran Member
Joined
Aug 3, 2016
Messages
1,857
Location
USA
It seems like NT had different starting classes like "boot" or "system" for drivers to determine when (and possibly when) they could load and whether they could (or not) be unloaded.
 

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
39,801
Location
Pacific Northwest, USA
I had a look at my NT 4.0 code that I happened to have at hand. I think that you can use a layered device drive to hook the callback from IoQueryDeviceDescription() to alter the BIOS parameters. I don't know if 3.51 implemented PnP, but if so, there's a similar callback for that.

My recollection was that a custom floppy driver for NT was a monstrosity, with over 5K lines of C.
 
Top