CPU

CPU #

How does the OS send instructions to CPU?
How does the OS take control of the CPU?
Does CPU have it’s own OS internally?
Does CPU recognize OS process or thread?

Does CPU recognize OS process or thread? #

Software process and threads are abstractions introduced by the OS. CPU may or may not recognize processes and software threads. For example, Arm provides registers to store processor and thread IDs for OS management purpose. In contrast, CPUs can have hardware threads (e.g., hart in CPUs based on RISC-V). Hardware threads can be thought of as logical CPU cores. The question is, how does OS implement and manage processes and software threads if CPU does not recognize these abstractions?

Sources: RISC-V, Reddit(1), Reddit(2)