The variances in spelling of the surname is no sign that they were illiterate. Especially in the English-speaking world, there was a general lack of consistency in the spelling of names (both personal and place names) even among the educated and even during the 19th century. I have (from the National Archives of Scotland) extracts of documents for a landed Ayrshire family in which the surname was written different ways even for the same individual. Also, you can look at Scottish maps drawn by various 16th-19th century cartographers and often see different spellings for the same place.
In case you eventually get back another couple of generations, I have two 17th-18th century generations of Fergusons in Craig and Millanerdaill [Millenderdale], Ayrshire:
First, an Ayrshire sasine [deed] was registered on 1 May 1648 for John Fergussoune/Fergusson of Craig, Ayrshire and his spouse, Janet Lin/Lyne, daughter of Fergus Lin/Lyne of Larg, Wigtownshire. John died 1 October 1667 aged 55; Janet, on 1 October 1689. They left at least two sons:
(1) James Ferguson of Craig held lands of Myllanderdill [Millenderdale] in 1698 (presumably since his father's passing in 1667). James married Marion Gemmel and died 1 September 1701 aged 49.
(2) Robert Fergusson survived his older brother by at least 13 years, but I'm sorry to say I do not know who, if anyone, he married. In 1714, he was described in a discharge as "Robert Fergusson, brother of deceased James Fergusson of Craig”.