So, what will I do with the system or what will I put in the system if there is no OS?
Since I don’t have an OS I will write a stand alone program or I can say there will be one application that will be programmed into the system (flash into the static memory of the system like Flash memory or SRAM or EEPROM etc.).
Many simple computer systems run only one program, and have no OS at all. For example, computers in microwave ovens, clock radios, VCRs, and other similar devices often don’t have an OS.
So why would you want an OS? Well, computers without an OS tend to have a few things in common: they run only one program, which will only run on a specific hardware design.
This stand-alone application must initialize hardware components (Display, Sound hardware, UART, Timer etc. Each of them is a hardware component) in the system. Since I only have one application running, I can only have one execution point at a time. So, in my application I can only handle only one piece of hardware at a time. In order to use another hardware component I must first complete the task with the current hardware component.
nothing wrong with that. The only problem is that I can’t use my system fully. I can only use one hardware component at a time even though I have multiple hardware components in the system
Then someone thought that the system could be used in a much better way and brought the concept of OS (perhaps? DOS). Initially the OS was still capable of executing one application and one user on an instance.
Gradually, the OS infrastructure has developed into a large software system that has the ability to run multiple applications, multiple users while still being able to handle multiple hardware components at the same time and giving the illusion that all hardware components of the system can be used at the same time.
An OS provides several services for applications, such as: efficient allocation of CPU time for different applications (CPU scheduling), process management, memory management, synchronization between different applications (so that no two applications in the system will fight for the same resources). same), etc., to run multiple applications and multiple users on a system.
So, in simple words: OS is a software component that helps utilize hardware to its full potential while maintaining the illusion that all if hardware can be used at the same time and there are literally unlimited applications that can run.
Imagine if every programmer had to write their own file system. You need a different disk for each program! Even if they agreed on the file system to use, if each had to implement the logic for the system in their own programs, surely some programs would do something different, causing problems. By having the OS manage these things instead, we have greater assurance that data will be written in a consistent way, and that one program will be able to read files generated by another.