Let $f: X \rightarrow Y$ be a finite, flat morphism of curves of degree $n$. The direct image of the structure sheaf $f_* O_X$ is a locally free $O_Y$-module.
Given a local section $s$ of $f_* O_X$ on a trivializing subset, this induces by multiplication an automorphism of $f_* O_X$ which is represented by a $n \times n$ matrix with entries in $O_Y$. This operation gives locally a morphism $f_* O_X \rightarrow Mat(n, O_Y)$ whose image is a commutative subalgebra of $Mat(n, O_Y)$.
How does this algebra looks like? Is it possible that it is made of diagonalizable matrices?