Win95 (and 98) allow direct hardware calls to be made.
I worked for a place where some of their automation was still running under DOS 5.0. Worked fine. :-)
I just retired a Compaq Prolinea 386sx running DOS 3.3 that was controlling some old lab equipment.