We present one-dimensional models of the hot gas in dark-matter halos , which both predict the existence of cool cores and explain their structure . Our models are directly applicable to semi-analytic models ( SAMs ) of galaxy formation . We have previously argued that filaments of cold ( \sim 10 ^ { 4 } K ) gas condense out of the intracluster medium ( ICM ) in hydrostatic and thermal equilibrium when the ratio of the thermal instability timescale to the free-fall time t _ { \mathrm { TI } } / t _ { \mathrm { ff } } falls below 5–10 . This criterion corresponds to an upper limit on the density of the ICM and motivates a model in which a density core forms wherever t _ { \mathrm { TI } } / t _ { \mathrm { ff } } ~ { } \mathrel { \hbox { \hbox to 0.0 pt { \hbox { \lower 4 % .0 pt \hbox { $ \sim$ } } } \hbox { $ < $ } } } ~ { } 10 . Consistent with observations and numerical simulations , this model predicts larger and more tenuous cores for lower-mass halos—while the core density in a cluster may be as large as \sim 0.1 cm -3 , the core density in the Galactic halo should not exceed \sim 10 ^ { -4 } cm -3 . We can also explain the large densities in smaller mass halos ( galactic ‘ coronae ’ ) if we include the contribution of the central galaxy to the gravitational potential . Our models produce a favorable match to the observational X-ray luminosity-temperature ( L _ { \mathrm { X } } - T _ { \mathrm { X } } ) relation . For halo masses \mathrel { \hbox { \hbox to 0.0 pt { \hbox { \lower 4.0 pt \hbox { $ \sim$ } } } \hbox { $ < $ } } } 10 ^ % { 13 } M _ { \odot } the core size approaches the virial radius . Thus , most of the baryons in such halos can not be in the hot ICM , but either in the form of stars or in the form of hot gas beyond the virial radius . Because of the smaller mass in the ICM and much larger mass available for star formation , the majority of the baryons in low mass halos ( \mathrel { \hbox { \hbox to 0.0 pt { \hbox { \lower 4.0 pt \hbox { $ \sim$ } } } \hbox { $ < $ } } } 10 ^ % { 13 } M _ { \odot } ) can be expelled beyond the virial radius due to supernova feedback . This can account for the baryons ‘ missing ’ from low mass halos , such as the Galactic halo .