Operating System Structure

Neso Academy
26 Feb 201812:16

Summary

TLDRThis lecture delves into the structure of operating systems, emphasizing multiprogramming and multitasking. Multiprogramming allows the CPU to execute multiple programs, enhancing CPU utilization by ensuring it's always active. The concept is illustrated with a job pool and memory layout, demonstrating how jobs are managed for efficient CPU use. Multitasking, or time sharing, enables user interaction with running programs through rapid job switching, creating an illusion of a dedicated system for each user. The lecture highlights the importance of these features for efficient resource management and user experience in operating systems.

Takeaways

  • 💡 Operating systems have a variety of internal structures but share common functionalities essential for their operation.
  • 🔄 Multiprogramming is the capability of an operating system to run multiple programs concurrently, enhancing CPU utilization.
  • 🤖 Without multiprogramming, a single user's task would monopolize the CPU and I/O devices until completion, leading to inefficiency.
  • 🔑 A job pool is a collection of all tasks waiting to be executed, and a subset of these jobs is loaded into memory for execution.
  • 🖥️ The operating system's role in multiprogramming is to assign the CPU to various jobs, ensuring that the CPU is never idle when a job is waiting for I/O operations.
  • ⏱️ Multitasking or time sharing is an advancement over multiprogramming, allowing users to interact with programs while they are running by rapidly switching between them.
  • 👥 Time-sharing systems support multiple users who can share the computer system simultaneously, giving the illusion of a dedicated system to each user.
  • 🔄 The efficiency of time-sharing systems comes from the high-speed switching between user jobs, which is imperceptible to the users due to the difference in human and CPU speeds.
  • 🤝 Direct communication between the user and the system is a key feature of time-sharing systems, unlike in multiprogramming.
  • 📈 CPU scheduling algorithms play a critical role in time-sharing systems, determining how time is allocated among the users for their programs to execute.
  • 💻 Each user in a time-sharing system has at least one program in memory, waiting to be executed, and once loaded and running, it is referred to as a process.

Q & A

  • What are the two fundamental capabilities that every operating system must have according to the lecture?

    -Every operating system must be capable of multiprogramming and time sharing or multitasking.

  • What is the main purpose of multiprogramming in operating systems?

    -The main purpose of multiprogramming is to increase CPU utilization by running multiple programs concurrently, ensuring that the CPU always has a job to execute.

  • How does multiprogramming improve CPU utilization?

    -Multiprogramming improves CPU utilization by organizing jobs so that when one job is waiting for I/O operations or other resources, the CPU can switch to executing another job, thus avoiding idle time.

  • What is a job in the context of multiprogramming?

    -A job in the context of multiprogramming is a unit of work that needs to be executed, which may contain code and data.

  • Can all jobs from the job pool be loaded into memory in a multiprogramming system?

    -No, not all jobs from the job pool can be loaded into memory due to limited memory resources, such as RAM. Only a subset of jobs is loaded into memory at a time.

  • What is the difference between a multiprogramming system and a time-sharing or multitasking system?

    -A multiprogramming system focuses on efficient use of system resources like CPU and memory but does not provide user interaction. In contrast, a time-sharing or multitasking system allows multiple users to interact with the computer system simultaneously, with the CPU switching rapidly between user jobs.

  • How does a time-sharing system provide the illusion of a dedicated system to each user?

    -A time-sharing system provides the illusion of a dedicated system to each user by rapidly switching between user jobs, making the users feel that the entire system belongs to them, even though they are sharing the system with others.

  • What is the significance of CPU scheduling in a time-sharing system?

    -CPU scheduling is significant in a time-sharing system as it determines how the CPU time is allocated among the various user jobs, ensuring that each user gets a fair share of the CPU resources.

  • What is the difference between CPU speed and human interaction speed in the context of a time-sharing system?

    -CPU speed is significantly higher than human interaction speed. In a time-sharing system, the rapid switching of jobs occurs at CPU speed, while user interactions with the system occur at a slower human speed, creating a time gap that allows for efficient multitasking.

  • What is a process in the context of operating systems?

    -A process is a program that has been loaded into memory and is currently executing. It represents an active instance of a program with its own resources and execution context.

  • How does the concept of multiprogramming relate to everyday life, as illustrated in the lecture with an example?

    -The concept of multiprogramming relates to everyday life by drawing an analogy to a lawyer handling multiple clients. Just as a lawyer can work on one case and then switch to another while waiting for paperwork or trials, a CPU in a multiprogramming system can execute multiple jobs, switching between them to maximize efficiency.

