Chivalry, or the chivalric code, is an informal, varying code of conduct developed between 1170 and 1220, never decided on or summarized in a single document, associated with the medieval institution of knighthood; knights' and gentlewomen's behaviours were governed by chivalrous social codes. The ideals of chivalry were popularized in medieval literature, especially the Matter of Britain and Matter of France, the former based on Geoffrey of Monmouth's Historia Regum Britanniae which introduced the legend of King Arthur, which was written in the 1130s.
The code of chivalry that developed in medieval Europe had its roots in earlier centuries. It arose in the Holy Roman Empire from the idealisation of the cavalryman—involving military bravery, individual training, and service to others—especially in Francia, among horse soldiers in Charlemagne's cavalry. The term "chivalry" derives from the Old French term chevalerie, which can be translated to "horse soldiery".
Over time, its meaning in Europe has been refined to emphasise more general social and moral virtues. The code of chivalry, as it stood by the Late Middle Ages, was a moral system which combined a warrior ethos, knightly piety, and courtly manners, all conspiring to establish a notion of honour and nobility.
In origin, the term chivalry means "horsemanship", formed in Old French, in the 11th century, from chevalier (horseman, knight), from Medieval Latin caballārius.The French word chevalier originally means "a man of aristocratic standing, and probably of noble ancestry, who is capable, if called upon, of equipping himself with a war horse and the arms of heavy cavalryman and who has been through certain rituals that make him what he is". In English, the term appears from 1292 (note that cavalry is from the Italian form of the same word).