Formation of the regular satellite systems and rings of the major planets