Compare the way you both perceive your role
As part of the process of understanding your boss, compare the perceptions you both have of your role and the criteria used to judge your success. You may feel that you're performing well, but if you're putting your energy into tasks that your boss does not feel are relevant, you will be seen as performing poorly.
Take the initiative to explore your boss's expectations and agree on your objectives. This will clarify your role and give you a better idea of how to progress in the organisation.
Having scrutinised your boss and developed a greater understanding of him or her, you should try doing the same kind of exercise on yourself. Sometimes a lack of self-knowledge leads to us being surprised by our reactions and the feedback we get. It's a good idea to ask for input from your friends and colleagues while you're doing this as it's hard to judge how you come across to others.
Ask your colleagues what they observe when you interact with your boss, how you come across to them, and how you could manage your communication differently. Although their perceptions may not represent the absolute truth about you, they nonetheless reflect the image you create.
Think through some of the past encounters you've had with your boss and consider them objectively, perhaps with a friend or colleague who knows you well. Maybe this situation happens over and over again, which suggests that you harbour a value or belief that is being repeatedly compromised. If you can understand what this is, you can learn to manage these tricky situations more effectively.
Consider changing your behaviour. This often prompts a reciprocal behavioural change in your boss. If you don't change anything about the way you interact with your boss, the relationship will remain unaltered, so this is definitely worth a try.
For example, perhaps you value attention to detail, but your boss is a big-picture person. Every time you ask for more detailed information, you'll be drawing attention to one of your boss's vulnerabilities, and he or she is likely to become unco-operative or irritated by your request.
Once you've observed your respective patterns, you can begin to work around them or accommodate them more calmly and objectively.