When the system is running, all the tasks except the one running are in a wait state, which means that the full stack frame is saved at the bottom of the stack, and the stack pointer is stored in the control block to be used by the scheduler to resume each process.
A newly created task will wake up for the first time in the middle of the context switch. At that point, the task is expected to have preserved the previous state of its CPU registers, but obviously a new task does not have such a thing. Upon stack creation, a forged stack frame is pushed to the end of the stack, so that when the task resumes, the values stored are copied into the system registers, and the task can resume from its entry point.
The task_create function ...