 Due to a decline in the written form in administration and government, Louis' reign predates Ottonian times.His early years were partly spent at the court of his grandfather, Charlemagne, whose special affection he is said to have won.When the emperor Louis the Pious divided his dominions between his sons in 817, Louis was made the ruler of Duchy of Bavaria, following the practice of emperor Charlemagne of bestowing a local kingdom to a close family member who then would serve as his lieutenant and local governor.