You are on page 1of 2

QUESTION 1

Meets Expectation

Feedback: You've done a good job explaining the concept of changing the PC to hold the
function pointer and how it leads to the execution of that function. You also correctly noted
the effect of the function being an infinite loop. To improve, you could add more detail about
why the PC holding the function pointer acts like a function call, and what the PC (Program
Counter) is in the context of the Cortex M4 microcontroller. This will help to deepen your
understanding and explanation of the topic.

QUESTION 2

Does not Meet Expectation

Feedback: You've made a good start by identifying that a system call involves a request for a
service from the operating system. However, your explanation could be more precise and
detailed. Remember, a system call is not just any method, but a specific type of function call.
Also, it's not the PC (personal computer) that makes the request, but the user code or
programs running on the computer. Try to elaborate on how system calls allow user code to
interact with the kernel and why this is important for hardware access protection.

QUESTION 3

Meets Expectation

Feedback: Excellent job! You correctly identified that setting up a thread's stack involves
allocating memory for the stack and initializing the stack pointer. You also correctly
explained why we need to store register values on the stack, mentioning that it ensures the
processor is in the correct state when the thread is started and that it allows the thread to
resume execution from where it left off. You also mentioned the importance of storing
register values on the thread's stack to prevent them from being overwritten by other
threads, which is a crucial point. Keep up the good work!

QUESTION 4

Meets Expectation

Feedback: You've done a good job explaining the importance of setting the PSP before
running the thread and the consequences of not doing so. However, you could improve your
answer by specifically mentioning that the thread's stack is not at the same location as the
CPU's stack pointer. Also, it would be beneficial to mention that we are using PSP for
threads, so we need to switch to PSP and make sure that PSP's value equals the thread's
stack pointer address. This would make your explanation more complete and accurate.
Keep up the good work!

QUESTION 5

Does not meet expectation.

Feedback: Your response is partially correct in that the function would reach an end
without the while loop, but it does not fully answer the question. The question is asking
about what would happen if the thread function returned, not about the persistence of the
output. You need to consider what happens when a thread function returns, specifically in
relation to the return address and the thread's stack. Think about where the return address
is stored and what would happen if the thread function attempted to return. Would the
correct return address be loaded? What would be the consequence if it wasn't?

You might also like