  We study the topological zero mode sector of type II strings on a K\"ahler
manifold $X$ in the presence of boundaries. We construct two finite bases, in a
sense bosonic and fermionic, that generate the topological sector of the
Hilbert space with boundaries. The fermionic basis localizes on compact
submanifolds in $X$. A variation of the FI terms interpolates between the
description of these ground states in terms of the ring of chiral fields at the
boundary at small volume and helices of exceptional sheaves at large volume,
respectively. The identification of the bosonic/fermionic basis with the dual
bases for the non-compact/compact K-theory group on $X$ gives a natural
explanation of the McKay correspondence in terms of a linear sigma model and
suggests a simple generalization of McKay to singular resolutions. The
construction provides also a very effective way to describe D-brane states on
generic, compact Calabi--Yau manifolds and allows to recover detailed
information on the moduli space, such as monodromies and analytic continuation
matrices, from the group theoretical data of a simple orbifold.
