Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi! I need code for this function please C Programming, with explain bestes!. Function Allocate memory for TCB Set deadline in TCB Set the TCB's
Hi!
I need code for this function please C Programming, with explain
bestes!.
Function Allocate memory for TCB Set deadline in TCB Set the TCB's PC to point to the task body Set TCB's SP to point to the stack segment IF start-up mode THEIN exception create task(void(*task body)0, uint deadline) This function creates a task. If the call is made in start- up mode, i.e. the kernel is not running, only the necessary data structures will be created. However, if the call is made in running mode, it will lead to a rescheduling and possibly a context switch Argument "task_body: A pointer to the C function holding the code of the task deadline: The kernel will try to schedule the task so it will meet this deadline Return parameter Insert new task in Readylist Return status ELSE Disable interrupts Save context IF "first execution" THEN Set: "not first execution any more" Insert new task in Readylist Load conte)xt Description of the function's status, i.e. FAIL/OK ENDIF ENDIF Return status
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started