How do most ecosystems get their energy?

from the available food

from the sun through photosynthesis

from the energy the animals absorb

from the plants that grow in that ecosystem