So, welcome to information security 3 course on basics of Unix and network administration. This is the third in the series of information security courses offered through this MOOC platform from IIT Madras. In the first course, we just had a full introduction to information security from a systems perspective, what it means to build a secure system, what are the different definitions, etc. These were the things that were covered in information security 1. which was 2 years before. Last January we had a course on the information security 2 which was basically concentrating on how to build, how to use contemporary hardware features and build a secure system.
So we called it as architectural aid to information security. So when you look at typical systems, first there is an hardware on top of it there is an operating system and of course the network, the computer communication network which basically connects multiple systems also start interacting at this point. So at the third level of this information security series, we will present you the basics of UNIX and network administration with some emphasis on security.
So this will form the basis for the information security 4 course and subsequent courses in the series which will basically talk about. Security at higher layers above the operating system and applications, etc. So this course will be having 60 modules of 20 minutes each, spanning to 20 hours. We will have 8 programming assignments of both MCQ, multiple choice questions and programming nature. And then we actually assume that you have some basic programming exposure to a basic programming language.
And of course there will be an in-course exam. And you have to clear both the end course exam and the programming assignments to basically get the certification, right. So, we go into the module 1 which basically introduces some of the fundamentals of operating system.
So, when you look at a system, there are 3 different use. One is the end user who uses the applications provided to him. For example, I use a browser, yes, I use a word processor, I am an end user. And what do I use? I use an application software that is provided to me and who writes this application software?
An application programmer actually develops this application software. So the typical functionalities that I use as an end user is that I use the, for example I use a word editor and I say cut the text, I save the file, I send the file, I print the file etc. So I do not really bother how.
The software actually works. I use the functionalities offered by the software. I am the end user and I don't know anything about the system. I just know how to use the software namely a word editor for example. So this is the end user view.
Now somebody has written the software for you and that person is the application programmer and what is the application programmer wants? He actually has to develop the application using some of the features available to him. And who gives those features?
A system software actually gives these features to the application programmer to make him write the application. For example, when I am developing an application which will be used by some end user, let us assume that I am developing the application using C programming language. So, what do I require? I require memory. So, as a C programmer, I will ask for malloc.
Malloc is that when I am executing a program, I need memory. As an application software developer, I will ask the operating system or the system software, give me some memory, this is called dynamic memory allocation. You can go and look at any book in C programming language and understand what is MLOC. So, MLOC is an example of some feature which the application software would require from the operating system to basically do its computing. Similarly, I want to open a file, I want to print a file.
it on the screen, printf, scanf, many many features that an application software uses, these are all supported by some other software layer below it and that is called the system software. So, from an application programmer view, he bothers about what the system can offer to him and basically that is what we call as the system software. So, somebody has to develop the system software and that That person is basically whom we call as the operating system programmer or the system programmer. So, we have an end user who does not do any programming, he just uses the software. The end user uses an application, that application is developed by an application programmer who actually uses the facilities given by a system software to develop the application.
Now somebody has to write the system software and that person is a systems programmer and or OS programmer and he needs to know about the software. How the hardware actually could be used? For example, he needs to know how to read from a disk, he needs to know how to start a printer, he needs to know how to track a mouse.
So there are 3 different views, an end user view, an application programmer view and a OS programmer view. So a system programmer is more bothered about the hardware. So in our last course, information security 2 course, we have actually talked about what are The interfaces that a hardware can give to a system software developer.
Now in this course we will see how the system software developer can utilize the interface that is provided by the hardware. So this is how we link these 3 courses. Now what is system software? System software for example when you write a C program you use lot of headers like hash include stdio.h, stdlib.h, mat.h, string.h.
So, lot of facilities are given to you. So, a bunch of what are these.h files? They are header files which basically point to some libraries which are pre-built and you can use it for doing certain functionalities.
For example, if you do not have stdio.h, if suppose you have to write your printf all by yourself, you will actually spend the 4 years, if you are an undergraduate student, you will spend the rest of your 4 years just.h. to write your Hello World program because printf is such a complicated function. You need to understand lot to implement printf.
But you finish your Hello World program in say the first 5 minutes of your introduction to computing course. How do you do it? Because you use printf which is given by somebody else and who is that? The system software.
So, a system software, a collection of C library functions can be called as a system software. So, when you log into your system, you basically have a window. A desktop coming up, that is itself a system software.
Now when you are developing a web application, you actually basically use a database to say for example store all your login and password or to store some of your credentials, your data. So, for example, MySQL is a database management system. So, DBMS is a system software. Then there are lot of resource management functions coming through the form of device drivers, etcetera. So, this is also we can say they are all system software and of course finally the operating system.
One can say that an operating system is just a software, but actually it is more than a software and we will see though it is a software that is executing, but the general definition say we cannot say that an operating system is actually a bunch of library functions like what SE library function. We cannot compare the four blue. points that I have given as example with the red point that is the OS there. So, for example, a OS cannot be compared with a C library function.
Both are software, but they are something different and let us see what it is as we proceed in this module. Now, all this system software is available to the application programmer through what we call as an application programmer interface API, a software API. And these system software basically as I mentioned in the previous slide will execute on the hardware.
Now in this course we will bother more about system software. So as you see the entire stack, stack is one over another, at the bottom you have hardware resources and this hardware is basically utilized by the software to execute. So there is an interface between software and the hardware.
This interface we covered in great detail in information security. 2 course which is actually available for all of you to view what we call as architectural aid to information security. If you have not done that course, do not worry. This information security 3 course is independent or is self-contained of the information security 2 course, but if you actually done that, you will have a better appreciation of this course. Nevertheless, you can safely do this course without attending the information security 2 course.
We have tried and explained lot of things. and bridge those gaps that much I can assure you here. Now, the hardware actually offers certain interface to the software and so there are two parts to the system software.
One is a trusted OS. Which actually gives, which abstracts out the resources to the higher layer, right. The trusted OS sometime we call it as kernel.
So what is the functionality of this? So a person who is writing a system software who sits above this layer, for example pink layer, we are now talking about the green layer, the programmer who is working at the pink layer need not really bother about the hardware resources. So.
This kernel basically abstracts these resources and gives it as an interface to the pink layer. The pink layer basically is a system software layer which will still abstract it more and so when an as an application software when I am developing it, I really need not bother what the underlying hardware resources. I can just write for example, when you write a printf statement, do you really bother what is the monitor there? No.
You can have any variety of monitor. You just say printf, somebody takes care of taking your printf and printing it on say for example a monitor made by company X or monitor made by company Y. You say fprintf, do you really bother what is the hard disk that is stored there?
You do not bother. So, it can be by some company X or Y, somebody else takes care of taking your fprintf and actually saving it in your file. If you say f open, open the file, f close, close the file.
I am taking examples from C programming language just to explain things better. So all these things are taken care of by some layer and that layer is the operating system cum system software. So we will be focusing on the pink and the green that we are talking of in this screen.
And so course number 2 actually covered a bit about hardware resources. Specifically from information security perspective, now we will cover lot about the two layers here and then subsequent courses we will talk about application software. Now if you look at the components of a computer, so we basically have a computer hardware, on top of it executes the operating system and top of the operating system we have system and application programs.
The system and application programs basically comprises the compiler, your assembler, your text editor, database system and then on top of this there are the users who use all these things. So, there can be a user who uses the compiler, somebody can use your text editor, somebody can use your web browser, somebody can play video games on top of you, etcetera. So, there is a 4 layer when we view the system there are 4 layers. So, we have Basic is the computer hardware, on top of it is your operating system, then your system and application programs and then the end user who uses these application program.
To again say in this course we will talk more about the operating system and also the network which actually forms a major, the interaction of a communication network to a system basically is through the operating system. So, we thought that we could make this together and give you a holistic view of. How an operating system and network work together? Now this is typically the interface between the various components of a computer.
So as a user you actually drive an input to an application software. For example, you give a C program and you compile it and when the program executes it actually request for some service from the operating system. For example, Melloc, please give me some memory or say Printf, Printf on the screen.
Now the operating system will take. this service request and need to get it executed on your hardware. So basically this operating system translates your service request into a set of instructions that will be understood by the hardware.
For example, you say printf something, the operating system will take that and through some means, through a device driver, it will go and tell to the screen, to the graphics processing part of your system, go and print this. So it basically gives hardware instructions. So, in return your computer hardware will say in the case of printing it just prints, but in the case of say read something from the hard disk, so it actually reads and it gives back a result of what it has read.
And once the operating system gets the data then it will give back the application software has requested something. For example, it requested some memory operating system will actually allocate that memory and then give a pointer to that memory that is what we mean by service response. And this.
will basically be given as an output to the user. So the user Ask for certain things to the application software which in turn ask for some services from the operating system which again ask which translates into set of hardware instructions, get it executed on the hardware, the results are sent back to the operating system which in turn gives a response to the service request made by the application software which in turn is converted to an output and the end user can view it. So this is basically how the 4 components actually interact. Now in this whole thing what is this OS? It is nothing but a program between users and the computer hardware, right.
And why do we need an OS? We need an OS for lot of things. One of the important thing that we need to talk of and that is also very important from an information security perspective is that it abstracts the complete hardware from the user. So, as I mentioned to you, when I want to do a printf, I never care what is the actual monitor or what is the hardware that is executing there.
I just tell printf and some layer takes care of taking this printf and getting it printed on the screen and so this is very very important. So, one of the most important obvious use of an operating system is to see that there is an abstraction and because of this abstraction your computing becomes very convenient, right. And since the operating system is taking care of lot of coordination, you can start using your hardware in a very efficient manner. And also the operations would be well tested by the operating system.
So if you request the operating system for an operation, then the operating system also ensures that it does the operation correctly. For example, if I want to read a file, I want to read some bytes of the file, you just tell the operating system this is what I need, the exact that bytes will be read and given back. So the operating system is also responsible to see that your operation is correctly executed.
So these are some. need for an operating system. So very quickly there are different types of operating system that we see even today.
The type of operating system actually depends upon the final end application which you intend to use. So there are several types of operating system. Very quickly you could have a batch processing operating system, a time sharing, a personal computer and workstation based operating system, a real time operating system, a network operating system which runs on your routers and your switches today, your network appliances today. A distributed operating system, operating system for small computers like embedded systems.
So different type of OS are there depending upon how your end application is. We will just see more detailed definition of this very shortly and then of course the OS can also be grouped depending upon other criteria like for example single user operating system. So, one user who uses that system. Like for example your desktop right, you may be the only user who is using it, you may not share it with across different users.
So there are lot of both execution and the security implications by saying that this is a single user operating system versus a multi user operating system. For example your mail server, many users can login. So it is an operating system that runs on your mail server should be a multi user operating system.
So it is a single task operating system, multi tasking operating system. Single programming and multi-programming operating system, we can talk that. There is a distributed operating system, embedded operating system, real time operating system.
So these are all different types of operating systems that we see. So very quickly we will define these things because these are very important for us to further investigate on this. A single user operating system or single task operating system is designed to manage the computer.
So that one user can effectively do one thing at a time. A single user multitasking is a single user has several programs in operation at the same time. For example, any conventional OS like your Linux or Windows that is running on.
A multi-user operating system allows many different users to take advantage of a computer resource simultaneously. For example, your Linux, Unix servers, many people can login. Your mail server is an example of a multi-user operating system. Now there are operating systems which are. basically done for networking purposes.
So this is one subtle difference that we want to see a multi-user operating system and a single user operating system that support networking. So there are two things a multi-user operating system, a single user operating system that support networking they are actually different. For example Windows 2000 or Netware these are actually single user operating system there is only a system administrator but it can be used to actually network.
Thousands of systems, it can each support hundreds or thousands of networked users, but the operating system themselves are not truly multi operating systems. So we are just trying to classify this, we also suggest that you go and do a little more reading about Windows 2000 and novel network through Google or Wikipedia to get more insight into that, but we are trying to classify operating systems because the understanding of this type is extremely crucial for us to go. Then there is something called real time systems. For example, a real time system is what you expect out of an operating system. We say that if I ask for an operation x, I should get a correct result.
This is a normal operating system. But in a real time operating system when I ask for an operation x, that operation should be done correctly, not only it should be done correctly, but it should be done within a given point of time. For example, I am running an aircraft. or any control system, let us say aircraft, I put the landing gear or something like that, I do not know how aircraft works, but let us say I want to put a landing gear and which will actually bring down the wheels so that the plane can land.
Now the wheels should come down within say next 2 minutes. Suppose it takes something happens to the operating system and takes 1 hour for the wheel to come down, the plane cannot even land and it may go out of fuel. So. The operating system that actually controls an aircraft should ensure that the operation is correctly done, but not only that it is correctly done, but it should also be done within a particular time interval.
So that is the definition of a real time operating system. And then there are distributor operating system which actually manages a group of independent computers and make them appear as a single computer from an application software perspective. And then there are embedded operating system that you see everyone has a mobile today.
So, what runs there can be classified as an embedded operating system or a real time operating system. It is sort of a very thin layer. But suppose you look at an internet of things, IoT devices.
If you do not know what is IoT, please go to Google and find out what is IoT. But these are very very small devices which are used to find what is the pressure, what is the temperature in a room. For example, something that runs on your washing machine, some fussy logic that is running on your washing machine. So, these are all examples of your. embedded operating systems and these are very very compact and extremely efficient by design.
So if you look at the evolution of OS we have started from what we call as mainframe computers which basically does batch processing. For example you give the job today and tomorrow morning you come and collect to mini computers and then to desktop computers and to handle computers. The major transition from mainframe to the handled computers is that We are now looking for interactive computing.
I start doing some work and at every step I am expecting the computer to give back the results and so this is what we mean by an interactive computing and also that these systems are now heavily networked. Moment I switch on my mobile, I am connected to billions of people, billions of such devices across and then we start sharing information. So Today the most important aspect of operating system both from the development of the operating system point of view, from the requirement of the operating system point of view and also from the view of you know the security of the operating system is that the systems have become highly interactive, the systems are expected to be real time in sense that we need very quick results and that the systems are heavily networked. So, these three form the basis of development of operating systems today and when we start looking at maintaining this operating system, administering this operating system, it is very important for us to understand these requirements today that we have users, we have multiple systems connected through a network, we have users who want to use multiple applications and who are looking for very quick results and this forms the basis of our understanding of Contemporary operating systems. So what is the role of an OS?
A role of an OS is first it is a resource allocator. I ask for a resource, say for example I ask for opening a file that means what? I am looking for a file storage.
I want to execute my program, so I ask the OS give me some CPU time so that you get me executed. I am asking for some memory RAM space through my lock. So the main role of an OS is that The application software will start asking for resource and the OS has to allocate this resource to the application software and importantly it should also see to it that there is no conflict of these resources. For example, let us say in a mail server we are trying two fellows want to print. So, the OS has to serialize this job.
First he has to allow user 1 to print, then he has to bring in user 2 to print it. If both of them start printing, then one line of your file will be printed, the next line of the file will be from his input, right. So, there is a need to resolve conflicts here.
So, two fellows want to use the printer, I want to print 2 files, I will print file 1 and then file 2. So, this act of serialization. is what you call as conflict resolution and that is one very very important role of an operating system. And the operating system also actually controls the program execution. For example, if you might have seen core dump, segment fault, seg fault, what does it mean? The operating system has given you some memory and if you start overshooting that memory, immediately the operating system has to stop you.
Right. So, this basically ensures typically in a multi-user operating system where many users login and many process gets executed, one process should not interfere with another process. What is a process?
A process is a program in execution. So, when your program is executing, some other programs error should not affect you and your error should not affect some other program because both of them are executing in a time shared way in the system. So, one of the important use of an operating system is to see that typically in a multi-user operating system like your mail server the mistake done by one program should not affect the execution of another program and as a program when I do a mistake for example I do a divide by 0 somebody has to stop me and say you have done a divide by 0 so you are not valid and you have to shut down my program because it has done something which is mathematically wrong or which is programmatically or computationally wrong so Such type of error reporting, catching errors are also a very important role of an operating system.
So, one of the important role of the OS in addition to allocation of resource is also to control the execution of your program and also see that your program is correct in execution and if there is something wrong then it has to stop and it has to report an error. Now what is the definition of? OS. It is, so there is no universally accepted definition. The main reason is that OS is need to serve multiple users executing varieties of programs on variety of hardware.
So the OS has set of applications on top of it and it has the hardware below. So normally if you take say for example UNIX, it executes on multiple devices. different versions of Unix execute on multiple different varieties of hardware, right. It is not just a CPU, it sees multiple devices. Say there is printer A, printer B, disk A, disk B.
So it is not just a CPU but there are multiple CPUs also but more than the CPUs there are multiple peripherals. So the OS sees multiple things below it and also varieties of software. So there could be C, there could be Java, C sharp, D sharp, E sharp, F sharp. Many many things Python, HTML5, HTML4, Internet Explorer, Firefox, Chrome, varieties, open office, closed office, so what not.
So you see lot of things, lot of varieties on top and lot of varieties in bottom and so essentially your operating system is sort of should address this variety and that is also perhaps a reason why there is no universally accepted definition for an operating system. So it is actually one program running at all times on the computer. So moment you boot the operating system comes into existence and sometimes it is referred to as the kernel which is nothing but a kernel is actually not the operating system, it is the heart of an operating system, it is a part of an operating system. So then everything else other than the kernel can be called as a system program or an application program. So it is sort of a very vague definition here but then there is One understanding, there is some basic things that executes always and we will call it as kernel and on top of it there are lot of things that basically interface the operating system with the application layer and the application software layer and the end user.
So the goals of this operating system, the primary is to give the convenience, secondary goal is to ensure efficient operation. We have covered that in great detail in the previous slide. Most importantly when I want to execute a program, this should facilitate the execution of the, as a user when I want to run an application program, it should facilitate the execution of this program. So how and when does an operating system start to function?
Your system will start executing from some read only memory. This is a code that is pre-stored there. So it will start fetching the instructions from a read only memory and those are the first two things that get executed and that is sometime called as the firmware.
And what will the firmware do? The firmware will now go and look for a bootable disk or a bootable device and it will... There in that bootable device there will be the first sector or the first block of the bootable device and it will load that program that is stored in that bootable device and it will start executing and that first program is called the bootstrap program and then that will further load the OS kernel and gives the control. So what happens when I switch on, there is a read only memory, there are some instructions that are there.
That will start executing and that will basically go and find a bootable disk. So that firmware will find this bootable disk and in that there will be one master boot record. Whatever is there, this firmware will load the content of that master bootable record into the memory and give control to this.
So whatever is stored on the master boot record will start executing and that will go in turn and load the OS kernel. So, this is how the kernel comes into existence. So right from the inception, right from you switch on till you switch off, there will be one program that will be always in the background in the in the picture and that is the operating system.
So, to understand how an operating system function, it is necessary to have an idea of computer organization and operation. We will quickly cover that in the next module. Thank you.