Basics of OS (Computer System Operation)
Summary
TLDRThis lecture delves into the foundational concepts of computer systems, essential for understanding operating systems. It explains the structure of modern computers, highlighting the role of CPUs, device controllers, and shared memory, all interconnected through a common bus. The Bootstrap Program initiates system startup by loading the OS from ROM, while interrupts and system calls allow for task prioritization and execution. The lecture also touches on the CPU's response to interrupts, emphasizing the seamless multitasking capabilities of computer systems.
Takeaways
- 📚 The lecture introduces the basic concepts of computer system operations as a foundation for understanding operating systems.
- 🧠 The CPU, considered the brain of the computer, is responsible for all computations, processing, and calculations.
- 🖥️ A computer system may consist of one or more CPUs, device controllers, and is connected through a common bus to shared memory.
- 🔌 Device controllers manage the operation of specific hardware devices like disks, keyboards, and printers, all connected via a common bus.
- 💾 The Bootstrap Program is the initial program executed when a computer is powered up or rebooted, stored in ROM and responsible for loading the OS.
- 📍 The Bootstrap Program must know the location of the operating system in secondary memory and load the OS kernel into main memory.
- 🚨 An Interrupt is a signal from hardware or software that interrupts the CPU's current task, requiring it to execute a higher priority task.
- 🔄 When an interrupt occurs, the CPU stops its current work and transfers execution to a fixed location, known as the Interrupt Service Routine (ISR).
- 🛠️ The Interrupt Service Routine is a predefined set of instructions that the CPU executes in response to an interrupt before resuming its original task.
- 🔗 A System Call, also known as a Monitor Call, is a software-triggered interrupt used to request a service from the operating system.
- 🔍 The lecture emphasizes the importance of understanding computer system structure and operations as a prerequisite for delving into operating system details.
Q & A
What is the purpose of studying the computer system operations before diving into the details of the operating system?
-Studying the computer system operations provides a foundational understanding of the structure of a computer system, which is essential for grasping how the operating system works effectively.
What does the term 'CPU' stand for and why is it considered the brain of the computer system?
-CPU stands for Central Processing Unit. It is considered the brain of the computer system because it is the main processing unit where all computations, processing, and calculations take place.
Can you explain the role of a device controller in a computer system?
-A device controller is responsible for managing the operation of a specific type of device, such as a disk controller for a hard disk or a USB controller for USB devices. It ensures that the devices work correctly and communicate effectively with the CPU and memory.
What is the significance of a common bus in connecting various components of a computer system?
-The common bus is significant as it provides a pathway for all components, including the CPU and device controllers, to access the shared memory. It facilitates communication and data transfer among the system's components.
How does the Bootstrap Program function when a computer is powered up or rebooted?
-The Bootstrap Program is the initial program that runs when a computer is powered up or rebooted. It is stored in ROM and is responsible for loading the operating system into the main memory, specifically the OS kernel, to start executing the system.
What is the role of the memory controller in a computer system?
-The memory controller ensures orderly access to the shared memory by synchronizing the access of various devices and the CPU. It manages the allocation of memory resources to prevent conflicts and ensure smooth operation.
What is an Interrupt in the context of computer systems?
-An Interrupt is a signal sent by hardware or software to the CPU, indicating that it needs to pause its current task and execute a different task that has been signaled as more important or urgent.
How does a System Call differ from a hardware-triggered interrupt?
-A System Call, also known as a Monitor Call, is a software-triggered interrupt. It is a special operation executed by software to request a service from the operating system, whereas a hardware-triggered interrupt is initiated by hardware components.
What happens when the CPU receives an interrupt?
-When the CPU receives an interrupt, it stops its current work and immediately transfers execution to a fixed location, which is the starting address of the Interrupt Service Routine (ISR). After the ISR executes, the CPU resumes the interrupted computation.
What is the purpose of an Interrupt Service Routine (ISR)?
-The purpose of an ISR is to define the actions that need to be taken in response to an interrupt. It contains the code that the CPU should execute when an interrupt occurs, ensuring that the interrupt is handled appropriately.
Why is it important to understand the basic structure and operations of a computer system before studying the operating system?
-Understanding the basic structure and operations of a computer system is important because it provides the necessary context and foundational knowledge to comprehend the more complex functions and mechanisms of an operating system.
Outlines
📚 Introduction to Computer System Structure
This paragraph introduces the foundation of computer system operations as a prerequisite for understanding operating systems. It emphasizes the importance of knowing the computer system's structure to grasp how the operating system functions. The lecturer explains the components of a modern general-purpose computer system, including CPUs, device controllers, and the shared memory accessed through a common bus. A CPU is described as the brain of the computer, responsible for all computations, while device controllers manage the operation of peripheral devices. The paragraph also provides a basic overview of computer organization and architecture, setting the stage for a deeper dive into operating systems.
🔌 The Role of Device Controllers and Memory Management
This section delves into the specifics of how device controllers manage different hardware components in a computer system and how they compete for memory cycles. It explains the concept of concurrent execution, where multiple devices can operate at the same time without causing lag, highlighting the system's power and efficiency. The paragraph introduces the memory controller's role in synchronizing access to the main memory, ensuring that all devices and the CPU get the necessary memory allocation for smooth operation. Additionally, it introduces the Bootstrap Program, the first program executed when a computer starts up, stored in ROM, and responsible for loading the operating system.
🛠️ Understanding Bootstrap Programs and Interrupts
The paragraph discusses the features and functions of the Bootstrap program, which is stored in ROM and is crucial for loading the operating system into the main memory when the computer is powered on. It then transitions to the concept of interrupts, which are signals from hardware or software that cause the CPU to pause its current task and execute a higher-priority task. The paragraph explains how hardware can send interrupt signals to the CPU via the system bus and how software can trigger interrupts through system calls or monitor calls. The CPU's response to interrupts is also outlined, detailing the immediate transfer of execution to a fixed location when an interrupt occurs.
🚀 CPU's Response to Interrupts and Service Routines
This final paragraph focuses on the CPU's response to interrupts and the execution of service routines. When an interrupt occurs, the CPU halts its current operations and transfers execution to a fixed location, which is the starting address of the Interrupt Service Routine (ISR). The ISR is where the actions required by the interrupt are defined and executed. Once the ISR completes its task, the CPU resumes its previous computation, effectively handling the interrupt. This paragraph wraps up the basic introduction to computer system operations, setting the stage for further exploration of storage structures and memory in upcoming lectures.
Mindmap
Keywords
💡Operating System
💡CPU (Central Processing Unit)
💡Device Controllers
💡Common Bus
💡Shared Memory
💡Bootstrap Program
💡Interrupt
💡System Call
💡Service Routine
💡Memory Controller
Highlights
Introduction to the operating system and its functions.
Explanation of basic concepts before delving into the operating system.
Overview of computer system operations and structure.
Importance of understanding computer system structure for grasping OS concepts.
Modern general-purpose computer systems consist of one or more CPUs.
Definition and role of the CPU as the brain of the computer system.
Explanation of device controllers and their connection through a common bus.
Discussion on how device controllers manage specific hardware like disks, USB devices, and monitors.
Introduction to the concept of concurrent execution by CPUs and device controllers.
Role of the memory controller in synchronizing access to shared memory.
Explanation of the Bootstrap program and its function during system startup.
Introduction to interrupts and how hardware and software trigger them.
Difference between hardware interrupts and software interrupts (system calls).
Process of how the CPU responds to interrupts and executes interrupt service routines.
Preview of the next lecture on storage structure and memory.
Transcripts
In the last lecture, we have started studying about the operating system.
and we also saw the introduction of the operating system.
We saw what an operating system really is.
What it really does,
and we have also seen the functions of the operating system.
We have also seen some basic examples of the operating system.
Now, In this lecture,
we will see some of the basic concepts that you need to know,
before we really go into the details of the operating system.
So, in this lecture we will mainly study about
computer system operations.
So, basically it is about the structure of computer system.
Now, why I am doing this is because,
some basic knowledge of the structure of the computer system
is required to understand, how the operating system works.
So, by studying about the structure of the computer system,
It will provide you a base for an understanding of the operating system.
So, instead of directly diving into how the operating system works,
we should have a base about this
so, it will help us to understand
in a clearer way about the operating system.
After studying this, you will study every concept of the operating system.
You will not feel completely blank
and you will have a proper idea of why
we are doing this and why certain things are working in that way.
Not only that,
while having a basic introduction to this structure of computer system,
you are getting a basic introduction to
computer organization and architecture,
which is an important course
as far as Computer Science and Electronics is concerned.
Alright!
So, Now let us see what we can study
from this computer system operation in this lecture.
So, here it says,
a modern general purpose computer system
consists of one or more CPUs,
and a number of device controllers
connected through a common bus, that provides access to the shared memory.
So don't worry about this definition,
It will become clear as I show you a diagram related to this
and we will see what this actually means.
So,here I have a diagram, which we can use
to explain these sentences written here.
So, let us break the sentence into parts to see what each line means.
A modern general purpose computer system
consists of one or more CPUs.
Now, what do we mean by this?
A modern general purpose computer,
it consists of one or more central processing units.
Now, What is a CPU?
CPU is the main part,
we can call it the brain of the computer system.
It is the processing unit.
that is where all the computations, processing and calculations
take place in a computer.
Now, when we mostly talk about CPU what comes to our mind
Usually as a novice
what comes to our mind is the big box beside your desktop that you have.
and that is what we generally think a CPU is.
We just look at it and call it as the CPU.
But that box is not just a CPU,
that box consists of many things like motherboard,
CD ROM, USB ports, many things are there.
But, CPU is just a small chip that is there,
embedded into the Mother Board.
and that small chip is responsible for
performing all the computation and calculations
and that is your actual CPU.
So the box, you can just called it a cabinet
but the CPU is just a small unit that is present
inside that box, which is there in your motherboard.
Alright!
Then the modern computer system,
may have one or more CPUs
depending on the processing power of your computer.
so, that is the meaning of the first line.
A number of device controllers are connected through a common bus
that provides access to the shared memory.
So, here if you look into this diagram
we have some hard wares like
Disk, which can be hard-disk or anything like that,
and then we have some more hardwares like
Mouse, Keyboard, Printer
Then you have your monitor over here.
It is not limited to this, but this is just an example I am showing you.
And then each of these hard wares and devices
is connected to a controller.
This controller is responsible for
the way these devices work.
So, here, for example we have the disk
which is connected by the disk controller.
and then these devices like Mouse, Keyboard, Printer,
assuming that they are all USB devices
are connected to the USB controller.
Because these are connected to the USB ports
and USB Controller would take care of how these devices perform.
And then you have your monitor,
that is your display, and that is connected to a video adapter.
These adapter or controller are responsible or they are in charge of
how these devices actually work.
And then the CPU, we have it here,The Central Processing Unit,
along with these controllers
are connected by a common bus,
that we have here.
This line over here, represent the common bus.
This one is which we talked about
And we see that they are all connected to this bus, it is common to all of them
and that bus is connected to a shared memory.
Alright!
Let's see this in more detail.
So, here I have some points written down.
Each device controller is in charge of a specific type of device.
So, here we have device controllers,
and each of these controllers or adapters
are in control of some specific kind of device, as it is shown here.
and then the CPU and device controllers
can execute concurrently competing for the memory cycle.
Now, what do we mean by this line?
So,we see that they are all connected to a memory controller over here.
And why is that?
That is because
I already taught you in the first lecture that
Whenever something has to be executed or loaded,
It has to be loaded into your main memory.
Your main memory is your RAM,
Random Access memory that you have
and don't worry if you don't know about it in detail.
I will do another lecture, explaining about
the storage and memory unit, that we have.
So, just know that whenever something has to be executed,
it has to be loaded into your main memory.
And your main memory is not unlimited or infinite but it is limited.
It is a finite amount of memory that you have.
like in your laptops or in your desktops
you may have two GB of RAM,
or eight GB of RAM so on and so forth.
So, depending on the size of the RAM,
that is the amount of memory or main memory that you have.
And whenever you execute something,
that has to be loaded into your main memory.
Now, We see that
All these devices in order to work they need to be loaded into the main memory
for any execution that has to be performed.
and then the disk controllers or the adapters will take care of these.
and this has to be loaded into the main memory.
We see here that all these device controllers along with the CPU
can execute concurrently.
Now, what do we mean by concurrently,
concurrently means that
all these devices or controllers can execute at the same time.
Now, let's take an example
Suppose you are watching something like a video or a movie on your monitor,
and at the same time you can minimize
and type something using your keyboard in Microsoft Word.
Now, when you do this you don't experience lag.
You never experience lag like
when you are typing something your video gets paused or like that
Why?
Because they are all working concurrently, working at the same time.
That is how powerful your system is,
and that is why you have to appreciate the beauty and power of your system.
In order to make all these work seamlessly
Without any lag or any problems, what do we need?
To ensure orderly access to the shared memory,
a memory controller is provided.
whose function is to synchronize access to memory.
So, as I Have already told you,
all these devices they need access to the memory.
Because they all have to be loaded into the memory in order to work.
And now we need to ensure that,
all of these devices get their required share of memory
So that they can be loaded correctly and executed in the right way
without having any problem for the user.
So what we have is the memory controller.
So, we have a memory controller here,
which ensures that every controller and every device
gets the proper access
to the memory that they need so that they can perform or work
smoothly without having any problem.
So, the memory controller synchronizes everything
and makes everything works in a very smooth way.
So, that is what we can understand by this diagram.
And from this diagram, we can understand the basic structure of
how things are arranged.
So, first, we have the CPU,
then the CPU along with the disk controllers
which is responsible for the working of each device.
Like I have shown here they are all connected by a common bus.
This line represents the common bus
and that is connected to the memory controller, which takes care of
how the memory has to be shared between each device
so that its working is proper and smooth.
Alright!
Now, I want to introduce some important terms to you.
You have already seen the structure of the computer system.
Just the basic structure of using that diagram.
Now, I Want you to know these terms, which we are going to study here right now
The first one is known as The Bootstrap Program.
So, What is a Bootstrap Program?
The initial program that runs
when a computer is powered up
or rebooted is known as the Bootstrap Program.
So, a Bootstrap Program,
is the first program that is executed
or runs when you power up or reboot your computer system.
So, when you go and press the power button of your computer,
the first program that loads,
that helps in powering up the system is known as the Bootstrap program.
Now, let's see what are the features and functions of this Bootstrap program.
So, the bootstrap Program is stored in the ROM.
ROM stands for Read Only Memory,
which is a kind of secondary memory.
So, your Bootstrap program is stored in the ROM
and then it must know how to load the OS and start executing the system.
So, as I told you Bootstrap is the first program that loads
when you power on your system.
and that program
must load your operating system.
The Operating system is the interface between you and the physical hardware.
So, Your Operating system is also a software.
It is kind of a system software.
So, that Operating system is already residing or stored
somewhere in your secondary memory.
And then the bootstrap program must know
how to load that operating system and start it for you.
Also I told you that
Operating system is stored somewhere in the secondary memory.
So, the Bootstrap program must know
where your operating system is stored.
And It must go there and invoke the operating system
and It must load the OS kernel into your main memory.
It must locate and load the OS kernel into memory.
Now, what do you mean by kernel?
The Kernel is like the heart of the OS,
is the main part of the Operating system.
So, that has to be loaded into your memory.
And then the Bootstrap program,
when you switch on your computer, it is the first program that runs.
And it goes and finds the Operating system,
and then the kernel of the operating system
takes it and loads it into the memory
so that the operating system will come live
and after that the rest of the thing the operating system will take care of.
So, that was about the Bootstrap program.
Now, the next thing that
I want to introduce to you is known as an Interrupt.
So, let's see what an interrupt is.
So, what comes to your mind when you hear the word interrupt.
So in English, we know what is an interrupt.
When you are doing something if someone comes and disturbs you,
If someone comes and says
"Please stop doing this work and do something else"
that is an interrupt, we are interrupted.
So, think of it in the same context,
this is almost the same even for the case of the computer system.
let's see how we can define this and what it actually is?
So, the occurrence of an event
is usually signaled by an interrupt.
from the hardware or the software
So, we know that the CPU is always working
It is doing some work,
and when the CPU is doing that work,
sometimes the hardware or software, may interrupt the CPU.
It may come and tell the CPU
"Wait! just wait with whatever you are doing,
and please execute this task that I am giving you, this is more important".
So, the CPU has to stop and it has to execute the task that comes up.
and that is known as an interrupt.
So, the hardware may trigger an interrupt at any time
by sending a signal to the CPU.
usually by the system bus.
We have different hardware in our system
and the hardware can trigger an interrupt.
and how does he do that?
It sends a signal to the CPU.
and how can he send a signal to the CPU?
by the way of the system bus
I showed you in the previous diagram what I mean by the system bus.
So, here this line, which represents the common bus we have.
Similarly, using a system bus
the hardware can send the interrupt to the CPU,
and the CPU has to stop whatever it's doing and has to execute the interrupt.
So, we will see how the CPU responds to the interrupts later.
So, let's understand what is mean by interrupt.
Now, the next term I want to introduce to you is System Call.
also known as the Monitor call.
Let's see what it says.
A software may trigger an interrupt
by executing a special operation called as system call.
Now, as I told you,
when a hardware triggers an interrupt we usually called it as an interrupt,
but if the software is causing the interrupt,
then that is known as a system call or a monitor call.
So, if it is hardware, we usually called it as an interrupt.
If it is a triggered by a software, it is called as a system call or monitor call.
So, I hope that made clear to you what an interrupt actually means.
now let us see how does the CPU respond when it receives an interrupt.
So, here it says
when the CPU is interrupted
it stops the work, it is doing
and immediately transfers execution to a fixed location.
So, I already told you how interrupt can arise, either from hardware or software.
So, the CPU is already doing some work,
and then immediately it gets an interrupt
from either a hardware or a software,
So, when the CPU is interrupted in that way, what does it do?
It stops what it is doing,
and then immediately transfers the execution to a fixed location.
So, whatever the execution the CPU was doing, it just stopped it
and transferred its execution to a fixed location.
Now, what is the fixed location that we are talking about?
The fixed location usually contains the starting address,
where the service routine of the interrupt is located.
Now, we have a new term here which is Service Routine.
Now, what is a Service Routine?
Service Routine is nothing but where
what the interrupt actually wants to do is written.
So, let's not go into the technical details,
I will just tell you basically what it means.
When an interrupt arises,
there is something that the interrupt wants to do.
Something it wants to execute,
So, what has to be executed or what the interrupts want to do,
is written in the Service routine.
So, every interrupt has its Service routine
known as the Interrupt Service Routine, So, every interrupt has its Service routine
known as the Interrupt Service Routine,
Sometime it is known as I.S.R.
So when the CPU is interrupted,
It stops what it is doing,
and it immediately transfers its execution
to the starting address of the interrupt service routine.
So, interrupt service routine may be located somewhere
and it has a starting address, from where it should start its execution.
So, the CPU stops what it was doing,
and transfers its execution
to the starting address of the interrupt service routine.
So, that is the first thing the CPU does when it is interrupted.
and then what happens!
The interrupt service routine executes.
So, whatever is written in the interrupt service routine
gets executed completely,
And then on completion, the CPU resumes the interrupted computation.
So, we know that the C.P.U was already doing something before
So, when the interrupt arise,
It transfers its execution to the interrupt service routine.
then it executes it and when it is done the CPU can go back to where it came from.
and it resumes whatever it was doing.
So, this is how the CPU responds to an interrupt.
And I hope that made it clear to you, how an interrupt is handled by a CPU.
At least the basics!
So, this was just a basic introduction to the computer system's operation.
I will not go into great detail,
because it is just the basics that you need to know
before you really understand the details of the operating system.
So, I hope this was clear to you.
In the next lecture, we will see
about the storage structure and memory,
which is also an important topic, that you need to know
for understanding the Operating system.
So, thank you for watching this!
and see you in the next one.
5.0 / 5 (0 votes)