  We present first results concerning the metallicities and stellar populations
of galaxies formed in a cosmologically motivated simulation. The calculations
include dark matter, gas dynamics, radiation processes, star formation,
supernovae feedback, and metal enrichment. A rotating, overdense sphere with a
mass of $8\,10^{11}\,$\Msol\ serves as initial model. Converging and Jeans
unstable regions are allowed to form stars, which get their metallicity from
the gas they are formed from. Via supernovae, metal enriched gas is given back
to the interstellar medium. The forming galaxy shows the main properties of
spiral galaxies: A metal rich bulge, a metal poor stellar halo and a disk of
nearly solar composition. Halo and bulge consist predominantly of old stars
($>10.5\,$Gyrs). The disk has a metallicity gradient of $\dd(\log Z) / \dd r =
- 0.05\,$kpc$^{-1}$, whereas the halo shows none. The models also exhibit a
correlation between the metallicity of Pop~II stars and the power of small
scale fluctuations. The stars of the bulge form from gas which is initially
located in the largest maxima of the primordial density fluctuations, whereas
the halo stars originate from gas accumulated in less pronounced maxima.
