Thanks, it makes much more sense how a system call cannot occur at the end of its time quantum. However, I still have some concerns about the timing of a system call. For example, with a TQ of 2usecs and the following command file:
shell
1usec exit
I thought that the context change from ready-> running would be completed at beginning of the 5th usec (0 - 5.0), not the end. So the process is on the CPU at the beginning of the 5th usec (i.e. 5.0 - 6.0) and at the beginning of the 6th usec, exit should be called as 1usec has passed since the process has been on the CPU.
Same with the example screenshot I provided. I assumed that 20-21 is the first usec of the context change, and 24-25 is the 5th usec of the context change, so at the beginning of the 25th usec, the process is already on the CPU. Please correct me if my understanding is wrong.