Outlines

00:00

🖥️ Operating System Structure and Multiprogramming

This paragraph introduces the concept of operating system structure, emphasizing the importance of understanding computer system organization and architecture as a foundation. It highlights the internal differences among various operating systems like Windows and Ubuntu, while also noting their common functionalities. The main focus is on multiprogramming, which is the ability of an operating system to run multiple programs concurrently, thus improving CPU utilization. The paragraph explains how multiprogramming works by organizing jobs in a job pool and loading a subset into memory, allowing the CPU to execute different jobs when one job is waiting for I/O operations. This system prevents the CPU from being idle and ensures efficient use of computing resources.

05:03

🔄 The Efficiency of Multiprogramming and Transition to Multitasking

Building upon the concept of multiprogramming, this paragraph delves into its efficiency and relates it to real-life scenarios, such as a lawyer managing multiple clients simultaneously. It clarifies that while multiprogramming optimizes resource utilization, it lacks user interaction capabilities. The paragraph then transitions to the topic of multitasking or time-sharing systems, which allow for user interaction by rapidly switching between multiple jobs. It explains how a time-sharing system provides the illusion of a dedicated system to each user through fast job switching, facilitated by the high speed of CPU operations compared to human interaction speeds. The paragraph also sets the stage for further discussion on CPU scheduling algorithms and introduces the concept of a 'process' in the context of multitasking.

10:07

🕒 The Nature of Time-Shared Systems and CPU Scheduling

This paragraph further explores the characteristics of time-shared systems, illustrating how users perceive the system as if it were solely for their use, despite multiple users sharing the resources. It discusses the quick job-switching mechanism that occurs during the time gaps when users are slower in providing inputs compared to the system's processing speed. The paragraph underscores the importance of CPU scheduling in time-shared systems, which allocates a small portion of system time to each user, and mentions that each user has at least one program, known as a process, waiting in memory. The summary concludes with a note on the significance of the term 'process' in operating systems and an anticipation of future lectures on CPU scheduling and processes.

Mindmap

Keywords

💡Operating System

An operating system is the core software that manages computer hardware, software resources, and provides essential services for computer programs. In the video's context, the operating system is the foundation for multiprogramming and multitasking, enabling the efficient use of system resources and facilitating user interaction.

💡Multiprogramming

Multiprogramming is the capability of an operating system to run multiple programs concurrently, improving CPU utilization. The script explains that without multiprogramming, a single user would keep the CPU or I/O devices busy at all times, whereas multiprogramming allows the CPU to execute different jobs when one job is waiting for I/O operations, thus avoiding idle time.

💡CPU Utilization

CPU Utilization refers to the percentage of time the CPU is actively executing processes compared to the total time. The video emphasizes the importance of multiprogramming in increasing CPU utilization by ensuring that the CPU always has a job to execute, thereby improving system efficiency.

💡Job Pool

A job pool is a collection of all the jobs that have entered the system and are waiting to be executed. The script uses the job pool to illustrate how jobs are organized in a multiprogramming environment, with only a subset of these jobs loaded into memory at any given time.

💡Memory Layout

Memory layout in the context of a multiprogramming system refers to how the system's memory is organized to accommodate multiple jobs. The script describes a scenario with a 512-megabyte RAM where only a few jobs from the job pool can be loaded into memory for execution.

💡Multitasking

Multitasking, also known as time-sharing, is a feature of an operating system that allows multiple tasks to run simultaneously, giving the illusion of parallel execution. The script explains that multitasking enables user interaction with each program while it is running, unlike multiprogramming which does not provide for user interaction.

💡Time Sharing

Time sharing is a system where the CPU switches rapidly between multiple jobs, allowing users to interact with the computer system as if they have exclusive use of the resources. The script describes how time sharing provides the illusion of simultaneous use of the system by multiple users, with each user feeling that the system belongs to them.

💡CPU Scheduling

CPU scheduling is the process of determining the order in which processes are executed by the CPU. The script mentions that time-sharing systems use CPU scheduling algorithms to allocate a small portion of the CPU time to each user, ensuring that all users get a fair share of the system's resources.

💡Process

A process is a program that is loaded into memory and is ready to be executed by the CPU. The script defines a process as a program in execution, emphasizing its importance in the context of operating systems, where each user has at least one separate program in memory waiting to be executed.

