Of the two approaches of density-functional theory molecular dynamics, quantum molecular dynamics is limited at high temperature by computational cost whereas orbital-free molecular dynamics, based on an approximation of the kinetic electronic free energy, can be implemented in this domain. In the case of deuterium, it is shown how orbital-free molecular dynamics can be regarded as the limit of quantum molecular dynamics at high temperature for the calculation of the equation of state. To this end, accurate quantum molecular dynamics calculations are performed up to 20 eV at mass densities as low as 0.5g/cm^{3} and up to 10 eV at mass densities as low as 0.2g/cm^{3}. As a result, the limitation in temperature so far attributed to quantum molecular dynamics is overcome and an approach combining quantum and orbital-free molecular dynamics is used to construct an equation of state of deuterium. The thermodynamic domain addressed is that of the fluid phase above 1 eV and 0.2g/cm^{3}. Both pressure and internal energy are calculated as functions of temperature and mass density, and various exchange-correlation contributions are compared. The generalized gradient approximation of the exchange-correlation functional, corrected to approximately include the influence of temperature, is retained and the results obtained are compared to other approaches and to experimental shock data; in parts of the thermodynamic domain addressed, these results significantly differ from those obtained in other first-principles investigations which themselves disagree. The equations of state of hydrogen and tritium above 1 eV and above, respectively, 0.1g/cm^{3} and 0.3g/cm^{3}, can be simply obtained by mass density scaling from the results found for deuterium. This ab initio approach allows one to consistently cover a very large domain of temperature on the domain of mass density outlined above.