Not as long ago as you may think. Although they were around before than, "portable" cast iron stoves didn't start to become really common until the 1820s. Before that, cooking was done primarily on a hearth or over an open fire.
There were, to be sure, other methods. But far and away, cooking...