Geared steam locomotive
This gearing is part of the machinery within the locomotive and should not be confused with the pinion that propels a rack locomotive along the rack between the rails. The geared steam locomotives that have been built have been for conventional track, relying on the adhesion between wheels and rail.
Bahnbetriebswerk (steam locomotives)
Every large "Betriebswerk" had its own roundhouse with a turntable. The locomotives were turned on the turntable and berthed in the roundhouse. This was heated so that the steam locomotives did not fully cool down, otherwise raising steam took too long. 
In order to move steam locomotives that were stored 'cold', locomotive winches were installed. It was prescribed by almost all railway companies that at least 75% of all locomotives had to be able to be berthed in the locomotive shed, the rest would be stabled on stabling roads in the open.