  We combine two first-principles computer simulation techniques, path integral
Monte-Carlo and density functional theory molecular dynamics, to determine the
equation of state of magnesium oxide in the regime of warm dense matter, with
densities ranging from 0.35 to 71~g$\,$cm$^{-3}$ and temperatures from 10,000 K
to $5\times10^8$~K. These conditions are relevant for the interiors of giant
planets and stars as well as for shock wave compression measurements and
inertial confinement fusion experiments. We study the electronic structure of
MgO and the ionization mechanisms as a function of density and temperature. We
show that the L-shell orbitals of magnesium and oxygen hybridize at high
density. This results into a gradual ionization of the L-shell with increasing
density and temperature. In this regard, MgO behaves differently from pure
oxygen, which is reflected in the shape of the MgO principal shock Hugoniot
curve. The curve of oxygen shows two compression maxima, while that of MgO
shows only one. We predict a maximum compression ratio of 4.66 to occur for a
temperature of 6.73 $\times 10^7$ K. Finally we study how multiple shocks and
ramp waves can be used to cover a large range of densities and temperatures.
