  We combine a semi-analytic galaxy formation model (Nulsen and Fabian 1997)
with a prescription for the obscured growth of massive black holes (Nulsen and
Fabian 2000; Fabian 1999), to reproduce the hard X-ray background (XRB), the
local 2-10keV AGN luminosity function and the source counts, including recent
Chandra results. The model also complies with constraints on the AGN
contribution to the far-infrared and sub-mm backgrounds.
  The co-moving density of luminous AGN [L(2-10keV)>1E44 erg/s, in the
unabsorbed rest- frame] in the model declines sharply since z=2, mimicking the
observed evolution of the quasar population. The abundance of lower luminosity
AGN simultaneously increases, and we identify such objects with the Seyfert
galaxies. These features reflect an epoch-dependent rate of Bondi accretion
from the hot, cooling atmosphere: at z<2.5 most AGN are fed at much less than
10 per cent of the Eddington rate, whilst at z>2.5 most accrete at 10-50 per
cent Eddington. Unlike other models for quasar and galaxy formation, we do not
consider major mergers between normal galaxies.
  The model produces an excess soft XRB below 4keV which can be removed by
modifying the wind expulsion model of Fabian (1999) to incorporate anisotropic
ejection.
