This 1867 Otto Langen atmospheric engine is the oldest still functioning internal combustion engine. It provide low RPM and power, but was commercially successful in its day. I found the best explanation as to how it works at the above link:
The engine comprises a long vertical cylinder, open to the atmosphere at its upper end, within a fluted column mounted on a pedestal. The appearance of the column is described as Grecian Ionic. At the top of the cylinder are mounted the drive shaft and flywheel. The piston, which is capable of free vertical movement, is attached to a long rack engaging with a spur gear on the drive shaft. The coupling between the spur gear and the drive shaft is achieved through a roller-wedge clutch. In this application the upward motion of the piston in unimpeded but the weight of the piston, some 50 kg, and atmospheric pressure provide the motive force for the engine during the downward movement. The flywheel, required to maintain constancy of speed, dominates the upper end of the engine. The base pedestal incorporates a cooling water jacket at the lower end of the cylinder and the gas inlet valve.
A second spur gear on the drive shaft meshes with a similar gear on an auxiliary shaft which has two joined, ratchet-activated, eccentrics which operate to (i) raise the piston and (ii) move the gas inlet slide valve, so that a new charge of the gas-air mixture is admitted to the cylinder when the piston is at the bottom end of the cylinder. This mechanism is activated by a lever, which engages the ratchet, rotating with the auxiliary shaft, which causes the eccentrics to operate so that the movement of the piston and the admission of the charge are correctly timed.
The column is made from cast iron, whilst the working parts are made from steel and bronze. Cylinder bore 150 mm, piston stroke 908 mm (max), output 0.5 horsepower (0.37 kW)
Operation. When the piston is at the bottom of its stroke it is raised, about 9% of the stroke, by a lever engaging with the rack and operated by an eccentric mounted on the auxiliary shaft. During this time an explosive mix of air and gas is drawn into the cylinder through a slide valve. This mix is then ignited by a flame contained within the slide valve cover. As a result of the explosion the piston is forced upwards until it comes to rest due to the combined influence of gravity and the development of a vacuum in the cylinder. As the piston descends it is connected to the drive shaft through the action of the roller-wedge clutch and so provides the motive force to operate the engine. Exhausting the products of combustion is effected through an exhaust valve. Speed is manually controlled by restricting the gas flow through the exhaust valve; this reduces the speed of descent of the piston, resulting in an increased interval between firing strokes.