Results of the theoretical analysis of the diode oscillator with a field-emission cathode placed in a photonic crystal resonator are considered. The analysis of conditions of self-excitation in the small signal approximation is carried out. The nonstationary numerical model of the oscillator based on the nonstationary equation of excitation of the resonator and the particle-in-cell method is developed. Numerical simulation of the processes of oscillation build-up is performed. The simulation shows rather high output power and efficiency for reasonable values of cathode current density.