Quantum Oscillations In Two Dimensional Dirac And Weyl Semimetals