sevuq tegin , a turk from issyk kul , captured as a child in a tribal war and sold in the slave markets , climbed to a governorship , out of which his son mahmud of ghazna built a vast kingdom across outer persia and north india with his mamluke army and his war elephants .