💡User Interaction

User interaction refers to the communication between the user and the system, allowing the user to input commands and receive outputs. The script highlights that multitasking or time-sharing systems provide direct communication between the user and the system, enabling users to interact with programs while they are running.

Highlights

Introduction to the operating system structure, focusing on multiprogramming and multitasking.

Differences in internal makeup of various operating systems like Windows and Ubuntu.

Common functionalities that every operating system must possess.

Definition and importance of multiprogramming in operating systems.

How multiprogramming increases CPU utilization by running multiple programs.

Explanation of job pool and memory layout in a multiprogramming system.

Concept of a job containing codes and data to be executed.

Limitations of memory and the selection of jobs to be loaded from the job pool.

Operating system's role in executing jobs by assigning CPU time.

Inefficiency of a system without multiprogramming, causing CPU idleness.

Efficiency of multiprogramming through job execution and CPU sharing.

Analogy of a lawyer managing multiple clients to explain multiprogramming.

Distinction between multiprogramming and time-sharing or multitasking systems.

Time-sharing system allowing user interaction with running programs.

The necessity of an interactive computer system for time-sharing.

Simultaneous sharing of the computer system among multiple users in time-sharing.

User perception of having exclusive access to the system in time-sharing.

CPU scheduling and its role in time-sharing systems.

Definition and importance of processes in operating systems.

Transcripts

play00:00

In the previous lectures we have studied about

play00:02

the basics of the operating system

play00:04

and we have seen about computer system organizations

play00:07

and computer system architecture.

play00:08

Now, as we have the idea of computer system organizations and architecture,

play00:13

We are now ready to talk about operating system structure.

play00:16

So, in this lecture we will study the operating system structure,

play00:20

and we will mainly talk about multiprogramming and multitasking.

play00:24

So, operating systems vary greatly in their makeup internally.

play00:29

So, we have different kinds of operating systems that we know already.

play00:32

like Windows, Ubuntu and so on.

play00:34

These operating systems vary in their makeup internally.

play00:37

Internally the way they are made may be so much different.

play00:40

But they also have so many common things between them.

play00:44

We will see about the common things that every operating system

play00:48

must be capable of doing.

play00:50

So, we will be talking about the commonalities.

play00:52

So, the first two things that every operating system

play00:55

must be capable of doing are

play00:57

multiprogramming and time sharing or multitasking.

play01:01

So, these are two very important topics

play01:03

which we will see in this lecture.

play01:05

So, first let's talk about multiprogramming,

play01:08

and then we will see multitasking, which is also known as time sharing.

play01:12

So, coming to multiprogramming, from the name itself

play01:15

we must have understood that

play01:17

Multiprogramming means the capability of running

play01:20

multiple programs by the CPU.

play01:23

Now, a single user cannot,

play01:25

in general, keep either the CPU

play01:28

or the I/O devices busy at all the time.

play01:31

Now, if you are not having multiprogramming,

play01:34

what happens is that,

play01:35

a single user will always keep the CPU or the I/O devices

play01:39

busy at all the times.

play01:41

That is because, when a single user wants to execute a particular task

play01:46

he will use the CPU, so until and unless the task is completed

play01:50

no other user can use the CPU or the I/O devices.

play01:54

because it is not capable of multiprogramming.

play01:57

But in multiprogramming what happens is that it increases the CPU utilization

play02:03

by organizing the jobs which are codes and data

play02:07

so that the CPU always has one to execute.

play02:10

That means in multiprogramming, we are trying to increase our CPU utilization,

play02:16

because the CPU is capable of executing multiple programs.

play02:19

So let's see how this works.

play02:21

In this diagram, we have the job pool

play02:24

and the memory layout of the multiprogramming system.

play02:27

So, first of all, let us understand what is a job.

play02:29

So, a job is something that has to be executed,

play02:32

which may contain codes and data.

play02:35

So, here we have a job pool that consists of all the jobs that entered the system.

play02:40

So, all the jobs that have to be executed are kept in a job pool like this.

play02:46

and then here we have the memory layout of a multiprogramming system.

play02:50

So, on top we have the operating system.

play02:52

And, these are the jobs that are loaded into the memory.

play02:55

So, we cannot load all the jobs of the job pool into the memory because

play03:00

we don't have unlimited memory.

play03:03

So, by memory I mean the main memory or the RAM.

play03:07

So, here in this example, we are having 512 mega bytes of RAM.

