Skip to content

OS or CPU, Which is in charge?

Statement

  • The operating system holds the algorithms to develop scheduling between two or more processors that crunch numbers given to them.
  • Which - in your opinion - is actually in charge of the overall machine: the CPU or the operating system?

Answer

References

  • Before taking this course, I was convinced that the processor was in charge, and I thought OS had little responsibility (aka, just like another program but with a friendly UI).
  • However, the deeper we go into the details of operating systems, the more I realize that the OS is the one that is in charge of the machine.
  • CPU is a powerful tool that can do lots of logical or mathematical operations quickly and efficiently. However, it is not intelligent enough to know what to do with the data it receives; it just does what it is told to do (by the program running on it).
  • The OS is the one who chooses which process (program) to use the CPU and when to do so. It also decides when to switch between processes; and how to allocate the resources (memory, disk, network, etc.) to each process.
  • So The OS chooses the process to run, the CPU executes the process code, and thus the OS controls the machine.
  • If we take a closer look at the responsibilities of the OS, we can see how powerful it is:
    • Process management: creating, scheduling, and terminating processes.
    • File management: creating, reading, writing, and deleting files.
    • Network management: connecting to the network, sending and receiving data, and disconnecting from the network.
    • Device management: connecting devices, sending and receiving data, and disconnecting from devices.
    • User management: organizing user access.
    • Security management: protecting the machine from unauthorized access, malware, and other threats.
    • And many more…