This is one monster project that I spent sooo many hours on and its finally working. I just had to change the startup resistor value from 1M to 100K to make it work. So here it is, a discrete flyback SMPS. Big circuit, hard to explain so here is the working in brief: this circuit consists of a relaxation Oscillator, whose signal is fed to a gate driver. There is a latch at the input of the driver that is triggered if either the switch current limiting is reached or the output voltage limit is reached. The circuit is initially powered through the now 100k startup resistor, after which the auxiliary winding is used for powering the control circuit. The output is just a single diode rectifier and capacitor.