Where did all the CO₂ come from that was deposited as coal during the Carboniferous?
Prior to the carboniferous period, and until the human industrial era, the majority of carbon dioxide in the atmosphere was due to volcanoes. 


  For billions of years, geological processes like volcanic eruptions controlled the carbon concentration in the atmosphere, as volcanism is the major way that carbon rises from the mantle into the atmosphere. Most of the carbon stored in the mantle is in the form of carbonate (a salt of carbonic acid), but there are also huge stores of actual carbon dioxide sequestered deep within the mantle as a dissolved gas within the liquid rock. 
  
  We can measure the degassing of Mt. Etna extremely well, and find that it adds about 16,000 tons of CO2 to the atmosphere each day, or 5.8 million tons per year. This might not sound impressive, but it's only one volcano. Interestingly, it's not just smoking, actively erupting volcanoes that emit CO2, but seemingly inactive volcanoes around arcs and rift zones. Persistent degassing still occurs around a great number of volcanoes worldwide, on a continuous basis.