For embedded real-time systems that run on energy drawn from storage units (e.g. batteries) and furthermore the energy stored in those units is harvested from ambiance (e.g. the sun) there is a major issue of energy availability for the processing unit to comply with all requirements. The problem, as one might imagine, is the instability of energy sources. The ideal situation is that whenever the operating system is active then it possesses enough energy to comply with all requirements. In this work an idea to achieve that goal is illustrated and furthermore it is implemented and tested for one specific real-time operating system (Xenomai-2.6.3) that runs under Linux-3.5.7. In this system the idea is to modify the scheduler of the real-time operating system in such a way to make it encounter for the energy level available. So continuously the Xenomai's scheduler examines the energy level and as long as it is above certain threshold it continues normally (i.e. invoking the highestpriority task to be executed) and when the level drops below the threshold the scheduler suspends real-time tasks and switches to idle status, till energy level is restored.