play03:12

So, you are not able to load all of these into the main memory.

play03:15

So, a subset of these jobs or some of these jobs are loaded into the memory.

play03:20

For example, we have loaded job one, two, three, and four into the memory.

play03:25

Now, the operating system has to help in executing these jobs

play03:28

by assigning the CPU to these particular jobs.

play03:32

So, if we don't have this multiprogramming

play03:34

what will happen is that,

play03:35

let's say 'Job 1' starts executing and it is using the CPU.

play03:40

Now, until 'Job 1' finishes its executions completely,

play03:44

the other jobs can not use the CPU.

play03:47

So, let's say that 'job 1' was using the CPU

play03:50

and then it has to use resources in the course of its execution.

play03:54

Let's say the I/O devices.

play03:55

Now, when 'Job 1' goes to use the I/O devices,

play03:59

the CPU is not used and it remains idle without being used by any other jobs.

play04:05

So, that is a very inefficient way.

play04:07

So, in multiprogramming, what happens is that,

play04:10

let's take the same example again.

play04:11

'Job1' starts executing and it is using the CPU.

play04:14

And, on the course of its execution,

play04:16

'job 1' tries to use the I/O devices.

play04:19

So, when it goes for using I/O devices or any other resources,

play04:23

the CPU is released from 'job 1'

play04:26

and then that CPU, instead of remaining idle,

play04:30

it can be used by another job, let' say 'jobs 2'

play04:33

So, 'Job 2' can use the CPU, until 'Job1' finishes its other I/O devices operations

play04:39

and wants the CPU back.

play04:40

So, 'job 2' will use the CPU.

play04:42

And, again if let's say 'job 2' wants to go for using some other resources

play04:46

and does not need the CPU at a particular time

play04:49

then instead of remaining idle, the CPU can be again used for 'Job 3' and so on.

play04:55

So, we can see that, the CPU does not remain idle.

play04:59

Whenever a particular job does not want to use the CPU,

play05:02

the CPU can be utilized by another job.

play05:05

So, this is a very efficient system or an efficient way of executing.

play05:10

So, that is what multiprogramming is.

play05:13

So, we see that, for an operating system to be efficient,

play05:16

it should be capable of this multiprogramming.

play05:19

So, we can also relate this multi programming with our day to day life.

play05:23

So, let's say that for an example, there is a lawyer

play05:25

who has different clients under him.

play05:27

Now, the lawyer is not taking care of only a single client at a particular time.

play05:32

let's say that, he is taking care of one client

play05:35

and when that client case is waiting to go on a trial,

play05:39

or when the lawyer is waiting for his paper work to be done,

play05:42

he does not simply keep waiting for the single client

play05:46

but at that same time, he can take care of another client that is under him.

play05:50

So, in that way he is utilizing his time and resources efficiently.

play05:55

So, that is what we do in multiprogramming.

play05:58

We are trying to utilize our CPU efficiently.

play06:01

Now, a multiprogrammed system provides an environment in which

play06:05

the various system resources like CPU, memory, and peripheral devices

play06:11

are used effectively, but they do not provide for user interaction

play06:17

with the computer system.

play06:18

So, the multiprogramming system

play06:20

makes sure that all our resources are used effectively,

play06:24

but it does not provide the user interaction with the computer system.

play06:29

So, that brings us to the next topic, that is multitasking or time sharing system.

play06:35

So, now let's see what is this time sharing or multi tasking system.

play06:38

And, let us see how it is different from the multiprogramming system.

play06:42

So, first of all, the CPU executes multiple jobs

play06:46

by switching among them.

play06:48

Now, this is almost same like the multiprogramming system.

play06:50

The first point says that, the CPU execute multiple jobs.

play06:54

We have multiple jobs, as we saw above.

play06:57

And then, instead of executing only a single job at a time,

play07:01

what the CPU does is

play07:03

it switches between the jobs.

play07:05

And then, the switching occurs so frequently that

play07:09

the user can interact with

play07:10

each program while it is running.

play07:12

Now, the switching happens so quickly that

play07:17

the user can interact with the program while it is running.

play07:21

So, this was something that was not there in multiprogramming.

play07:25

Here the user can actually interact with the program

play07:29

even while it is running.

play07:30

Because the switching between jobs takes places

play07:33

very fast in this time sharing system.

play07:35

This timesharing requires interactive and hands-on computer system,

play07:40

which provides direct communication between the user and the system.

