In this paper we investigate the overcooling problem and propose some possible solutions . We show that the overcooling problem is generic to the hierarchical picture of structure formation , as long as the cooling is actually possible in small halos at high redshift . Solutions to this problem are likely to be associated with some feedback mechanism , and probably imply the existence of a warm IGM containing most of the cosmological baryons . We concentrate on some possible solutions , mainly photoionization and bulk-heating of the IGM . We show photoionization can act as a significant feedback mechanism but is not strong enough to solve the entire overcooling problem . We therefore assume that the IGM is maintained hot by some energy injection provided by supernova and galaxy formation is then limited by this feedback mechanism . Such a self regulated scheme allows us to compute the thermal history of the IGM . In the absence of any photo-ionization , we find the existence of bifurcations in the thermal history . However , these bifurcations are suppressed when significant photo-ionization occur in addition to the energy injection . The temperature of the IGM is then maintained at T \sim few 10 ^ { 5 } K. We find that for realistic fraction of the energy produced by supernovae being re-injected into the IGM , this scenario can consistently reproduce the present amount of stars . A \Gamma - CDM model with \Gamma \sim 0.25 can reproduce properly the observed HI gas at high redshift . A simple prescription for star formation also allows to reproduce the star formation rate at high redshift as inferred from recent data , while the entropy of the IGM at z \sim 2 - 5 is of the order of what seems necessary to explain the observed properties of X-ray clusters . We conclude that the warm self-regulated IGM picture provides an interesting alternative to standard semi-analytical approach , which may elucidate the behavior of baryons in structures from small galaxies to clusters .