Characteristic cohomology of differential systems