title: build real time operating system on microcontroller
body: <p>Now I try to write RTOS by my self.
  I have a question: in RTOS concept, we have "context switch" theory. 
  From what I know, context switch is to describe that when some task is running and the other task has a higher priority, the higher priority task will run and the current task will be saved its state and continue to start after the higher task finish. To do this concept, I think the higher priority task will run in the interrupt functions since the interrupt functions have higher priority than other instruction, am I right?. If i am right, so i do not need to write code to save the current task's state, since as i know that after interrupt, the program will return to where it is interrupted. If I am wrong, how can I save the current task 's state? Is it necessary to write assembly code to do that since I see halogen generate an assembly code file to do this for FreeRTOS?</p>