It has to stop processes some times to switch between other ones and it also has to monitor operations like memory access. So does OS just check and run instructions one by one?
Ps. I have just started learning assembly language and computer architecture 🙂
A lot of hardware provides for timed interrupts which will fire every so often somewhat independent of software. Raised interrupts correspond to memory locations which contain procedures that will be executed when that interrupt is raised, in this case the procedures perform what is known as context switching and process scheduling. Most of the hardware information such as the program counter and various register contents will are stored in each process’s information structure. The contents of the machine’s registers (that the program was using) are restored before the program begins executing again. Picking up a book on Operating system design will go into much more detail on how all of this is accomplished.