Some physical/chemical facts for the beginning.
(1) Motor fuels are hydrocarbons, mainly composed, as said, from carbon and hydrogen.
(2) Diesel fuel has notably higher carbon to hydrogen ratio than petrol.
(3) Carbon rich fuels need more mass ratio of air to burn completely, to clear carbon dioxide and water, as carbon takes two oxygen atoms for on carbon atom, and hydrogen takes one oxygen atom per two hydrogen ones.
(4) Diesel fuel has notably higher boiling temperature range than petrol.
That said. As carbon rich fuels have more carbon and need more oxygen to burn, they tend to start to soot easily when burned incompletely without all the oxygen needed. Then, when engine is first started, it sure runs at sub-optimal cycles. For low RPM, compression will be poor and air dose will be lower than usual. Also, engine does not start immediately and fuel doses injected on previous cycles will partially stay in the cylinders making excess fuel. As diesel has high boiling point, extra fuel will stay for long on the cylinder walls. All that makes for low oxygen and too many fuel, making the engine to soot for some time. Also, when engine is stopped, some oil enters the cylinders, acting then as a fuel and taking some oxygen to itself. Even heavily worn petrol engines can soot because of this.