The father of all giants, Ymir, was formed at the beginning of everything from the primeval melting that occurred in the place where the icy wastes, Niflheim, bordered the region of fire, Muspelheim. Ymir was nourished by the cow Audhumia, who also caused the formation of Buri, the grandfather of the first gods, Odin, Vili, and Ve.
These gods killed the giant Ymir. So much blood flowed from Ymir's wounds that all of Ymir's children, the frost giants, were drowned in it, except Bergelmir and his wife, who managed to climb up into an ark and float away.
Odin, Vili, and Ve used Ymir's blood to make the world's lakes and seas, his flesh to make the Earth, and his bones and teeth to make rocks. The three gods made Ymir's skull into the vault of heaven and his brain into the clouds. Bergelmir and his wife lived on to become the parents of all the frost giants who lived in Jotunheim (Giantland) and fought against the gods.
A variation of this creation myth refers to a mighty cosmic mill that ground out the Earth and the rocks, reefs, and islands of the world from the body of a giant named Bergelmir