play07:44

So, this was something that was not there in the multiprogramming system.

play07:47

That was the last point that we discussed.

play07:50

But in this time sharing system, there is a direct communication between

play07:54

the user and the system.

play07:56

And, in this time sharing system as the name suggests

play07:59

a time-shared operating system allows

play08:02

many users to share the computer simultaneously.

play08:05

So, the computer system is shared among many users

play08:09

simultaneously in this time sharing system.

play08:12

So, let's see how this works.

play08:13

So, in order to elaborate this point let us take an example.

play08:16

Let's say we have a time shared system over here.

play08:19

And there are four users sharing this system.

play08:22

User one, two, three, and four.

play08:24

They are sharing this time shared system.

play08:27

Now, in this time sharing system,

play08:29

the switching between the jobs of the users takes place so quickly that

play08:34

the users themselves do not even realize that they are sharing the system.

play08:39

They feel that the entire system belongs to just that person.

play08:43

So, 'user 1' thinks that the entire system belongs to me.

play08:47

And, user two, three, four, they all think the same.

play08:50

Because the switching between the jobs takes place so quickly that

play08:53

they don't even realize that

play08:54

there is a time sharing, or multitasking is happening in this system.

play08:58

Now, let's say that 'User 1' is using the time shared system,

play09:02

and there is a certain job that he wants to execute.

play09:05

So, the job is being executed by the time shared system.

play09:09

And then the execution of the job takes place in CPU speed.

play09:13

And, we know that CPU speed is very high.

play09:16

So, the execution of the job takes place in CPU speed.

play09:19

And, let's say that after execution

play09:21

the user has to be shown some output,

play09:24

And then the user has to give some input again to the system.

play09:27

So, after the execution of the job

play09:30

the output is shown to the 'User1'

play09:32

And, 'user 1' wants to give some other input to the system,

play09:36

that means he is interacting with the system.

play09:38

Now the interaction between the user and the system

play09:42

takes place in user's speed or people's speed.

play09:45

that means it is taking place in human speed.

play09:47

So, we know that CPU's speed is so much higher than a human speed.

play09:51

So, when he gives an input to the system, he is giving in the normal human speed.

play09:56

So, that time gap is itself is so big for the system that we have.

play10:00

Because systems are very fast.

play10:02

So, while he is giving input to the system, in the time gap

play10:06

the CPU can be used by 'user 2' for executing the job.

play10:12

So, in that way we see that,

play10:14

there is a time gap between the user and the system,

play10:17

because users are usually slower than the system.

play10:20

So, in that time gap,

play10:21

the switching of the jobs takes place so quickly,

play10:24

and it is so quick and so frequent that

play10:26

the user does not even realize that they are using a time shared system.

play10:31

They just feel like that the entire system belongs to themselves.

play10:34

So, the time shared system uses CPU scheduling and multiprogramming

play10:39

to provide each user with a small portion of time shared computer.

play10:44

So, as I told you,

play10:45

a small portion of the time shared system is provided to each of the user.

play10:51

But the user thinks that the entire system belongs to him.

play10:55

How this time will be shared among the users

play10:58

that will be decided using CPU scheduling algorithms,

play11:01

which we will discuss in detail in the coming lectures.

play11:04

So, this is a very important topic CPU scheduling,

play11:07

which we will discuss later on.

play11:08

And, then each user has at least one separate program in memory.

play11:13

So, all of these users, they at least have one of the programs

play11:17

waiting in memory to be executed.

play11:19

And then, a program loaded into the memory

play11:22

and executing is called a process.

play11:25

Now, as I told you

play11:26

each of this user have programs stored in memory

play11:30

which are waiting to be executed

play11:32

and when a particular program is loaded into the memory

play11:36

and when it is executing

play11:38

that program is known as a process.

play11:41

Now, this is a very important term

play11:43

as far as the subject operating system is concerned.

play11:45

'Process', so keep this word in mind.

play11:48

And we will be discussing this in later and in more detail in the coming lectures.

play11:52

So, for now this is all we have discussed,

play11:56

about multiprogramming and multitasking or time shared systems.

play12:01

So, I hope this was clear to you.

play12:03

Thank you for watching and see you in the next one.

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
Operating SystemsMultiprogrammingMultitaskingCPU UtilizationSystem ArchitectureTime SharingEfficiencyOS StructureUser InteractionProcess Management
Benötigen Sie eine Zusammenfassung auf Englisch?