Introduction to Computer Systems

Vignesh Sekar
A free video tutorial from Vignesh Sekar
Software Engineer,Computer Science Instructor
4.5 instructor rating • 14 courses • 12,806 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 October 2020

  • 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 inorder to solve to solve these problems... We use a computer system. ok ? By saying "we use a computer system", I mean we use hardware devices some hardware devices some software.... softwares are nothing but programs.. ok ? softwares 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 the main functionality of our computer system is nothing but execution by the CPU (central processing unit ). Now that is.... 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.... That program written by Microsoft. 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 were using today ... OK.? see where 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 ... Now as of now understand that... any problem 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 and 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 were 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 ... So fine.... so 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 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 regsters ....See... Actually all of them are doing only one thing. they are actually either storing program or data within them... Right ..? so 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 disadvantageous. 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 Inorder to understand operating systems. These two memory systems you should be very comfortable with ... OK.? Now what this RAM ..... 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 permenant 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 inorder 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 fastly .. 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 ? That is 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 fastly .. 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 ok ? 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 fastly 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 ? cahce 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 ....