1 / 42

Pre-Course Study Material

Pre-Course Study Material. O perating S ystems. Basic Principles of Operating Systems.

elina
Download Presentation

Pre-Course Study Material

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pre-Course Study Material Operating Systems

  2. Basic Principles of Operating Systems An operating system is a collection of software that coordinates the working of the different components of the system and gets the user’s job done. The operating system provides the user with all the basic things necessary to do his job. Is it enough to have microsoft word to write letters? No. Surprised?

  3. What if there is no interface to the key board? • What if there is nothing that will control the output to VGA card? • What if there is no interface to the human user so that he can switch on “MS Word “ ? Yes the answers to all these questions is operating system. Technical Definition: An OS is a collection of system software that coordinates between the hardware, provides a platform for softwares to run on and provides the user with an interface for command inputs. EG. DOS, Linux, Unix, Windows, MAC, OS/2, Minix, and many more. The governmental systems like Postal system, Railway System are analogous to Operating Systems.

  4. What does an Operating System do? • An Operating System exploits the hardware resources of one or more processors to provide a set of services to system users. • An Operating System also manages secondary memory and input/output devices on behalf of its users.

  5. Structural Elements of a Computer • Processor: Controls the operation of the computer and its • Data Processing functions.. A single processor is often termed as • the Central Processing Unit. • Main memory: Stores data and programs. This memory is • typically volatile. Contents of this memory are not retained even • when the computer is shut down. • I/O modules: Moves data between the computer and its external • environment, such as disks, data communication equipments, • and terminals. • System bus: Provides for communication between processors, • main memory, and I/O modules.

  6. MEMORY INPUT OUTPUT CONTROL UNIT ALU Schematic Diagram of a Computer System • INPUT: Input devices (Keyboard, Mouse etc.)(RAW MATERIALS) • OUTPUT: Output devices (VDU, Printers etc. )(FINISHED PRODUCTS) • MEMORY: Main memory (Volatile – commonly known as RAM)(GODOWN / INVENTORY) • CONTROL UNIT: A device that generates Signals to command other units that what to do and what not to. (TOP MANAGEMENT) • ALU: Arithmetic Logic Unit – The unit that performs the computations. (MACHINES)

  7. Memory Hierarchy GROWING SPEED AND COST GROWING SIZE AND DATA RETAINABILITY Registers Cache Main Memory Magnetic disk, CD-ROM, CD-RW DVD-RW, DVD-RAM Magnetic tape

  8. Objectives of an OS • It is a program that • controls the execution of application programs • acts as an interface between applications and computer hardware • manages the resources associated with a computer Objectives of an O.S. • Convenience of use of the computer • Efficient use of the computing resources • Should be such that it can permit effective development, testing and introduction of new system functions without affecting the service.

  9. Thus the basic functions of an OS are – • Process Management – Managing the programs that are running. • Memory Management – Managing and rationing the memory between processes and data. • Storage Management – Managing the permanent Storage of data on disks or other media • I/O Management – Managing the input and output • Device / Resource Management – Managing devices and resources and allowing the users to share the resources • Security and Protection – Securing the system against possible unauthorized access to data or any other entity. Protecting the parts of the system against damage. • Booting the System and getting it ready to work. • Data communications – Providing interface to connect to other computers or allowing others to connect

  10. Operating System as an Interface Application Programs End user Utilities Programmer Operating System OS System Designer Computer Hardware

  11. Operating System Services • Program Development – variety of services and utilities such as • Editors and debuggers. They are usually referred to as application program • development tools. • Program Execution – involves a number of steps, such as loading • Instruction and data in the main memory, initialization of I/O devices and files, and other resources to be allocated. OS handles the scheduling. • Access to I/O devices – Each I/O device has its own set of • Instructions and control signals. O.S. hides these details to provide a • common interface to the user/programmer.

  12. Operating System Services • Controlled access to files- nature of I/O device (disk drive, tape drive) and structure of the data stored in the files in the storage medium. In the case of multiple users accessing the processor concurrently, proper protection mechanisms have to be used. • System access- For shared or public systems, the O.S. controls access to the system as a whole and to specific system resources. Access system provides protection of resources, and data from unauthorized users, and resolves resource conflicts • Error detection and response – Variety of errors may occur in computer system. Responses may range from program termination, retrial of the same operation, or reporting error to the application. • Accounting – collecting usage statistics, CPU usages, monitor • performance, etc.

  13. What is the OS made of? The architecture shown below is applicable for Unix and its family – Including Linux Hardware Shell Kernel and system software Users Other Applications

  14. What the hell are these….. • User – The system representation of the human operator who requests for services. • Application Software – Special software to help the user do his task (E.g.. MS Word) • Shell – The program that interprets the commands or requests given by the user and gets the job done by the kernel. • Kernel – The core of the operating system. It uses the hardware to do the jobs required by the user or the system. It coordinates among the hardware and interfaces it with the above layers. • System Software – Software that can access the hardware directly and generally provides various system services. (E.g.. The kernel itself, device drivers etc.). • Hardware – The set of electronic devices that work together to ultimately do the job required by all the upper levels.

  15. Why Unix or Linux?How the hell are they different from others? Types of Operating Systems – Access based – • Single User – Only one user can access the OS at a time. E.g. DOS, Windows 9x • Multi User – Multiple users can access the OS at the same time. E.g. Unix, Windows NT, Linux Processing Based • Single processing – Only one process (job) has control of the whole system at a time. E.g. DOS • Multi Processing – Multiple processes (jobs) control defined domain of their own. E.g. Windows (All versions), Unix, Linux Environment Based • Stand alone – Does not support connection from other systems. E.g. DOS, Windows 9x, Workstation versions of Windows NT • Networking – Supports connection from other systems. E.g. Unix, Linux, Server versions of Windows NT

  16. My God…One OS! One Machine! Multiple jobs? Techniques of Multiprocessing – • Multiprogramming • Timesharing Note that Multiuser is maintained using multiprocessing techniques – especially timesharing technique. Multiprogramming: When one process waits to get some job done which does not requires the CPU, instead of sitting idle the CPU picks up another process to work on. Timesharing: The CPU time is equally divided among the processes in small slots. Small equal sized time slots are defined and allocated to the processes.

  17. Closer look to the above techniquesP1, P2, P3 are three different processes Multiprogramming P1 Run Wait Run Wait Wait Wait Wait Run Run P2 Wait P3 Run Wait Run Wait Wait Wait P1, P2, P3 Run Run Run Run Run Run Any Advantage?

  18. So what is timesharing? P1 P2 P3 Normal Time interval P1 Completed I/O Started by P1

  19. So which is better?Multiprogramming or Timesharing • Multiprogramming maximizes CPU utilization • Time-sharing minimizes user response rime • What about the Throughput?

  20. Processes • A process is • Normal: A program in state of execution • Waste of words: An instance of a program running on a computer • Fundoo…: The entity that can be assigned to and executed on a processor • More fundoo?... A unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources

  21. Parts of a Process • Components of a process • An executable program • Associated data required by the program (variable, work space, buffer, etc.) • Execution context: internal data used by O.S. to supervise a process = process state. Process list Main memory data context context data Program code Program code

  22. Process Control Block A data structure by which the system identifies a process.It contains - • Identifier: A unique integer associated with a process • State : A currently executing process is in running state • Priority : Priority level relative to other processes • Program counter : Address of the next instruction of the • program to be executed. • Memory pointers: pointers to the program code and data • associated with the process, and any shared memory blocks • Context data: Data in the registers in the processor during • process execution. • I/O status information: outstanding I/O requests, I/O devices • allocated to the process, a list of files is use by the process, etc. • Accounting information: amount of processor time, etc.

  23. Other fundas…Resource ManagementResponsibilities of the OS in Resource Management • Scheduling – The management of the queue of processes so as to make the decisions of when to execute which process. • O.S. manages the resources of a computer system and rations them among the processes. • Factors for scheduling policy: • Fairness: processes competing for a resource should be given fair chance of resource access • Differential responsiveness: O.S. should make allocation and scheduling decisions to meet total set of requirements, and in a dynamic manner. E.g., if a process is waiting for an I/O device, O.S. may schedule that process as soon as the device is free. • Efficiency: Maximize throughput, minimize response time, and accommodate as many concurrent users as possible.

  24. Memory Management The OS manages the computer’s memory and allocates memory to processes and data. Out of various memory management schemes the mot used nowadays is Virtual Memory. The fundas for Virtual Memory are given below… • A facility that allows programs to address memory from a logical viewpoint • Disregards the amount of physical memory actually available • Meets the requirements of multiple user processes to reside simultaneously in main memory without any interference • (Demand) Paging system and Page faults • Address of a word of a program = page number + offset within page • Pages vs. Blocks mapping

  25. Physical memory is not alone now…!!! It uses a fast disk (Backing store) to keep the parts of the processes not in use at the moment of time. The process's memory (also called logical memory) is divided into pages of equal size and kept in the backing store. The pages are brought in t the physical memory as and when required. The pages are kept in blocks created in the physical memory called frames. The sizes of frames and pages are equal. The allocation of block to a page depends upon the allocation policy used by the system.

  26. Then how does it manage the disk?Storage Management… Auxiliary Memory (Secondary Memory/Non-Volatile Memory – Mainly Disks) are used to store data permanently. The unit of data storage on the Disk is called a File. A File is a logical structure that stores a chunk of data in the memory (specially auxiliary memory). A Directory is a logical group of files which is used to manage the manage the files on the disk. File Management – The way the OS stores the files on the disk and keeps track of each of the files is called File Management. File System – The logical arrangement of files and metadata (Data about data) on a disk is known as the file system File System – By File System we also mean the tree of directories and files that is logically created in the memory.

  27. How does the tree look?Shown below is typically a part of the Unix/Linux file system / root bin home dev etc usr donkey monkey yankee bin sbin america schedule washington texas california I am a directory I am a file The above diagram is only a part of the file system. The tree can be bigger and any number of nodes can exist under another.

  28. C: D: / / Typical example of a DOS/Windows file system.The names of common directories have been left to the reader to fill up.

  29. Directory Structure of Linux File System

  30. Some important conceptsData Communication Data Communication is an important function of the Operating System. Communication always takes place between two processes. This is because processes are the only active entity inside a computer system. The punch word in Data Communication is IPC (Inter Process Communication). IPC is the communication of data between two processes. Different Techniques of IPC are • Message Passing – Data is sent from one process to another via the kernel and other subsystems. • Shared Memory – A location of the memory is shared between two processes – one process writes data to the location and another process reads the data.

  31. Some technologies to implement the IPC concepts • Pipes – A virtual data flow is established between two processes. The shared memory concept is implemented using pipes. • Sockets – A logical connection point is opened for a process. The kernel an network subsystems take responsibility to efficiently manage the sending and receiving of data. The message passing concept is implemented in this way. • Memory Mapped Files – A portion of the memory is mapped to a file. Whatever is written to the file gets written to the memory an vice versa. The shared memory concept is implemented in this way.

  32. Security and ProtectionThe system may be vulnerable to attacks More the functionalities in the system more the loop holes and more vulnerable to external or internal attacks Are they the same things? No. Security is protecting a system against unauthorized attacks (Mostly external). Protection is protecting the components of the system from damage, blocking and unavailability of resource.

  33. Who is going to attack? There are various types of intruders • Naïve Users – These are kind of people who have a long nose and have nothing to do. They know less but keep on checking out places for other people’s data (Mails etc.). • Skilled Users – These are people like inquisitive students who are more or less skilled and try out ways to access things they are not meant to just for fun or to learn. • Purposeful Intruders – These people do nasty jobs on purpose – e.g. Hacking the Military Data of enemy nation, Hacking confidential data of the rival company, etc.

  34. Some well known security threats • Viruses – These are malicious codes that believe in infecting some data and spread. They generally come from infected removable storage media (floppies, CD’s) or recently they are also coming with mails on the internet. The viral code is generally executed by the user unknowingly. They reside as a part of some important program, file or metadata (Partition Table, Boot Sector etc.) and are activated whenever the innocent infected data is read or executed. When active it tries to search for other such files or data where it can copy itself. • Trojans – These are sent to a person by an intruder on purpose. The program is sent with some innocent looking program or file and the user runs it unknowingly. The program when active acts as a server. The intruder can connect to it from the remote machine and command it to do malicious jobs in the recipient's computer. • Worms – These consist of two parts one is called the loader and the other is the worm itself. The loader is rather innocent program which is sent to somebody on the network. This loader later on loads the worm onto this computer. Whenever the worm finds that the network is on it sends the loader to the connected machines and thus it spreads.

  35. Continued • Spoofing – This is a method to access a system one is not meant to access. The intruder takes form of a valid user or process and enters the system. • Phising – This is a hacking method very much in use nowadays. The intruder creates a login screen similar to some well known site or system (Yahoo/ Google/ Unix or Linux login screen) and puts in online. Some way the fake login screen is run when the user needs to login. The user delivers the username and password without the knowledge of what is actually happening and this data is stored to a database accessible by the intruder.

  36. Some ways to tackle intruders • Passwords – • Good passwords – Mixture of numbers, letters of different case is a good security measure. Passwords ideally should not carry any personal information. These steps make it difficult to guess passwords. • Periodically changing passwords – Some systems allow us to specify passwords and specify some period within which the password will have to be changed. • Recursive Passwords – This is a technology in which each time a password is used, it is re-encrypted or changed automatically. The user is given a list of passwords for a period of time. If that list is secured, the user’s data is secured.

  37. Encryption Key Decryption Key Encryption Algorithm Decryption Algorithm Plaintext P Plaintext P Ciphertext C B A Continued • Encryption – However good a password is, it is of no use without a good encryption algorithm protecting it. Encryption is a technique of generating a new text by applying some functions on the original text. The new text is called Cipher text. Some encryption algorithms allow the Cipher text to be Decrypted to the original text and some don’t.

  38. Continued • Antiviruses – These are programs which catch Viruses (Nowadays they detect all malicious programs – Trojans, Worms etc.) either when they are resident on the disk in some form or when trying to enter the system from some source. • Firewalls – Firewall blocks access of the system by any means from some specified external machines. So we create a firewall against some machine if we distrust it. However inspite of all these security measures, 100% security can never be ensured as any functionality in the system adds to the loopholes.

  39. Protection The components in a system can also be vulnerable to internal malfunctioning. Just consider the situation that normal users are allowed to add new users. So any body can be bribed or made to create a new user which makes intrusion so easy. Let’s take another situation. Just suppose that a normal user can modify the configuration file that contains information for the network configuration. As he does not have the knowledge of the full network, his modifications may lead to a situation that the next day the network doesn’t work. Securing the components of the system against these kinds of problems is known as Protection.

  40. Ways to ensure protection The most widely used technique for ensuring protection is maintaining an access matrix. The components of the system are called entities. A matrix is maintained with the “entities to protect” on one axis and “entities to protect from” on the other. The cell corresponding to these two contain the access rights (Who can access what).

  41. That ends our discussion on Operating Systems Books suggested – Process Management , Memory Management, Storage Management – Fundamentals of Operating Systems, Silbershatz, Galvin Security, Encryption – Modern Operating Systems, Tanenbaum Happy Studying!!!!

More Related