Descartes doesn't actually reason that nothing is knowable. In Meditation I he merely practises what is generally called methodological doubt. In constructing the foundations of knowledge he will not accept any belief if beliefs of that kind could be false. So he will not accept sense-based beliefs because the senses can deceive us. He will not believe that he is awake since when he is asleep he sometimes thinks he is awake, and when he is awake he thinks he is awake: so how does he know which state, awake or asleep, he is in? As for what he believes to be the truths of mathematics, how can he tell whether he knows these are truths or it isand not merely matters which he psychologically impossible for him not to believe themcannot doubt, courtesy of the deceptions of the evil demon?
In spite of his language, Descartes does not in fact take the cogito as infallible knowledge even though he is certain of its truth as he is relatedly of the nature of the 'I' which exists - that it (he) is essentially a thing that thinks. He takeshas been certain before - and wrong before. A deceiving God could have made him falsely certain - there is this bare, metaphysical posibility (Med III: tenuis et, ut ita loquar, Metaphysica dubitandi ratio est). So he sets out to discover whether there is or could be a deceiving God. 'For if I do not know this, it seems I can never be [justifiably] quite certain about anything else.'
He takes the cogito to be a clear and distinct idea, and he reasonslays down a principle, a general rule (regula generali), in Meditation III that he can rely on any other ideas which are as clear and distinct as the cogito. 'I now seem to be able to lay it down as a general rule that whatever I perceive ... clearly and distinctly is true'. On this basis he 'proves' by supposedlywhat are evidently taken to be clear and distinct ideas the existence of a God who is no deceiver (Ex quibus satis patet illum fallacem esse non posse) - and God would be a deceiver if he did not guarantee the truth of clear and distinct ideas. The whole process is circular and is well-known as the 'Cartesian circle'. He uses clear and distinct ideas to prove the reliability of clear and distinct ideas.
But it isSo to be noted as a smallunderscore the point in: Descartes favour that he does not 'exempt' the cogito, since the truth of the cogito has to be vindicated by demonstrating the existence of a non-deceiving God who underwrites the reliability of our clear and distinct ideas, of which the cogito is one (he thinks). That the whole process is circular, as described, is another matter. Since Descartes' general rule, 'that whatever I perceive ... clearly and distinctly is true', is also justified only by reference to God (Discourse, Part IV: it is a rule the truth of which is 'assured only for the reasons that God is or exists'), the circularity is reinforced.
References
Descartes, Meditations on First Philosophy, tr. J. Cottingham, Cambridge: CUP, 1996: 12-23 & 102-6.
Descartes, Discourse on the Method, tr. J. Cottingham et al., The Philosophical ritings of Descartes, I, Cambridge: CUP, 1985: 130.
Bernard Williams, Descartes: the Project of Pure Enquiry, London: Routledge, 2008: 93, 175-189.