There's a story in particular that fascinates me. At around Chapter 40, a captain arrives at an inn and describes his time in Algiers, then part of the Ottoman Empire. In his account, the captain talks in great detail of both Turkish and Moorish mannerisms, dress, culture, and even arcitecture. Is this description at all accurate? Did Miguel de Cervantes actually know what he was talking about?
I would love to hear from someone with a greater expertise in Cervantes (I'm afraid I have none) or from someone better read on Maghreb (of which my knowledge is limited) but it's worth noting that Cervantes was in fact captured by Algerian corsairs at one point in his life and spent several years in Algeria. So it seems entirely plausible to me that he was basing his writings off of his first hand observations.
Glancing over some of his observations I can comment on from chapter 40:
"it is the practice with the Turks to name people from some defect or virtue they may possess; the reason being that there are among them only four surnames belonging to families tracing their descent from the Ottoman house, and the others, as I have said, take their names and surnames either from bodily blemishes or moral qualities."
I don't know about the "four surnames" bit, and there are certainly other naming conventions (of which the most common is probably a simple "nisba" surname taken after wherever the person comes from, so "al-Misri" = the Egyptian) but there is a long tradition in Arabic of names being given to people based on their physical features, whether positive or negative. So you have "Abu Nuwas" "The Curled One" for his locks. Several grammarians were called "al-Akfash" "The Weak-eyed One", presumably as a kind of "four eyes" joke. One of the most famous corsairs and a near-contemporary of Cervantes was Hayreddin Barbarosa, obviously a latin "surname" but a reference to his red beard nonetheless. The name Hayreddin itself means "goodness of the religion" (i.e. Islam) and is a common Arabic first name.
without owing his advancement to the base ways and means by which most favourites of the Grand Signor rise to power, he came to be king of Algiers, and afterwards general-on-sea
It's possible that a Cervantes scholar would know more but it strikes me that he could well have based this character on Hayreddin himself, who, along with his brothers, while he was not a galley slave, started off as a simple seaman, became a corsair captain, captured Algiers from the Spanish, become ruler of the wider territory and offered it as a state to the Ottomans. "General-on-sea" is a direct translation of the Arabic "Amir al-Bahr" which is itself the derivation for the English word "Admiral."
He was a Calabrian by birth
It was pretty common for Corsairs to come from Christendom, particularly from ocean-going Mediterranean states.
Every day he hanged a man, impaled one, cut off the ears of another; and all with so little provocation, or so entirely without any, that the Turks acknowledged he did it merely for the sake of doing it, and because he was by nature murderously disposed towards the whole human race.
The contrast between the captain's own light treatment and the harsh punishment of others, up to and including impalement, fits with what I've read of the corsairs treatment of their prisoners. I'm not familiar with such punishments being entirely wanton, but it's hardly an impossibility.
Source wise:
I've been reading a couple books that touch on prisoner accounts of the Barbary Corsairs, although from the 18th century, not the 16th, namely Faith, Power, Fantasy by Michael Oren and Max Boot's Savage Wars of Peace. The career of Hayreddin Barbarosa (or, in his transliteration, Khayr al-Din Barbarossa) is briefly touched on in Eugene Rogan's The Arabs: A History.
edit: on Arabic naming, specifically for pejorative names based on physical features, see the Encyclopaedia of Islam entries on "Kunya" and "Lakab".