Optical square wave sources are particularly important for applications in high speed signal processing and optical communications. In most realizations, optical square waves are generated by electro-optic modulation, dispersion engineering of mode-locked lasers, polarization switching, or by exploiting optical bi-stability and/or optical delayed feedback in semiconductor diode lasers, as well as vertical-cavity surface-emitting lasers (VCSELs). All such configurations are bulky and cause significant timing jitters. Here we demonstrate the direct generation of optical square waves from a polarization-maintaining figure-eight nonlinear amplifying loop mirror (NALM) configuration that uses an embedded high index glass micro-cavity as the nonlinear element. Such a NALM mimics the behavior of a saturable absorber and has been used to reach passive mode-locking of pico- and even nano-second pulses. In our method, the NALM, including a high-Q micro-ring resonator, acts as an ultra-narrowband spectral filter and at the same time provides a large nonlinear phase-shift. Previously we have demonstrated that such a configuration enables sufficient nonlinear phase-shifts for low-power narrow-bandwidth (~100 MHz FWHM) passive mode-locked laser operation. Here we demonstrate the switching of stable optical square wave pulses from conventional mode-locked pulses by adjusting the cavity properties. In addition, the square wave signal characteristics, such as repetition rate and pulse duration, can be also modified in a similar fashion. The source typically produces nanosecond optical square wave pulses with a repetition rate of ~ 120 MHz at 1550nm. In order to verify the reach of our approach, we compare our experimental results with numerical simulations using a delay differential equation model tailored for a figure-eight laser.