What are Operating Systems(OS)?
Whenever a user starts up his phone, laptop, or even his smart-fridge. The user notices that it takes a while for the info to appear on the screen. What's happening is, your device is starting software in the background.
This software will help you control your device and provide you with ways to manipulate data and run other apps on top of it.
This software will be running as long as your device is turned on and only shuts down when you turn off your device.
In short, an operating system is a program that manages the computer hardware and other software applications.
The OS is the most important tool we use to interact with the computer. Humans can not communicate directly with the CPU so the OS allows us to do that by translating machine language into the UI we can get familiar with.
That’s basically what an operating system is. Let's dive deeper.
The kernel is a central component of the OS, responsible for communication between software and hardware.
It’s main responsibilities include:
- Process Management
- Device Management
- Memory Management
- Interrupt Handling
- I/O File Communication
- File Systems
There are two types of the kernel and they are called monolithic and micro-kernels.
Windows uses the hybrid kernel which is a mono-micro combination whilst Linux uses a monolithic kernel.
Processes, Threads, and Concurrency
Treads work like a line of code that runs through the code and data structure of the program. This would be called the thread of execution. We have one thread of code that's coursing through the program.
To explain this in simple terms, it’s like if I were to draw a picture with only one color, that would be like a single thread. Now if my sister would come along with a pen of another color and start drawing on my paper, another thread would appear.
This could also happen in a computer program. Another thread could run through the code and data structure of the program. They are also known as the thread of control.
But what if I’m currently drawing a tree and my sister wants to draw it instead? We would have conflict. In the same way, the threads could go through the same. The threads that are executing the same program may want to read or update the same data structure.
A process would be the combination multible threads running through the same script and executing the program.