Hi,
Seems to me like SW issue.
What does "crashed"means? you end up in some exception?
You cannot just add something to operating system without any knowledge on the SW and HW.
How do you handle interrupts?
Do your OS has permissions to write to ADC registers? There can be a lot of choke points...
I suggest you to first make OS run and make sure it runs well.
Then starting add some simple tasks which for example enable ADC, do conversion and serve interrupt.
Once this works, you will have a good idea on how to proceed.
regards,
Peter