  We analysed Rossi X-ray Timing Explorer observations of the accretion-powered
401 Hz pulsar SAX J1808.4-3658, in order to precisely determine the source
distance. While the fluences for the five transient outbursts observed from
1996 were constant to within the uncertainties, the outburst interval varied
signficantly, so that the time-averaged flux (and accretion rate) decreased by
around 40%. By equating the time-averaged X-ray flux with the expected mass
transfer rate from gravitational radiation, we derived a lower limit on the
distance of 3.4 kpc. Combined with an upper limit from assuming that the four
radius-expansion thermonuclear bursts observed during the 2002 October outburst
reached at most the Eddington limit for a pure He atmosphere, we found that the
probable distance range for the source is 3.4-3.6 kpc. The implied inclination,
based on the optical/IR properties of the counterpart, is i<~30 degrees.
  We compared the properties of the bursts with an ignition model. The time
between bursts was long enough for hot CNO burning to significantly deplete the
accreted hydrogen, so that ignition occurred in a pure helium layer underlying
a stable hydrogen burning shell. This is the first time that this burning
regime has been securely observationally identified. The observed energetics of
the bursts give a mean hydrogen fraction at ignition of <X> approx. 0.1, and
require that the accreted hydrogen fraction X_0 and the CNO metallicity Z_CNO
are related by Z_CNO approx. 0.03(X_0/0.7)^2. We show that in this burning
regime, a measurement of the burst recurrence time and energetics allows the
local accretion rate onto the star to be determined independently of the
accreted composition, giving a new method for estimating the source distance
which is in good agreement with our other estimates.
