Important : Introduction to Computer Systems

A free video tutorial from Vignesh Sekar
Software Engineer,Computer Science Instructor
16 courses
64,320 students
Learn more from the full course
Operating Systems from scratch - Part 1
Learn the concepts of Operating Systems from scratch as Operating System forms the core of Computer Science
08:18:41 of on-demand video • Updated February 2023
You will become very familiar with the core concepts of Operating Systems
You will be able to challenge the interviewer on questions related to Operating Systems
You will view Computer Science in a different dimension
You will be able to answer all questions of exams like GATE,PGEE,ISRO (after completing all parts of OS course
You will be able to get a top grade in your Operating systems course in your Bachelor's degree
Understand how Operating Systems work
Understand how a process is created
Understand how CPU scheduling is done in Operating Systems
Understand the various scheduling algorithms we have in Operating Systems
Understand how CPU , Memory and Disk work together
Understand Memory managment in Operating Systems
Understand how a process is moved from hard disk to RAM
understand memory allocation strategies used by operating systems
English
Before seeing.. What an operating system is ... Let's first see, what is meant by a computer system! OK.? See! A computer system is nothing but... it is a combination of hardware, software and data which are used to solve the problem of human beings. OK.? See as a user, we want to solve our problems .. Ok! For example: I wanted to access a webpage... It's a problem. I want to edit my photograph. It's a problem. ok! All these are problems of human beings. Now, in order to solve these problems... We use a computer system. ok ? By saying "We use a computer system", I mean we use hardware devices some software.... software's are nothing but programs.. ok ? software's and programs, both mean one and the same.. And data. Ok.! For example: Let us assume, I want to edit my photograph ok! ...which is a problem. Editing a photograph is a problem. Now to solve this problem we use hardware... Hardware means, we use hardware devices in our computer... Right! By hardware.... I mean.. We have CPU.. OK ? See the most important part in our computer is ... Central Processing Unit or CPU .. Ok! It is nothing but a small chip. Ok! It is a chip.. Now.. What this chip will do is.. It will fetch the programs... Program means software.. You know that.. Ok! Programs will be stored inside the RAM or memory. Now.. what this CPU will do is! It will fetch the program from the memory and then it will execute it .. Ok ! Any operation you do in your computer is being done by ... with the help of CPU ..Ok! Anything you do. CPU needs to execute an instruction for it.. An instruction is nothing but a part of a program. ok ? You can think of it like a line of a program.. A collection of instructions are also called as a program.. Fine! Now the main functionality of our computer system is nothing but execution by the CPU (central processing unit ). Now.. That is one important hardware device we use in our computer. The second most important device is nothing but memory.. ok! See.. We have various levels of memory in our computer .. ok! By simply saying memory. Actually we mean RAM (random access memory). But apart from that, there are various types of memory. One important part is.. as I said it is RAM .. ok! The second most important memory system is Hard disk! We also use other memory systems like cache, registers and all these. OK! See.. Computers work on the basis of "stored program concept". OK.! What does it mean is.. In order to solve the problem of human beings, We write programs. OK.! Now what we do is.. We store the program inside the memory. OK.! We will store the program inside the memory.. Now what will happen is.. This CPU ( Central Processing Unit ), the chip will take the program line by line or instruction by instruction and then it will execute it.. ok! That is how the problem of human beings are solved today.! See any software. We use today in our computer.. has a program at the backend.. ok! For example: If you're using MS-WORD Now Microsoft should have written a program for MS -WORD, and that program will be stored inside your hard disk. ok! And for execution The program will be moved from Hard disk to RAM.. And what will happen is.. CPU will fetch the program line by line.. The program is written by Microsoft. Right! That program will be fetched by the CPU line by line. and it will execute it.. as a result of which we are able to use the software, as we are using today.. Ok! See, Why are we actually moving the program from hard disk to RAM is different.. That is an important point.. which is discussed in the next video.. Which will be discussed.. in the next video.. Fine! As of now understand that.. Any program which CPU wants to execute has to be present inside the RAM.. ok! Random Access Memory. We have a hard disk.. ok! Which is an important part! Now the program will be moved into the RAM. And this is our CPU. What this CPU will do is! It will fetch.. the program.. Let us assume.. This is MS-WORD.. ok! ok! This is a program, and this program will be stored inside the RAM. What our CPU will do is! It will fetch the program line by line and then it will execute it. As a result of which, we are able to use the software as we are using today.. ok! Now this MS-WORD.. You take any software.. Whether it be Google Chrome.. Whether it be Photoshop.. Any software you take! There should be a program which will be running at the back end. Ok! Program is also called as a software. Now our Central Processing Unit will actually take the program line-by-line, and then it will execute it! Fine! The most important thing which will be present inside our RAM is program. Now apart from program, there will be something called as data.. ok! See without data our software is useless.. Right! Without data Why do you want to use a software? For example: If you're using Photoshop, which is a software! You need some photographs to edit.. ok! Those photographs, we say that as data.. A data is nothing but any information, any raw data.
For example you take images, video file audio file, text file.. Anything you take all these, we say it as data.. ok! Now.. A combination of hardware, software and data are actually used in order to solve the problem of human beings. ok! This is what our computer system is actually doing. Any problem you want to solve in our computers.. We actually write programs. ok! Fine! Now one question you might ask is! Why are we using these many levels of memory. Ok! Rather than using only one memory system. Why are we using RAM, Hard disk.. Cache and Registers.. See! Actually All of them are doing only one thing. They are actually either storing program or data within them. Right! So that CPU can fetch them and then execute it. That's what we're doing in it. One question you might ask is! Why are you using these many levels of memory. The reason is very simple.. ok! We're using these many levels of memory because, every memory system has its own advantages, as well as disadvantages. ok ? See coming to Cache and Registers.. We can see it a bit later.. ok! Don't think about it too much! Because this is actually covered incase of computer organization and architecture.. ok! This is not very important coming to operating systems in order to understand operating systems. These two memory systems, you should be very comfortable with .. Ok.! Now .. Now the difference between RAM and Hard Disk is very simple. Ok! Whatever is stored in hard disk is actually permanent Ok! The data which we store in hard disk is permanent.. Which means, Incase if you store some data inside the hard disk.. The data will remain permanent. Ok! But that is not the case coming to RAM. The data which you store in RAM. doesn't guarantee it! It doesn't mean that, the data is actually permanent. Once the power goes off Ok! Whenever you're using a computer and incase if the data is inside the RAM. Incase if the power goes off and your computer got disconnected from the current, Then what'll happen is.. The data will get lost. Ok! That is the disadvantage with the RAM.. And that is the advantage with Hard disk.. Ok! Fine! But there is an advantage with the RAM, comparing to Hard disk. The thing is.. Accessing either program or data from RAM is actually very very very fast, comparing to Hard disk which means.. The access time of RAM is million times faster than that of Hard disk! Ok! See in order to access an instruction from the hard disk, It will take lot of time. Ok! And during that time you could have accessed to a million instructions through the RAM. Ok! So I can say that a RAM is million times faster than that of Hard disk. Actually million is not the exact number. It really varies based on implementation. For example: That depends on the size of the RAM. Right! Size of the RAM actually decides the speed.. The more bigger the RAM you have.. The more faster your computer will be! Ok! Why? You will understand it once you get into multiprogramming concept. Ok! We have in this course. Once you get into multiprogramming you will understand Why increasing the size of the RAM is actually increasing the speed of your computer. Ok! Fine! So the advantage with Hard disk is.. Data which you store is permanent.. The advantage with RAM is access time time is very very fast. So now, We as a user want both these advantages. Ok! We don't want both these disadvantages. That is fine! Anyway we need to tolerate with it (disadvantage) to some extent .. But what we want is.. We want both these advantages! One thing is our data should be permanent. The second point is we need to access the data very fast. Ok! OK.? So what we do is! We will have both these memory systems,
one is RAM and this is Hard disk.. Now any data you take in our computer will definitely be present inside the Hard disk. Ok! So either it is a program.. or it is a data or whatever it is!
Will be present inside the Hard disk. Now the biggest problem is the time taken by the CPU to access this data.. It will take very long time. Right! What is the disadvantage with the Hard disk.. Now to avoid that disadvantage. What we do is! We actually move this data inside the RAM.. Ok! So that our CPU can access the data very fast. Ok! Ok! So we got both the advantages.. Ok! One advantage is that the data which we are.. See! Actually, One important point you need to note Here is.! The data is actually copied and pasted into the RAM is not like cut-paste.. It is like copy-paste.. Ok! which we do in our computers.. which means this thing has to be moved inside the RAM, A copy of this will be created. and it will be moved into the RAM. Ok! Which means this will be present, both in RAM as well as in Hard disk. Why? Because incase, if the data gets lost inside the RAM. It is still present inside the hard disk.. Right! We want permanent data. Fine! So we are able to get both the advantages. One thing is! We are able to access the data or program very fast through the RAM. As well as, we are able to have our data permanently inside the hard disk. So both these problems have been solved by using both both the memory systems. Ok! We are able to get both the advantages by using both these memory systems. So.. This is the reason we use various levels of memory systems.. Ok! Cache and Register are a bit more complex. I mean you don't need to understand it very clearly to understand this subject of operating systems.. Ok! It is mainly covered in computer organization and architecture.. Ok! Fine!