<P> 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 behaviors 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, written in the 1130s . </P> <P> 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". </P>

Where did the idea of chivalry come from