I was wondering why there is an extra usec of total time for the system call to happen. At t=10, the process has been on the CPU for 5usecs, so the spawn syscall should happen at t=10. In the sample solution, spawn is called at t=11, where there is a usec that seems to have come out of nowhere. Same thing happens with the context change. This is the output I was expecting:
@00*0*0*0 REBOOTING
@00*0*0*0 spawn 'simples', pid0.NEW->READY
@00*0*0*0 pid0.READY->RUNNING simples(onCPU=0)
@00*0*0*0 clock +5 (1..5)
@00*0*0*1 +
@00*0*0*2 +
@00*0*0*3 +
@00*0*0*4 +
@00*0*0*5 +
@00*0*0*6 c simples(onCPU=1)
@00*0*0*7 c simples(onCPU=2)
@00*0*0*8 c simples(onCPU=3)
@00*0*0*9 c simples(onCPU=4)
@00*0*0*0 c simples(onCPU=5)
@00*0*0*0 spawn 'command2', pid1.NEW->READY, pid0.RUNNING->READY simples(onCPU=5)
@00*0*0*0 clock +10 (11..20)
@00*0*0*1 +
@00*0*0*2 +
@00*0*0*3 +
@00*0*0*4 +
@00*0*0*5 +
@00*0*0*6 +
@00*0*0*7 +
@00*0*0*8 +
@00*0*0*9 +
@00*0*0*0 +
@00*0*0*0 pid1.READY->RUNNING
And the screenshot below is what the sample solution got