Last day I wrote about Operating System Services and for today I will be focusing on learning about Operating System Structures. A modern OS is a very complex software written with million lines of code and consisting of hundreds of files and all these need to be following some structre for programmers to easily understand and maintain the code.
There are many kinds of sturctures an OS follows but some of them are explained here.
Monolithic Operating Systems
An operating system with a Monolithic Structure can be said be an OS with a single binary file that runs when a comupter boots into the system. It is a simple structure because it consits of no structure at all. Everything that an opearating system handles is bound into a single file. It is also called a tightly-coupled system.
It is a common technique to design operating systems. The original UNIX OS followed this structure and Linux at the core also follows the structure as Linux is based on UNIX operating system. An OS with monolithic structure runs entirely in kernal mode.
Monolithic systems are difficult to implement, extend and maintain. But these kind of OS are great in performance and speed and that is why this structure is still used in the development of popular OS like Linux and Windows.
Layered Operating Systems
A Layered Structure OS also called a loosely-coupled system is a OS Structure where every service and function is divided into its own parts and componenets. All these components together make up the kernal.
While change to monolithic system will cause the whole system to have some effect, In layered system change to one layer or service will only affect that service not the whole system. This way it is more easy to maintain and easily testable for programmers and a lot easier to implement.
A layered system is easily debugged and tested as every layer uses the function defined by the layer below it and so on to the hardware. So we debug first layer and after that the second layer and if some bug is found in it, it can be debugged and tested separately from the other layers. That way it is easy to work with for programmers.
Microkernel Operating Systems
Microkernels OS are designed in a way that all non essential components of a kernel are extracted and are implemented on the user level thus making the kernel a small piece of software fully capable of managing hardware resources. This kind of system was first developed at Carnegie Mellon University and was named Mach.
Another common example of this type of OS is Minix OS which was a UNIX like OS that was built and taught step by step to students learning about OS in a book called Operating Systems: Design and Implementation (1987). Minix 3 is said to have only been coded in about 12,000 lines of code.
The kernel for MacOS and iOS called Darwin is also a type of microkernel.
Modules OS
In Module structure the OS is divided into smaller components that are linked through modules at boot time or during run time. It is most used structure for OS desing today as all the modern OS are designed in this way. The kernel only provides core serviecs at boot time while the other services are loaded when they are needed. For example we can build the memory algorithms directly into the kernel but later will provide the loadable modules to handle the filesystem through the kernel.
Windows, UNIX, Linux and MacOS are all most common examples of this kind of system.