if you just want to change the CPU frequency at run-time you can do so with no major impact to the OS.
You must just ensure the system tick interrupt still occurs at the same period by e.g. adjusting the timer clock settings or timer reload/compare value.