  We consider the cosmological evolution induced by the free energy F of a gas
of maximally supersymmetric heterotic strings at finite temperature and weak
coupling in dimension D>=4. We show that F, which plays the role of an
effective potential, has minima associated to enhanced gauge symmetries, where
all internal moduli can be attracted and dynamically stabilized. Using the fact
that the heterotic/type I S-duality remains valid at finite temperature and can
be applied at each instant of a quasi-static evolution, we find in the dual
type I cosmology that all internal NS-NS and RR moduli in the closed string
sector and the Wilson lines in the open string sector can be stabilized. For
the special case of D=6, the internal volume modulus remains a flat direction,
while the dilaton is stabilized. An essential role is played by light D-string
modes wrapping the internal manifold and whose contribution to the free energy
cannot be omitted, even when the type I string is at weak coupling. As a
result, the order of magnitude of the internal radii expectation values on the
type I side is (lambda_I alpha')^{1/2}, where lambda_I is the ten-dimensional
string coupling. The non-perturbative corrections to the type I free energy can
alternatively be described as effects of "thermal E1-instantons", whose
worldsheets wrap the compact Euclidean time cycle.
