00:00:00
in the last lecture we have started
00:00:01
studying about operating system and we
00:00:04
also saw the introduction of operating
00:00:06
system we saw what an operating system
00:00:09
really is what it really does and we
00:00:12
have also seen the functions of
00:00:13
operating systems and we have also seen
00:00:16
some basic examples of operating system
00:00:19
now in this lecture we will be seeing
00:00:22
some of the basic concepts that you need
00:00:24
to know before we really go into the
00:00:27
details of operating system so in this
00:00:29
lecture we will be mainly studying about
00:00:31
computer system operations so basically
00:00:34
it is about the structure of computer
00:00:36
system now why I am doing this is
00:00:38
because some basic knowledge of the
00:00:41
structure of computer system is required
00:00:43
to understand how operating systems work
00:00:46
so by studying about this structure of
00:00:49
computer system this will provide you a
00:00:52
base for understanding operating system
00:00:55
so instead of directly diving into how
00:00:57
operating system works we should have a
00:00:59
base about this so that it will help us
00:01:01
to understand in a clearer way about
00:01:04
operating system so after studying this
00:01:06
when you study each and every concepts
00:01:08
of operating systems you will not feel
00:01:11
completely blank but you will have a
00:01:13
proper idea of why we are doing this or
00:01:16
why certain things working in that way
00:01:19
and not only that by having a basic
00:01:21
introduction to this structure of
00:01:23
computer system you are getting a basic
00:01:25
introduction to computer organization
00:01:28
and architecture which is is an
00:01:30
important course as far as computer
00:01:32
science and electronics is concerned all
00:01:35
right so now let us see what we can
00:01:37
study from this computer system
00:01:39
operation in this lecture so here it
00:01:42
says a modern general purpose computer
00:01:45
system consists of one or more CPUs and
00:01:49
a number of device controllers connected
00:01:52
through a common bus that provides
00:01:54
access to Shared memory so don't worry
00:01:57
about this definition it will become
00:01:59
clear I show you a diagram related to
00:02:01
this and we will see what this actually
00:02:04
means so here I have a diagram which we
00:02:06
can use to explain this sentence that is
00:02:09
written here so let us break the
00:02:10
sentence into parts and see what each
00:02:13
lines mean a modern general purpose
00:02:16
computer system consists of one or more
00:02:19
CPUs now what do we mean by this a
00:02:22
modern general purpose computer it
00:02:24
consists of one or more central
00:02:26
processing units now what is a CPU CPU
00:02:30
is the main part or the it's we can call
00:02:33
it the brain of the computer system it
00:02:35
is the processing unit that is where all
00:02:38
the computations and processing and
00:02:40
calculations take place in the computer
00:02:43
now when we mostly talk about CPU what
00:02:46
comes to our mind usually as an novice
00:02:48
what comes to our mind is that big box
00:02:50
beside your desktop that you have and
00:02:53
that is what we generally think a CPU is
00:02:56
we just look at it and we call it that
00:02:57
this is the CPU but that box just not
00:03:00
just the CPU that box consists of many
00:03:02
things like your motherboard your CD
00:03:05
roome your USB ports many things are
00:03:08
there but CPU is just a small chip that
00:03:11
is there embedded into your motherboard
00:03:14
and that small chip is responsible for
00:03:17
performing all the computations and
00:03:19
calculations and that is your actual CPU
00:03:23
so that box itself you can just call it
00:03:25
a cabinet but the CPU is just a small
00:03:28
unit that is present in inside that box
00:03:30
which is there in your motherboard all
00:03:32
right and then the modern computer
00:03:34
systems it may have one or more CPUs
00:03:37
depending on the processing power of
00:03:39
your computer so that is the meaning of
00:03:41
the first line and a number of device
00:03:44
controllers connected through a common
00:03:47
bus that provides access to Shared
00:03:49
memory so here if you look in this
00:03:51
diagram we have some Hardwares like your
00:03:54
dis which may be your hard dis or
00:03:56
anything like that and then we have some
00:03:58
more Hardwares here like your Mouse
00:04:00
keyboards printers and then you have
00:04:02
your monitors over here so it is not
00:04:04
limited to this but this is just an
00:04:06
example I'm showing you and then each of
00:04:08
these Hardwares or devices are connected
00:04:11
to a controller and this controller is
00:04:14
responsible for the way these devices
00:04:17
work so here for example we have the
00:04:19
disk which is connected via the disk
00:04:22
controller and then these devices here
00:04:24
like your mouse keyboard and printers
00:04:26
assuming that they are all USB devices
00:04:29
they are connected to the USB controller
00:04:32
because these are connected to the USB
00:04:34
ports and the USB controllers will take
00:04:36
care of how these devices perform and
00:04:38
then you have your monitor that is your
00:04:40
display and that is connected to a video
00:04:44
adapter and these adapters or
00:04:46
controllers are responsible or they are
00:04:49
in charge of how these devices actually
00:04:52
work and then the CPU we have it here
00:04:55
the central processing unit along with
00:04:58
these controllers are are connected via
00:05:01
a common bus that we have here this line
00:05:05
over here it represents the common bus
00:05:08
this one which we talked about and we
00:05:10
see that they are all connected to this
00:05:12
bus it is common to all of them and that
00:05:15
bus is connected to a shared memory all
00:05:18
right let us see about this in more
00:05:19
detail so here I have some points
00:05:21
written down each device controller is
00:05:23
in charge of a specific type of device
00:05:25
so here we have device controllers and
00:05:28
each of these controllers adapters they
00:05:31
are in control of a specific kind of
00:05:33
device as it is shown here and then the
00:05:36
CPU and the device controllers can
00:05:39
execute concurrently competing for
00:05:41
memory Cycles now what do we mean by
00:05:44
this line so we see that they are all
00:05:46
connected to a memory controller over
00:05:48
here and why is that that is because I
00:05:51
already taught you in the first lecture
00:05:53
that whenever something has to be
00:05:55
executed or whenever something has to be
00:05:57
loaded it has to be loaded into to your
00:06:00
main memory your main memory is like
00:06:02
your RAM Random Access Memory that you
00:06:05
have and don't worry if you don't know
00:06:06
about it in detail I will do another
00:06:09
lecture where I will be explaining about
00:06:10
the storage and memory that we have so
00:06:13
just know that whenever something has to
00:06:16
be executed it has to be loaded into
00:06:18
your main memory and your main memory is
00:06:21
not unlimited or infinite but it is
00:06:23
limited it is a finite amount of memory
00:06:26
that you have like in your laptops or in
00:06:29
your desk Toops you may have 2 GB of RAM
00:06:31
or 8 GB of RAM so on and so forth so
00:06:34
depending on the size of your RAM that
00:06:36
is the amount of memory or the main
00:06:38
memory that you have and whenever you
00:06:40
execute something that has to be loaded
00:06:42
into your main memory and now we see
00:06:45
that all these devices in order to work
00:06:47
they need to be loaded into the main
00:06:49
memory for any execution that has to be
00:06:52
performed and then the dis controllers
00:06:55
or the adapters are taking care of this
00:06:57
and this has to be Lo loaded into the
00:07:00
main memory and we see here that all
00:07:02
these device controllers along with the
00:07:04
CPU can execute concurrently now what do
00:07:07
we mean by concurrently concurrently
00:07:09
means that all these devices or
00:07:12
controllers can execute all at the same
00:07:15
time now let's take an example suppose
00:07:18
you are watching something like let's
00:07:20
say a video or a movie in your monitor
00:07:23
and at the same time you can minimize
00:07:25
and type something using your keyboard
00:07:26
onto your Microsoft Word now when you do
00:07:29
this is you don't experience a lag you
00:07:31
never experience a lag like when you are
00:07:33
typing something your video get paused
00:07:35
or something like that you never
00:07:36
experience why because they are all
00:07:39
working concurrently they are all
00:07:40
working at the same time that is how
00:07:42
powerful your system is and that is
00:07:44
where you have to appreciate the beauty
00:07:46
and power of your system now in order to
00:07:49
make all this work seamlessly without
00:07:52
having any lag or having any problems
00:07:54
what do we need to ensure orderly access
00:07:57
to the shared memory memory controller
00:08:00
is provided whose function is to
00:08:02
synchronize access to memory so as I
00:08:05
already told you all these devices they
00:08:08
need access to the memory because they
00:08:10
all have to be loaded to the memory in
00:08:12
order to work and now we need to ensure
00:08:15
that all of these devices gets their
00:08:18
required share of memory so that they
00:08:21
can be loaded correctly and they can be
00:08:23
executed in the right way without having
00:08:26
any problem for the user so what we have
00:08:29
is a memory controller so we have a
00:08:31
memory controller here which ensures
00:08:34
that every controller or every other
00:08:36
controller or devices gets the proper
00:08:39
access to the memory that they need so
00:08:41
that they can perform or work smoothly
00:08:44
without having any problems so the
00:08:46
memory controller synchronizes
00:08:47
everything and makes everything work in
00:08:49
a very smooth way so that is what we can
00:08:52
understand by this diagram and from this
00:08:54
diagram we can understand the basic
00:08:56
structure of how things are arranged so
00:08:58
first we have have the CPU and then the
00:09:00
CPU along with the disc controllers
00:09:03
which are responsible for the working of
00:09:05
each and every devices like I have shown
00:09:08
here they are all connected via a common
00:09:11
bus this line represents the common bus
00:09:13
and that is connected to the memory
00:09:16
controller which takes care of how the
00:09:18
memory has to be shared between each and
00:09:20
every devices so that it's working is
00:09:23
proper and smooth all right now I want
00:09:26
to introduce some important terms to you
00:09:28
you have already seen the structure of a
00:09:30
computer system just the basic structure
00:09:32
using that diagram and now I want you to
00:09:35
know these terms which we are going to
00:09:37
study here right now the first one is
00:09:39
known as a bootstrap program so what is
00:09:41
a bootstrap program the initial program
00:09:43
that runs when a computer is powered up
00:09:46
or rebooted is known as the bootstrap
00:09:48
program so bootstrap program it is the
00:09:51
first program that is executed or that
00:09:54
runs when you power up or reboot your
00:09:58
computer system
00:09:59
so when you go and press the power
00:10:01
button of your computer the first
00:10:03
program that loads that helps in
00:10:06
powering up the system is known as the
00:10:08
bootstrap program now let us see what
00:10:10
are the features of this bootstrap
00:10:11
program and what are its functions so
00:10:13
the bootstrap program it is stored in
00:10:15
the Rome Rome stands for readon memory
00:10:18
which is a kind of secondary memory so
00:10:21
your bootstrap program is stored in your
00:10:23
Rome and then it must know how to load
00:10:26
the OS and start executing that system
00:10:29
system so as I told you bootstrap is the
00:10:32
first program that loads when you power
00:10:34
on your system and that program what is
00:10:37
its function it must load your operating
00:10:40
system your operating system is the
00:10:42
interface between you and the physical
00:10:44
Hardware so your operating system also
00:10:47
is a software it is kind of a system
00:10:49
software so that operating system it is
00:10:52
already residing or it is stored
00:10:55
somewhere in your secondary memory and
00:10:57
then the bootstrap program must know how
00:11:00
to load that operating system and start
00:11:03
it for you and also I told you that
00:11:06
operating system is stored somewhere in
00:11:07
the secondary memory so the bootstrap
00:11:10
program must know where your operating
00:11:12
system is stored and it must go there
00:11:15
and it must invoke the operating system
00:11:17
and it must load the OS kernel into your
00:11:21
main memory it must locate and load into
00:11:24
memory the OS kernel now what do we mean
00:11:27
by kernel kernel is like the heart of
00:11:29
the OS it is the main part of the
00:11:32
operating system so that has to be
00:11:34
loaded into your memory and then the
00:11:36
bootst program as you switch on your
00:11:38
computer it is the first program that is
00:11:41
run and it goes and finds where is your
00:11:44
operating system and then the kernel of
00:11:46
your operating system it takes it and it
00:11:49
loads into the memory so that the
00:11:51
operating system will come live and
00:11:53
after that the rest of the things the
00:11:55
operating system will take care of so
00:11:57
that was about rootstrap program now now
00:11:59
the next thing that I want to introduce
00:12:01
to you is something known as an
00:12:02
interrupt so let us see what an
00:12:04
interrupt is so what comes to your mind
00:12:06
when you hear the word interrupt so in
00:12:09
English we know what is an interrupt
00:12:11
when you are doing something if someone
00:12:12
comes and disturbs you or if someone
00:12:14
comes and says please stop doing this
00:12:16
work and do something else that is an
00:12:19
interrupt we are interrupted so think of
00:12:21
it in the same context this is almost
00:12:24
the same even in case of a computer
00:12:25
system and let's see what or how we can
00:12:28
Define this and what it actually is so
00:12:30
the occurrence of an event is usually
00:12:33
signaled by an interrupt from the
00:12:36
hardware or software so we know that the
00:12:39
CPU is always working it is doing some
00:12:41
work and when the CPU is doing that work
00:12:44
sometimes the hardware or software May
00:12:47
interrupt the CPU it may come and tell
00:12:50
the CPU that wait just wait with
00:12:52
whatever you are doing and please
00:12:54
execute this task that I am giving you
00:12:56
this is more important so the CPU has to
00:12:59
top and it has to execute that task
00:13:01
which comes up and that is known as an
00:13:04
interrupt so the hardware May trigger an
00:13:06
interrupt at any time by sending a
00:13:09
signal to the CPU usually by the way of
00:13:11
the system bus so we have different
00:13:14
Hardwares in our system and then that
00:13:16
Hardware can trigger an interrupt it can
00:13:18
interrupt and how does it do that it
00:13:21
sends a signal to the CPU and how can
00:13:23
you send signal to the CPU by the way of
00:13:26
a system bus through the system bus I
00:13:28
showed you in our previous diagram what
00:13:30
I mean by bus so here this line it
00:13:33
represents the common bus we have so
00:13:36
similarly using a system bus the
00:13:39
hardware can send the interrupt to the
00:13:41
CPU and the CPU have to stop whatever it
00:13:43
is doing and it has to execute the
00:13:45
interrupt so we'll see how the CPU
00:13:47
responds to the interrupt later so let
00:13:50
us understand what is meant by interrupt
00:13:51
in that way now the next term I want to
00:13:53
introduce to you is known as a system
00:13:55
call also known as a monitor call let's
00:13:58
see what it says a software May trigger
00:14:00
an interrupt by executing a special
00:14:02
operation called a system call now as I
00:14:05
told you when a hardware triggers the
00:14:07
interrupt we usually call it as
00:14:09
interrupt if the software is what that
00:14:11
is triggering the interrupt if the
00:14:13
software is causing the interrupt then
00:14:16
that is known as a system call or a
00:14:18
monitor call so if it is a hardware we
00:14:20
usually call it an interrupt or if it is
00:14:22
triggered by a software then we usually
00:14:25
call it a system call or a monitor call
00:14:28
so I hope that made clear to you what an
00:14:30
interrupt actually means now let us see
00:14:33
how does the CPU respond when it
00:14:36
receives an interrupt so here it says
00:14:38
when the CPU is interrupted it stops
00:14:41
what it is doing and immediately
00:14:43
transfers execution to a fixed location
00:14:46
so I already told you how interrupt can
00:14:48
arise either from Hardware or software
00:14:50
so CPU is already doing some work and
00:14:53
then immediately it gets an interrupt
00:14:56
from either a hardware or a software so
00:14:58
when when the CPU is interrupted in that
00:15:00
way what does it do it stops what it is
00:15:03
doing it stops what it was doing and
00:15:06
then it immediately transfers execution
00:15:09
to a fixed location so whatever the CPU
00:15:11
was doing it just stops it and then it
00:15:13
transfers his execution to a fixed
00:15:16
location now what is that fixed location
00:15:18
that we are talking about the fixed
00:15:20
location usually contains the starting
00:15:23
address where the service routine of the
00:15:26
interrupt is located now we have a new
00:15:29
term here which is called service
00:15:31
routine now what is a service routine
00:15:33
service routine is nothing but it is
00:15:35
something where what the interrupt
00:15:38
actually wants to do is written so let's
00:15:40
not go into the technical details I'll
00:15:42
just tell you basically what it means so
00:15:44
when an interrupt arises there is
00:15:46
something that the interrupts wants to
00:15:48
do so there is something that the
00:15:50
interrupts want to do something it wants
00:15:51
to execute so what actually has to be
00:15:54
executed or what actually the interrupt
00:15:57
wants to do that is written in the
00:15:59
service routine so every interrupt has
00:16:02
its service routine known as the
00:16:03
interrupt service routine sometimes it
00:16:05
is known as ISR so when the CPU is
00:16:09
interrupted it stops what it is doing
00:16:12
and it immediately transfers its
00:16:14
execution to the starting address of the
00:16:18
interrupt service routine so the
00:16:21
interrupt service routine may be located
00:16:23
somewhere and it has a starting address
00:16:25
from where it should start its execution
00:16:27
so the CPU it stops what it was doing
00:16:29
and it transfers its execution to the
00:16:32
starting address of the interrupt
00:16:34
service routine so that is the first
00:16:36
thing that the CPU does when it is
00:16:38
interrupted and then what happens the
00:16:41
interrupt service routine executes so
00:16:43
whatever was written in the interrupt
00:16:44
service routine gets executed completely
00:16:46
and then what happens on completion the
00:16:49
CPU resumes the interrupted computation
00:16:52
so we know that the CPU was already
00:16:54
doing something before so when the
00:16:56
interrupt arose what it did it
00:16:59
transferred its execution to the
00:17:01
interrupt service routine and then it
00:17:03
executes it and when it is done once the
00:17:06
interrupt service routine executes
00:17:08
completely then the CPU can go back from
00:17:12
where it came from the execution of the
00:17:14
CPU goes back to where it came from and
00:17:18
it resumes whatever it was doing so this
00:17:21
is how the CPU responds to interrupts
00:17:25
and I hope that made it clear to you how
00:17:28
an interrupted is handled by a CPU at
00:17:30
least the basics so this was just a
00:17:32
basic introduction to computer system
00:17:34
operations so I will not go into great
00:17:37
detail because this is just the basics
00:17:39
that you need to know before you really
00:17:41
understand the details of operating
00:17:43
system so I hope this was clear to you
00:17:45
in the next lecture we will be seeing
00:17:47
About Storage structures and about
00:17:49
memory which is also an important topic
00:17:51
that you need to be knowing for
00:17:53
understanding your operating system so
00:17:55
thank you for watching this and see you
00:17:56
in the next one
00:18:00
[Music]