davedoors wrote on Monday, October 13, 2014:
Look in portable.h, the functions that are defined in there need to be implemented in port. There are lots of port.c files you can use as examples.
The first thing you will need to do is work out what makes up the architecture context. List out the registers, and decide how they will be placed on the stack. The architecture will dictate some of that if some registers are pushed on to the stack manually.
Once you have a function that creates the starting stack for a task, create a function that starts the first task. Again there are lots of examples, and how it can be done is dictated by the architecture. Sometimes a simple function call is all that is needed, but sometimes a software trap is needed. The function moves the stack pointer to the start of the stack created for the task, then pops the registers off the stack into the architecture registers until finally it pops the program counter. The program counter will hold the address of the task function, so popping that address into the program counter will result in a jump to the start of the task.
Then you need to work out how you are going to switch between tasks. But one thing at a time.
There are some old pages here http://www.freertos.org/implementation/main.html