  D-branes can end on orbifold planes if the action of the orbifold group
includes (-1)^{F_L}. We consider configurations of D-branes ending on such
orbifolds and study the low-energy theory on their worldvolume. We apply our
results to gauge theories with eight supercharges in three and four dimensions.
We explain how mirror symmetry for N=4 d=3 gauge theories with gauge group
Sp(k) and matter in the antisymmetric tensor and fundamental representations
follows from S-duality of IIB string theory. We argue that some of these
theories have hidden Fayet-Iliopoulos deformations, not visible classically. We
also study a class of finite N=2 d=4 theories (so-called D_n quiver theories)
and find their exact solution. The integrable model corresponding to the exact
solution is a Hitchin system on an orbifold Riemann surface. We also give a
simple derivation of the S-duality group of these theories based on their
relationship to SO(2n) instantons on R^2\times T^2.
