One of the problems in installing a chimney is to ensure that the chimney works properly. Our distant ancestors understood that the warm air was going upwards so to avoid filling the smoke shack an opening to the roof was needed.
We can take as an example the "American Indians": they built tapered tents (the tepees) equipped with primitive chimneys. In cold periods the fire was lit in the tent provided with upper flaps (ears) that conveyed the smoke outside. In fact, the ears could be opened or closed.
In the ancient Italic populations the hearths were used as stoves and ovens thanks to the mild climate. These hearths used for cooking were placed in the Domus, living room and kitchen of the Domus and through an opening in the roof the smoke came out. This place was called "fireplace room".
In the ancient Egyptian world, the hearth was the center of the home. To pass from the primitive fire to the chimney and the hood it took a long time and a lot of ingenuity: it passed to the separation of the kitchen to the living room.