Photo courtesy DaimlerChrysler Atego six-cylinder diesel engine
One big difference between a diesel engine and a gas engine is in the injection process. Most car engines use port injection or a carburetor. A port injection system injects fuel just prior to the intake stroke (outside the cylinder). A carburetor mixes air and fuel long before the air enters the cylinder. In a car engine, therefore, all of the fuel is loaded into the cylinder during the intake stroke and then compressed. The compression of the fuel/air mixture limits the compression ratio of the engine -- if it compresses the air too much, the fuel/air mixture spontaneously ignites and causes knocking. Because it causes excessive heat, knocking can damage the engine.
Diesel engines use direct fuel injection -- the diesel fuel is injected directly into the cylinder.
The injector on a diesel engine is its most complex component and has been the subject of a great deal of experimentation -- in any particular engine, it may be located in a variety of places.