jserv / mini-arm-os

Build a minimal multi-tasking OS kernel for ARM from scratch
Other
1.04k stars 242 forks source link

Fixed mode switch and stack size problem #18

Closed lecopzer closed 6 years ago

lecopzer commented 6 years ago
  1. Accroding to b4c7473, it's able to use exception return to do mode switch the first time a task was activated.

  2. In the comment - "End of stack, minus what we are about to push", The number 32 is not equal to 'what we are about to push'. Actually, the correct number is 9 for pop psp register and 8 for exception return.

    If you want to keep value 32 to remain some safe space at the end of stack, the comment may be not appropriate.