Unit 1
Introduction
Operating system
- An operating system (os) is system software that manages computer equipment and software resources and gives normal services to computer programs.
- An operating system is software with the accompanying highlights −
- An operating system is a program that goes about as an interface between the software and the computer hardware.
- It is a coordinated set of particular programs used to manage the overall resources and operations of the computer.
- It is specific programming that controls and monitors the execution of every single other program that resides in the computer, including application programs and other system software.
- It tends to be thought of as having three objectives:
- Convenience: an os makes a pc progressively advantageous to utilize.
- Efficiency: an os permits the pc system resources to be utilized proficiently.
- Ability to evolve: an os ought to be built to allow the successful improvement, testing, and presentation of new system capacities without interfering with the administration.
- The application programs utilize the operating system by making requests for services through a characterized application program interface (API).
- Furthermore, users can interact straightforwardly with the operating system through a user interface, for example, a command line or a graphical user interface (GUI).
Fig 1- GUI
Operating system functions
In an operating system software plays out every one of the following function:
- Process management:- process management causes the os to create and delete processes. It likewise gives mechanisms for synchronization and communication among processes.
- Memory management:- memory management module plays out the role of assignment and de-allotment of memory space to programs needing the resources.
- File management:- it deals with all the file-related tasks, for example, storage organization, recovery, naming, sharing, and protection of files.
- Device management:- device management keeps track of all the devices. This module is in charge of the task also known as the i/o controller. It additionally plays out the undertaking of designation and de-distribution of the devices.
- I/o system management: one of the primary objects of any os is to conceal the identity of that hardware device from the user.
- Secondary-storage management: systems have a few degrees of storage which incorporates primary storage, secondary storage, and cache storage. Instructions and data must be put away in primary storage or cache so a running program can reference them.
- Security:- security module ensures the data and information of a computer system against malware danger and authorized access.
- Command interpretation: this module is interpreting directions given by the acting system and assigns resources to process those directions.
- Networking: a distributed system is a collection of processors that don't share a memory, hardware devices, or a clock. The processors speak with each other through the network.
- Job accounting: keeping track of time and resources utilized by different jobs and users.
- Communication management: manage the coordination and task of compilers, interpreters, and other software resources of the different users of the computer systems.
Key takeaway
- An operating system (os) is system software that manages computer equipment and software resources and gives normal services to computer programs.
- An operating system is software with the accompanying highlights −
- An operating system is a program that goes about as an interface between the software and the computer hardware.
- It is a coordinated set of particular programs used to manage the overall resources and operations of the computer.
- It is specific programming that controls and monitors the execution of every single other program that resides in the computer, including application programs and other system software.
In the era of the seventies, the execution was very talked-about. The roles were dead in batches. Individuals were accustomed to having one laptop that was known as a mainframe.
In the batch software package, access is given to over one person; they submit their jobs to the system for execution.
The system place all of the roles in an exceedingly queue on the premise of 1st come back 1st serve and so executes the roles one by one. The users collect their output once all the roles get dead.
Fig 2 – Selection of the job for execution
Disadvantages of batch os
1. Starvation
Batch processing suffers from starvation. If there is area unit 5 jobs j1, j2, j3, j4, j4, and j5 gift within the batch. If the execution time of j1 is extremely high then different four jobs can ne'er be about to get dead or they're going to ought to stay up for a really time. Thence the opposite processes get starved.
2. Not interactive
Batch processing isn't appropriate for the roles that area unit addicted to the user's input. If employment needs the input of 2 numbers from the console then it'll ne'er be about to savvy within the execution situation since the user isn't a gift at the time of execution.
Multiprogramming software package
Multiprogramming is an extension to the execution wherever the electronic equipment is unbroken al-ways busy. Every method desires 2 varieties of system time: electronic equipment time and io time.
In instruction execution surroundings, for the time a method will its i/o, the electronic equipment will begin the execution of different processes. Therefore, instruction execution improves the potency of the system.
Multiprocessing software package
In data processing, parallel computing is achieved. There area unit over one processor's gift within the system which might execute over one method at a similar time. This may increase the turnout of the system.
Fig 3- multiprocessing
Real-time software package
In real-time systems, every job carries a precise point among that the work is supposed to be completed, otherwise the massive loss is there or maybe if the result's made then it'll be utterly useless.
The application of a true-time system exists within the case of military applications, if you would like to drop a missile then the missile is meant to be born with bound precision.
Key takeaway
In the batch software package, access is given to over one person; they submit their jobs to the system for execution.
The system place all of the roles in an exceedingly queue on the premise of 1st come back 1st serve and so executes the roles one by one. The users collect their output once all the roles get dead.
In an interactive software system, the user is capable of directly act with the os to provide the info or commands because the commands execute, and also the user can get the results of the execution forthwith.
Or
In straightforward words, interactive systems square measure those systems that take the input from the user i. E from a person's so producing an output.
The input that is distributed to the pc can be any type within the type or gestures like pressing the button or choosing one thing from the indicator, or by typewriting on the key-board.
Today largely users use windows or raincoat os in their system, which might be treated because the best example of an interactive system or we will say the graphical interactive system. Integrated development environments(ides) and an internet browser is additionally an example of a fancy interactive system.
Advantage of the interactive system:-
• One of the foremost vital blessings of an interactive software system is that it's terribly user friendly, that even a toddler will operate it because it is extremely straightforward to use. Today interactive systems square measure used for voice recognition and their square measure several tools that square measure offered within the market. Interactive os is employed within the medical field just like the viscus device and their square measure different chips that square measure utilized in the body that sends signals to the system.
• By the employment of interactive os promoting simpler than recent promoting that is finished on the tv, newspaper, or the radio. It helps to get an immediate response from the audience. Obtaining feedback from the patron may also be finished by the interactive system by exploiting online polls, surveys, or by doing an online campaign.
• It additionally performs excellently in promotional offers that square measure seen on the web site like with the assistance of this, we tend to able to get to grasp regarding a lot of offers or discount in a very a lot of enticing manner and it happens, any times that we tend to additionally get convinced by simply seeing the offers to shop for the merchandise that goes to allow the profit to the manufacturer at the tip.
• It is additionally terribly useful just in case of the those who square measure disabled. Today there square measure several devices that associate with their interactive a mode like an amazon stick or the IoT devices which might be operated simply by simply exploiting the phone an excellent a number of them additionally support voice recognition.
• The RND within the manufacture of medicine, buildings, chemicals, airplanes, automobiles, industrial plants, etc, ascertained the upper-quality products. And this will become attainable thanks to the interactive system. Advanced laptop animation produces an awfully top quality of films and games. And all these are created attainable thanks to trendy graphics systems, that provide the endless potentialities and ways in which within the style or production of a brand new product.
The disadvantage of interactive in operation system:-
• Interactive system price is kind of high thanks to its setup and installation, as an example, like an interactive whiteboard. The interactive system additionally creates a foul impact on the eyes of the user.
• Some times interactive web-based code wants a web association to try to or perform any action or task which might produce the matter to the user.
• The planning of those interactive software system square measure advanced and thanks to graphical interactive systems the process becomes a lot of haviers, therefore, it'll become long, thus the time the quality of the system will increase. So, therefore, times interactive code needs an additional quantity of hardware and memory resources to perform in a very smart manner or to take care of the time-space trade-off.
• The interactive system can also cause additional sound pollution like just in case of recognizing the voice publically places can become tougher. And affirmative these systems square measure mare straightforward to interrupt than others. Even in some countries, several stores use computer-generated voices that projected go into the road exploitation speakers to undertake to draw in customers into the shop, which is treated as sound pollution and a nuisance generally.
• It will increase the usability by graphical techniques which provide a lot of versatile options as compared to different the recent ancient strategies in style. We can simply build changes in our style by simply exploiting undo operate while not meddling or troubling the full style. It is additionally attainable to look at a model or a style from totally different angles by simply rotating it on its axes. We will additionally build the minute details of a style by simply employing a magnifying operate.
• In the case of interactive promoting, if a client already bought a product then he/she can simply expire from that adv while not taking interest in it.
• If we tend to remark text to speech it's an additional variety of active systems within which the user interacts with the system by inputting or coming into the text. However some times the text can not be born-again as we tend to individuals pronounce it, this happens thanks to cultural distinction.
Key takeaway
In an interactive software system, the user is capable of directly act with the os to provide the info or commands because the commands execute, and also the user can get the results of the execution forthwith.
Or
In straightforward words, interactive systems square measure those systems that take the input from the user i. E from a person's so producing an output.
The input that is distributed to the pc can be any type within the type or gestures like pressing the button or choosing one thing from the indicator, or by typewriting on the key-board.
Time-sharing systems are not accessible in the 1960s.
- Time-sharing or performing multiple tasks is a legitimate expansion of multiprogramming. That is processor time is shared among numerous users at the same time is called time-sharing.
- The primary contrast between multi-programmed batch systems and time-sharing systems is, in multi-programmed batch systems its goal is to expand processor use, while in time-sharing systems its goal is to minimize response time.
- Numerous jobs are executed by the CPU by switching between them,
However, the switches happen in much less time, so that the user can get a prompt response.
- For instance, in transaction processing, the processor executes every user
Program in a short burst or quantum of calculation.
- That is if n users are available, every user can get time quantum.
- At the point when the user presents the instruction, the response time is
Seconds all things considered.
- The operating system utilizes CPU scheduling and multiprogramming to give
Every user a little part of a time.
- Computer systems that were structured essentially as batch systems have been altered to time-sharing systems.
- For instance ibm's os/360.
Time-sharing operating system
- As the name itself recommends, in a time-sharing system or performing various tasks system, different jobs can be executed on a system simultaneously by sharing the CPU time among them.
- It is viewed as a logical expansion of multiprogramming because the two do synchronous execution yet vary in their prime aims.
- The fundamental goal of time-sharing systems is to limit reaction time yet not boosting the processor use(which is the target of multiprogramming systems).
- The time-sharing systems were created to give an intuitive utilization of the computer system.
- A time-shared system utilizes CPU planning and multiprogramming to give every user a little segment of a period shared computer.
- It enables numerous users to share computer resources all the while. As the system switches quickly from one user to the next, a brief timeframe opening is given to every user for their executions.
- The time-sharing operating system guarantees that every one of the assignments gets the chance to get to the CPU individually and for a fixed little interval of time. This interval is known as the time quantum.
- Eg: Unix systems
Advantages of time-sharing os:
- Each user gets an equivalent chance
- Fewer chances of duplication of programming
- Cpu inert time can be diminished
Disadvantages of time-sharing os:
- Unwavering quality issue
- One must need to deal with the security and respectability of user programs and information.
- Information correspondence issue
Fig 4 -Time-Sharing Operating System
Key takeaway
Time-sharing systems are not accessible in the 1960s.
- Time-sharing or performing multiple tasks is a legitimate expansion of
Multiprogramming. That is processor time is shared among numerous users
At the same time is called time-sharing.
- A real-time operating system (RTOS) is an operating system that ensures a specific capability within a predetermined time requirement. For instance, an operating system may be intended to guarantee that a specific item was accessible for a robot on a mechanical production system.
- A real-time system implies that the system is exposed to real-time, i. E., reaction ought to be ensured inside a predetermined planning requirement or system should fulfill the predefined time constraint.
- Real-time systems are utilized when there are inflexible time necessities on the activity of a processor or the progression of information and real-time systems can be utilized as a control device in a devoted application.
- A real-time operating system must have well-characterized, fixed time requirements, generally, the system will come up short. For instance, scientific tests, medical imaging systems, industrial control systems, weapon systems, robots, aviation authority systems, and so on.
- There are two kinds of real-time operating systems.
- Hard real-time systems: hard real-time systems ensure that basic undertakings complete on time. In hard real-time systems, secondary storage is constrained or missing and the information is stored in rom. In these systems, virtual memory is never found.
- Soft real-time systems: soft real-time systems are less prohibitive. A basic real-time task gets need over different tasks and holds the need until it finishes. Soft real-time systems have constrained utility than hard real-time systems. For instance, multimedia, virtual reality, advanced scientific projects like undersea investigation and planetary wanderers, and so on.
Key takeaway
- A real-time operating system (RTOS) is an operating system that ensures a specific capability within a predetermined time requirement. For instance, an operating system may be intended to guarantee that a specific item was accessible for a robot on a mechanical production system.
Most computer systems are single processor systems i. E they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices, etc. An image demonstrating the multiprocessor architecture is
Fig 5 – Multiprocessing architecture
Types of multiprocessors
There area unit primarily 2 styles of multiprocessors i. E. Bilaterally symmetrical and uneven multi-processors. Details regarding them area unit as follows −
Symmetric multiprocessors
In these styles of systems, every processor contains the same copy of the operative system, and that they all communicate with one another. All the processor's area unit during a peer to look relationship i. E. No master-slave relationship exists between them.
An example of the bilaterally symmetrical data processing system is that the encore version of the Unix system for the multi max laptop.
Asymmetric multiprocessors
In uneven systems, every processor is given a predefined task. There's a master processor that offers instruction to all or any the opposite processors. The uneven digital computer system contains a master-slave relationship.
An asymmetric digital computer was the sole style of the digital computer on the market before symmetric multiprocessors were created. Now also, this can be the cheaper choice.
Advantages of digital computer systems
There area unit multiple benefits to digital computer systems. A number of these area unit area unit
More reliable systems
In a digital computer system, although one processor fails, the system won't halt. This ability to continue operating despite hardware failure is thought of as sleek degradation. For example: if there area unit five processors during a digital computer system and one among them fails, then conjointly four processors area unit still operating. That the system solely becomes slower and doesn't ground to a halt.
Enhanced outturn
If multiple processor area units operating in the bike, then the outturn of the system in-creases i. E. Variety of processes obtaining dead per unit of your time increases. If there area unit N processors then the outturn will increase by associate quantity just below n.
More economic systems
Multiprocessor systems area unit cheaper than single-processor systems within the long-term because they share the information storage, peripheral devices, power provides, etc. If there area unit multiple processes that share information, it's higher to schedule them on {multiprocessor|digital laptop} systems with shared information than have different computer systems with multiple copies of the information.
Disadvantages of digital computer systems
There area unit some disadvantages in addition to digital computer systems. A number of these are:
Increased expense
Even though {multiprocessor|digital laptop} systems area unit cheaper within the long-term than victimization multiple computer systems, still they're quite costly. It's less expensive to shop for an easy single processor system than a digital computer system.
Complicated software system needed
There area unit multiple processors during a digital computer system that share peripherals, memory, etc. So, it's far more sophisticated to schedule processes and imparts resources to processes. Then in single-processor systems. Hence, a lot of complicated and complex software system is needed in digital computer systems.
Large main memory needed
All the processors within the digital computer system share the memory. Thus a way larger pool of memory is needed as compared to single-processor systems.
Key takeaway
Most computer systems are single processor systems i. E they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices, etc.
Definition: A multi-user operating system is a computer operating system that allows multiple users to access a single system with one operating system on it.
It is generally used on large mainframe computers.
Example: Linux, Unix, Windows 2000, ubuntu, mac os, etc.,
in the multi-user operating system, different users are connected at different terminals and we can access, these users through the network as shown in the diagram.
Fig 6 - users through the network
Features of the multi-user operating system
• Multi-tasking- using a multi-user operating system we can perform multiple tasks at a time, i. E. We can run more than one program at a time.
For example, we can edit a word document while browsing the internet.
• Resource sharing- we can share different peripherals like printers, hard drives or we can share a file or data. For this, each user is given a small time slice of CPU time.
• Background processing- it means that when commands are not processed firstly, then they are executed in the background while other programs are interacting with the system in real-time.
Types of multi-user operating system
A multi-user operating system is of 3 types which are as follows:
1. Distributed systems: in this, different computers are managed in such a way so that they can appear as a single computer. So, a sort of network is formed through which they can communicate with each other.
2. Time-sliced systems: in this, a short period is assigned to each task, i. E. Each user is given a time slice of the CPU time. As we know these time slices are tiny, so it appears to the users that they all are using the mainframe computer at the same time.
3. Multiprocessor systems: in this, the operating system utilizes more than one processor.
Example: Linux, Unix, Windows XP
Difference between single-user and multi-user system
Single user operating system | Multi-user operating system |
It is an operating system in which the user can manage one thing at a time effectively. | It is an operating system in which multiple users can manage multiple resources at a time |
Example: ms-dos | Example: Linux, Unix, Windows 2000, Windows 2003, etc. |
Single user operating system has two types: single-user single-task operating system and single user multitask operating system. | It is of three types: time-sharing operating system, distributed operating system, and multiprocessor system. |
It is simple. | It is complex. |
It provides a platform for one user at a time. | It provides controlled access for the number of users by maintaining a database of known users. |
If another user wants to access the computer resources, then he/she has to wait until the current process completes. | There is no need to wait for accessing computer resources. |
This type of operating system is used for a single user. | This type of operating system is used for multiple users. |
In this, sometimes CPU is utilized to its maximum limit. | The operating system stimulates real-time performance by task switching. |
It supports standalone systems. | It doesn’t support standalone systems. |
It is the operating system that maximum people use on their personal computers or laptops. | It is the operating system that is most of the time used in mainframe computers. |
In this, there is no need to take care of the balance between users. | In this, we have to take care of the balance between users so that if one problem arises with one user does not affect other users also. |
Advantages of the multi-user operating system
• When one computer in the network gets affected, then it does not affect another computer in the network. So, the system can be handled efficiently.
• Also, different users can access the same document on their computer.
For example: if one computer contains the pdf file which the other user wants to access, then the other user can access that file.
• We use the multi-user operating system in the printing process so that different users can access the same printer and a regular operating system can not do this process.
• Airlines also use this operating system for ticket reservations.
• We make use of the multi-user operating system in teachers and library staff for handling and searching for books. In this, the book record is stored in one computer while the other systems which are connected can access that computer for querying of books.
Disadvantages of the multi-user operating system
• Sometimes sharing your data becomes dangerous for you as your private data also gets shared.
• Virus attacking takes place on all computers simultaneously as the computers are shared. So if one computer is affected then the other also gets affected.
• Also, computer information is shared.
Key takeaway
Definition: a multi-user operating system is a computer operating system that allows multiple users to access a single system with one operating system on it.
It is generally used on large mainframe computers.
Example: Linux, Unix, Windows 2000, ubuntu, mac os, etc.,
in the multi-user operating system, different users are connected at different terminals and we can access, these users through the network as shown in the diagram.
Fig 7 - users through the network
Most computer systems are single processor systems i. E they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices, etc. An image demonstrating the multiprocessor architecture is –
Fig 8 – Multiprocessing architecture
Types of multiprocessors
There are primarily 2 sorts of multiprocessors i. E. Interchangeable and uneven multi-processors. Details concerning them are as follows −
Symmetric multiprocessors
In these sorts of systems, every processor contains an identical copy of the in operation system, and that they all communicate with one another. All the processors are in an exceedingly peer to look relationship i. E. No master-slave relationship exists between them.
An example of the interchangeable data processing system is that the encore version of the operating system for the multi max pc.
Asymmetric multiprocessors
In uneven systems, every processor is given a predefined task. There's a master processor that offers instruction to any or all the opposite processors. The uneven digital computer system contains a master-slave relationship.
An asymmetric digital computer was the sole variety of digital computers out there before symmetric multiprocessors were created. Now also, this is often the cheaper possibility.
Advantages of digital computer systems
There are multiple blessings to digital computer systems. A number of these are ar
More reliable systems
In a digital computer system, even though one processor fails, the system won't halt. This ability to continue operating despite hardware failure is understood as sleek degradation. For example: if there are five processors in an exceedingly digital computer system and one in each of them fails, then add four processors are still operating. That the system solely becomes slower and doesn't ground to a halt.
Enhanced turnout
If multiple processors are operating in bicycle-built-for-two, then the turnout of the system in-creases i. E. Range of processes obtaining dead per unit of your time increase. If there are n processors then the turnout will increase by associate degree quantity slightly below n.
More economic systems
Multiprocessor systems are cheaper than single-processor systems at the end of the day because they share information storage, peripheral devices, power provides, etc. If multiple processes share knowledge, it's higher to schedule them on {multiprocessor|digital pc} systems with shared knowledge than have different computer systems with multiple copies of the information.
Disadvantages of digital computer systems
There are some disadvantages still for digital computer systems. A number of these are:
Increased expense
Even though {multiprocessor|digital pc} systems are cheaper within the end of the day than mistreatment multiple computer systems, still they're quite expensive. It's less expensive to shop for an easy single processor system than a digital computer system.
Complicated software needed
There are multiple processors in an exceedingly digital computer system that share peripherals, memory, etc. So, it's way more sophisticated to schedule processes and impart re-sources to processes. Then in single-processor systems. Hence, a lot of advanced and complex software is needed in digital computer systems.
Large main memory needed
All the processors within the digital computer system share the memory. Thus a far larger pool of memory is needed as compared to single-processor systems.
Key takeaway
Most computer systems are single processor systems i. E they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices, etc.
What is the thread?
A thread is a flow of execution through the process code, with its program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack that contains the execution history.
A thread shares with its peer threads a few pieces of information like code segment, the data segment, and open files. When one thread alters a code segment memory item, all other threads see that.
A thread is also called a lightweight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving the performance of the operating system by reducing the overhead thread is equivalent to a classical process.
Each thread belongs to exactly one process and no thread can exist outside a process. Each thread represents a separate flow of control. Threads have been successfully used in implementing network servers and web servers. They also provide a suitable foundation for the parallel execution of applications on shared-memory multiprocessors. The following figure shows the working of a single-threaded and a multithreaded process.
Fig 9- process and thread
Difference between process and thread
S. N. | Process | Thread |
1 | The process is heavyweight or resource-intensive. | Thread is lightweight, taking lesser resources than a process. |
2 | Process switching needs interaction with the operating system. | Thread switching does not need to interact with the operating system. |
3 | In multiple processing environments, each process executes the same code but has its memory and file resources. | All threads can share the same set of open files, child processes. |
4 | If one process is blocked, then no other process can execute until the first process is unblocked. | While one thread is blocked and waiting, a second thread in the same task can run. |
5 | Multiple processes without using threads use more resources. | Multiple threaded processes use fewer resources. |
6 | In multiple processes, each process operates independently of the others. | One thread can read, write, or change another thread's data. |
Advantages of thread
- Threads minimize the context switching time.
- The use of threads provides concurrency within a process.
- Efficient communication.
- It is more economical to create and context switch threads.
- Threads allow the utilization of multiprocessor architectures to a greater scale and efficiency.
Types of thread
Threads are implemented in the following two ways −
- User-level threads − user-managed threads.
- Kernel level threads − operating system managed threads acting on the kernel, an operating system core.
User-level threads
In this case, the thread management kernel is not aware of the existence of threads. The thread library contains code for creating and destroying threads, passing messages and data between threads, scheduling thread execution, and saving and restoring thread contexts. The application starts with a single thread.
Fig 10 – single thread
Advantages
- Thread switching does not require kernel-mode privileges.
- The user-level thread can run on any operating system.
- Scheduling can be application-specific in the user-level thread.
- User-level threads are fast to create and manage.
Disadvantages
- In a typical operating system, most system calls are blocking.
- The multithreaded applications cannot take advantage of multiprocessing.
Kernel level threads
In this case, thread management is done by the kernel. There is no thread management code in the application area. Kernel threads are supported directly by the operating system. Any application can be programmed to be multithreaded. All of the threads within an application are supported within a single process.
The kernel maintains context information for the process as a whole and individuals' threads within the process. Scheduling by the kernel is done on a thread basis. The kernel performs thread creation, scheduling, and management in the kernel space. Kernel threads are generally slower to create and manage than the user threads.
Advantages
- The kernel can simultaneously schedule multiple threads from the same process on multiple processes.
- If one thread in a process is blocked, the kernel can schedule another thread of the same process.
- Kernel routines themselves can be multithreaded.
Disadvantages
- Kernel threads are generally slower to create and manage than the user threads.
- Transfer of control from one thread to another within the same process requires a mode switch to the kernel.
Multithreading models
Some operating systems provide a combined user-level thread and kernel-level thread facility. Solaris is a good example of this combined approach. In a combined system, multiple threads within the same application can run in parallel on multiple processors and a blocking system call need not block the entire process. Multithreading models are three types
- Many to many relationships.
- Many to one relationship.
- One to one relationship.
Many to many models
The many-to-many model multiplexes any number of user threads onto an equal or smaller number of kernel threads.
The following diagram shows the many-to-many threading model where 6 user-level threads are multiplexing with 6 kernel-level threads. In this model, developers can create as many user threads as necessary and the corresponding kernel threads can run in parallel on a multiprocessor machine. This model provides the best accuracy on concurrency and when a thread performs a blocking system call, the kernel can schedule another thread for execution.
Fig 11 – Many to many models
Many to one model
The many-to-one model maps many user-level threads to one kernel-level thread. Thread management is done in userspace by the thread library. When the thread makes a blocking system call, the entire process will be blocked. Only one thread can access the kernel at a time, so multiple threads are unable to run in parallel on multiprocessors.
If the user-level thread libraries are implemented in the operating system in such a way that the system does not support them, then the kernel threads use the many-to-one relationship modes.
Fig 12 – Many to one model
One to one model
There is a one-to-one relationship of user-level thread to the kernel-level thread. This model provides more concurrency than the many-to-one model. It also allows another thread to run when a thread makes a blocking system call. It supports multiple threads to execute in parallel on microprocessors.
The disadvantage of this model is that creating a user thread requires the corresponding kernel thread. Os/2, windows NT, and windows 2000 use one to one relationship model.
Fig 13 – One to one model
Difference between user-level & kernel-level thread
S. N. | User-level threads | Kernel-level thread |
1 | User-level threads are faster to create and manage. | Kernel-level threads are slower to create and manage. |
2 | Implementation is by a thread library at the user level. | The operating system supports the creation of kernel threads. |
3 | User-level thread is generic and can run on any operating system. | Kernel-level thread is specific to the operating system. |
4 | Multi-threaded applications cannot take advantage of multiprocessing. | Kernel routines themselves can be multithreaded. |
Key takeaway
What is the thread?
A thread is a flow of execution through the process code, with its program counter that keeps track of which instruction to execute next, system registers which hold its current working variables, and a stack that contains the execution history.
A thread shares with its peer threads a few pieces of information like code segment, the data segment, and open files. When one thread alters a code segment memory item, all other threads see that.
A thread is also called a lightweight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving the performance of the operating system by reducing the overhead thread is equivalent to a classical process.
The software may be a construct that enables the user application programs to act with the system hardware. Since the software is such a fancy structure, it ought to be created with utmost care therefore it will be used and changed simply. A simple thanks to doing that is to form the software in elements. Every one of those elements ought to be outlined with clear inputs, outputs, and functions.
Simple structure
There square measure several operative systems that have a rather easy structure. These started as little systems and quickly distended a lot more than their scope. A typical example of this can be ms-dos. It had been designed merely for a distinct segment quantity for individuals. There was no indication that it might become therefore well-liked.
An image as an instance of the structure of ms-dos is as follows −
Fig 14 – MS-DOS structure
It is higher than operative systems have a standard structure, in contrast to ms-dos. That may cause larger management over the pc system and its numerous applications. The standard structure would conjointly permit the programmers to cover data pro re nata and implement internal routines as they see work while not ever-changing the outer specifications.
Layered structure
One way to realize modularity within the software is that the stratified approach. In this, the rock bottom layer is that the hardware, and therefore the top layer is that the interface.
An image demonstrating the stratified approach is as follows −
Fig 15 – the layered structure of OS
As seen from the image, every higher layer is made on the rock bottom layer. All the layers hide some structures, operations, etc from their higher layers.
One downside with the stratified structure is that every layer has to be rigorously defined. This is often } necessary as a result of the higher layers can solely use the functionalities of the layers below them.
Key takeaway
The software may be a construct that enables the user application programs to act with the system hardware. Since the software is such a fancy structure, it ought to be created with utmost care therefore it will be used and changed simply. A simple thanks to doing that is to form the software in elements. Every one of those elements ought to be outlined with clear inputs, outputs, and functions.
What is associate degree software (os)?
Definition: associate degree software is often outlined as a system sort of a giant & complicated is divided into tiny items victimization associate degree interface. This technique is employed to share the various os elements that embrace file, input/output device, method memory, etc. All the divided items should be well-defined components of the system with fastidiously classified i/ps, o/ps & perform. We all know that every one of the systems doesn’t have the same structure however many currents in operation systems share the elements of the system printed below.
The os is that the most vital program {in a|during a|in associate degree exceedingly|in a very} laptop as a result of each laptop works with a software (os) to run all the programs & applications. The most tasks of the pc os area unit distinguishing i/p from the keyboard, causing o/p to the screen, chase files, storage drives, peripheral devices dominant, like printers, etc.
Components of software
The elements of associate degree software play a key role to form a spread of automatic data processing system components work along. The operation elements area unit is mentioned below.
Fig 16 - Operating-system-components
Kernel
The kernel within the os provides the fundamental level of management on all the pc peripherals. Within the software, the kernel is an important part that hundreds first of all and remains inside the most memory. So that memory accessibility is often managed for the programs inside the ram, it creates the programs to induce access from the hardware resources. It resets the in operation states of the central processing unit for the simplest operation the least bit times.
Process execution
The os provides an associate degree interface between the hardware similarly to an associate degree application so that the program will connect through the hardware device by merely following procedures & principles organized into the os. The program execution chiefly includes a method created through associate degree os kernel that uses memory house similarly as differing kinds of alternative resources.
Interrupt
In the software, interrupts area unit essential as a result of they furnish a reliable technique for the os to speak & react to their surroundings. Associate degree interrupt is nothing however one quite signal between a tool similarly as an automatic data processing system otherwise from a program within the laptop that needs the os to depart and choose accurately what to try to afterward. Whenever an associate degree interrupt signal is received, then the hardware of the pc puts on hold mechanically no matter trojan horse is running presently, keeps its standing & runs a trojan horse that is connected antecedently with the interrupt.
Memory management
The practicality of associate degree os is nothing however memory management manages main memory & moves processes backward and forward between disk & main memory throughout implementation. This tracks every & each memory position; till it's appointed to some method otherwise it's open. It verifies what proportion of memory is often allotted to methods and additionally makes a choice to grasp that process can get memory at what time. Whenever memory is unallocated, then it tracks correspondingly to update the standing. Memory management work is often divided into 3 necessary teams like memory management of hardware, os, and application memory management.
Multitasking
It describes the operating of many freelance laptop programs on the same automatic data processing system. Multitasking in associate degree os permits associate degree operators to execute one or a lot of laptop tasks at a time. Since several computers will perform one or 2 tasks at a time, sometimes this could be through with the assistance of time-sharing, wherever every program uses the time of a laptop to execute.
Networking
Networking is often outlined as once the processor interacts with one another through communication lines. The look of communication-network should take into account routing, affiliation strategies, safety, the issues of opinion & security.
Presently most of the in operation systems maintain different networking techniques, hardware, & applications. This involves that computers that run on totally different operating systems may be enclosed in a very general network to share resources like knowledge, computing, scanners, printers, that uses the connections of either wired otherwise wireless.
Security
If a laptop has various people to permit the immediate method of varied processes, then the numerous processes need to be protected against alternative activities. This system security chiefly depends upon the spread of technologies that employ effectively. Current in operation systems provides associate degree entrée to a variety of resources, that area unit gettable to figure the computer code on the system, and to external devices like networks by suggests that of the kernel. The software ought to be capable of characteristics between demands that need to be allowed for progressing & others that don’t ought to be processed. To boot, to allow or veto a security version, an automatic data processing system with a high level of protection additionally provides auditing choices. Thus this can permit observation of the requests from accessibility to resources.
User interface
A GUI or interface (UI) is that the part of the associate degree os that allows the associate degree operator to induce the in-formation. An interface supported text displays the text similarly as its commands that area unit written over an instruction with the assistance of a keyboard.
The os-based applications chiefly give a particular interface for economical communication. The most performed of an interface of associate degree application is to induce the inputs from the operator & to produce o/ps to the operator. But, varieties} of inputs received from the interface similarly because the o/p types offered by the interface could modifier from application to application. The UI of any application is often classified into 2 varieties particularly GUI (graphical UI) & command-line interface (command line user interface).
Key takeaway
What is associate degree software (os)?
Definition: associate degree software is often outlined as a system sort of a giant & complicated is divided into tiny items victimization associate degree interface. This technique is employed to share the various os elements that embrace file, input/output device, method memory, etc. All the divided items should be well-defined components of the system with fastidiously classified i/ps, o/ps & perform. We all know that every one of the systems doesn’t have the same structure however many currents in operation systems share the elements of the system printed below.
The os is that the most vital program {in a|during a|in associate degree exceedingly|in a very} laptop as a result of each laptop works with a software (os) to run all the programs & applications. The most tasks of the pc os area unit distinguishing i/p from the keyboard, causing o/p to the screen, chase files, storage drives, peripheral devices dominant, like printers, etc.
A software package provides services to each user and the programs.
• It Provides Programs Associate Degree Surroundings To Execute.
• It Provides users the services to execute the programs conveniently.
Following area unit a couple of common services provided by associate degree software package associate degree
• Program Execution
• I/O Operations
• File System Manipulation
• Communication
• Error Detection
• Resource Allocation
• Protection
Program execution
Operating systems handle several types of activities from user programs to system programs like printer spooler, name servers, digital computer, etc. Every one of those activities is encapsulated as a method.
A method includes the entire execution context (code to execute, information to manipulate, registers, os resources in use). Following area unit the foremost activities of associate degree software package with reference to program management −
• Loads A Program Into Memory.
• Executes The Program.
• Handles The Program's Execution.
• Provides A Mechanism For Method Synchronization.
• Provides A Mechanism For Method Communication.
• Provides A Mechanism for dead-end handling.
I/o operation
An i/o scheme includes i/o devices and their corresponding driver software system. Drivers hide the peculiarities of specific hardware devices from the users.
A software package manages the communication between the user and device drivers.
• I/O operation means that browse or write operation with any file or any specific i/o device.
• Operating system provides the access to needed|the specified|the desired} i/o device once required.
File system manipulation
A file represents a set of connected info. Computers will store files on the disk (secondary storage), for semipermanent storage purpose. Samples of storage media embody storage device, disc, and optical disc drives like CD, DVD. Each of those media has its properties like speed, capacity, information transfer rate, and information access strategies.
A filing system is generally organized into directories for straightforward navigation and usage. These directories could contain files and alternative directions. Following area unit the foremost activities of associate degree software package with reference to file management −
• Program must browse a file or write a file.
• The software package offers permission to the program for operation on a file.
• Permission varies from read-only, read-write, denied then on.
• Operating system provides an associate degree interface to the user to create/delete files.
• Operating system provides an associate degree interface to the user to create/delete directories.
• Operating system provides associate degree interface to make the backup of a filing system.
Communication
In the case of distributed systems that area unit a set of processors that don't share a memory, peripheral devices, or a clock, the software package manages communications between all the processes. Multiple processes communicate with each other through communication lines within the network.
The os handles routing and affiliation ways, and therefore the issues of rivalry and security. Following area unit the foremost activities of associate degree software package with reference to reference to
• Two processes usually need the information to be transferred between them
• Both the processes are often on one pc or different computers, however, the area unit is connected through an electronic network.
• Communication is also enforced by 2 strategies, either by shared memory or by message passing.
Error handling
Errors will occur anytime and anyplace. A slip-up could occur in the processor, in i/o devices, or within the memory hardware. Following area unit the foremost activities of associate degree software package with reference to error handling −
• The os perpetually checks for attainable errors.
• The os takes associate degree acceptable action to make sure correct and consistent computing.
Resource management
In case of multi-user or multi-tasking surroundings, resources like main memory, processor cycles, and files storage area unit to be allotted to every user or job. Following area unit the foremost activities of associate degree software package with reference to resource management −
• The os manages every kind of resource mistreatment schedulers.
• Processor programming algorithms area unit used for higher utilization of CPU.
Protection
Considering a system having multiple users and instruction execution of multiple processes, the varied processes should be protected against every other's activities.
Protection refers to a mechanism or some way to manage the access of programs, processes, or users to the resources outlined by a system. Following area unit the foremost activities of associate degree software package with reference to reference to
• The os ensures that each one access to system resources is controlled.
• The os ensures that the external i/o devices area unit is protected against invalid access attempts.
• The os provides authentication options for every user by means that of passwords.
Key takeaway
A software package provides services to each user and the programs.
• It provides programs associate degree surroundings to execute.
• It provides users the services to execute the programs conveniently.
Following area unit a couple of common services provided by associate degree software package associate degree
• Program execution
• I/O operations
• File system manipulation
• Communication
• Error detection
• Resource allocation
• Protection
A re-entrant kernel allows processes to grant away the central processing unit whereas in kernel mode, not clogging alternative processes from additionally coming into kernel mode.
Typical use is io wait. The process's desire to browse a file. Calls for a kernel to operate for this. Within the kernel operation, the controller is asked for the info. Obtaining the info can take a while & the operation is blocked throughout that point. With an associate in nursing re-entrant kernel, the computer hardware can assign central {processing unit|CPU|C. P. U. |central processor|processor|mainframe|electronic equipment|hardware|computer hardware} {to associate in nursingother|to a different} process till an interrupt from controller indicates that the info is offered and our thread will be resumed. This method will still access io, like user input
Key takeaway
A re-entrant kernel allows processes to grant away the central processing unit whereas in kernel mode, not clogging alternative processes from additionally coming into kernel mode.
Apart from the microkernel, the monolithic kernel is another classification of the kernel. Like microkernel, this one conjointly manages system resources between application and hardware, however, user services and kernel services area unit enforced beneath same address house. It will increase the scale of the kernel, so will increase the size of the software package furthermore.
This kernel provides C. P. U. Planning, memory management, file management, and alternative software package functions through system calls. As each services area unit is implemented beneath the same address house, this makes software package execution quicker.
Below is that the delineate illustration of the monolithic kernel:
Fig 17 – monolithic kernel
If any service fails the whole system crashes, and it's one of the drawbacks of this kernel. The whole software package wants modification if the user adds a replacement service.
Advantages of the monolithic kernel –
• One of the most important advantages of getting a monolithic kernel is that it provides c. P. U. Planning, memory management, file management, and alternative software package functions through system calls.
• The alternative one is that it's one giant method running entirely in an exceedingly single ad-dress house.
• It could be a single static computer file. An example of some monolithic kernel-based mostly OSS is an operating system, Linux, Open Vms, Xts-400, Z/Tpf.
Disadvantages of the monolithic kernel –
• One of the most important disadvantages of a monolithic kernel is that if anyone service fails it ends up in an entire system failure.
• If the user has got to add any new service. The user must modify the entire operational system.
Key variations between monolithic kernel and microkernel –
Key takeaway
Apart from the microkernel, the monolithic kernel is another classification of the kernel. Like microkernel, this one conjointly manages system resources between application and hardware, however, user services and kernel services area unit enforced beneath same address house. It will increase the scale of the kernel, so will increase the size of the software package furthermore.
This kernel provides c. P. U. Planning, memory management, file management, and alternative software package functions through system calls. As each services area unit is implemented beneath the same address house, this makes software package execution quicker.
References:
1. Silberschatz, Galvin and Gagne, “Operating systems concepts”, Wiley
2. Sibsankar Halder and Alex A Aravind, “Operating systems”, Pearson education
3. Harvey M Dietel, “ An introduction to the operating system”, Pearson education
4. D M Dhamdhere, “Operating systems: a concept-based approach”, 2nd edition,
5. Tmh 5. William Stallings, “Operating systems: internals and design principles ”, 6th edition, Pearson education