Hey,
as a university lecturer for Japanese studies, I just wanted to add some details on the hatamoto.
You were all completely right in stating that they were flag bearers and in most cases very important persons to a daimyo or shogun.
They acted mostly as advisers or very trustfull guards, which received substantially less koku (the old currency based on rice) and land compared to equal influential persons.
In medieval times, a term was used for the the most influential person in the society, called the "80.000 hatamoto", which combined low-ranking gokenin and hatamoto. In the Edo period, the hatamoto became part of the vast bakufu (the government and beaucracy of the shougante) apparatus. Due to their special position, they were not required to conduct sankin koutai, which required daimyo and others to come to Edo very often (and leaving there family members as hostages).
With bakumatsu (the end of the shogunate), the hatamoto lost their influence and their privileges.
edit: Okay, pointing to Google is also helpful.....;)