We analyze a sample of tens of thousands of spectra of halo turnoff stars, obtained with the optical spectrographs of the Sloan Digital Sky Survey (SDSS), to characterize the stellar halo population in situ out to a distance of a few tens of kpc from the Sun. In this paper we describe the derivation of atmospheric parameters. We also derive the overall stellar metallicity distribution based on F-type stars observed as flux calibrators for the Baryonic Oscillations Spectroscopic Survey (BOSS). Our analysis is based on an automated method that determines the set of parameters of a model atmosphere that reproduces each observed spectrum best. We used an optimization algorithm and evaluate model fluxes by means of interpolation in a precomputed grid. In our analysis, we account for the spectrographs varying resolution as a function of fiber and wavelength. Our results for early SDSS (pre-BOSS upgrade) data compare well with those from the SEGUE Stellar Parameter Pipeline (SSPP), except for stars with logg (cgs units) lower than 2.5. An analysis of stars in the globular cluster M13 reveals a dependence of the inferred metallicity on surface gravity for stars with logg < 2.5, confirming the systematics identified in the comparison with the SSPP. We find that our metallicity estimates are significantly more precise than the SSPP results. We obtain a halo metallicity distribution that is narrower and more asymmetric than in previous studies. The lowest gravity stars in our sample, at tens of kpc from the Sun, indicate a shift of the metallicity distribution to lower abundances, consistent with what is expected from a dual halo system in the Milky Way.