Linear Systems over Commutative Rings