Evolution of 8-10 solar mass stars toward electron capture supernovae. I - Formation of electron-degenerate O + NE + MG cores.