1. Trang chủ
  2. » Ngoại Ngữ

operating system tutorial

97 328 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Operating System Tutorial

  • Audience

  • Prerequisites

  • Copyright & Disclaimer Notice

  • Overview

    • Definition

    • Memory Management

    • Processor Management

    • Device Management

    • File Management

    • Other Important Activities

  • Types of Operating Systems

    • Batch operating system

    • Time-sharing operating systems

    • Distributed operating System

    • Network operating System

    • Real Time operating System

      • Hard real-time systems

      • Soft real-time systems

  • Operating System Services

    • Program execution

    • I/O Operation

    • File system manipulation

    • Communication

    • Error handling

    • Resource Management

    • Protection

  • Operating System Properties

    • Batch processing

      • Advantages

      • Disadvantages

    • Multitasking

    • Multiprogramming

      • Advantages

      • Disadvantages

    • Interactivity

    • Real Time System

    • Distributed Environment

    • Spooling

      • Advantages

  • Operating System Processes

    • Process

    • Program

    • Process States

    • Process Control Block, PCB

  • Operating System Process Scheduling

    • Definition

    • Scheduling Queues

    • Two State Process Model

    • Schedulers

    • Long Term Scheduler

    • Short Term Scheduler

    • Medium Term Scheduler

    • Comparison between Scheduler

    • Context Switch

  • Process Scheduling Algorithms

    • First Come First Serve (FCFS)

    • Shortest Job First (SJF)

    • Priority Based Scheduling

    • Round Robin Scheduling

    • Multi Queue Scheduling

  • Operating System Multi-Threading

    • What is Thread?

    • Difference between Process and Thread

    • Advantages of Thread

    • Types of Thread

    • User Level Threads

      • Advantages

      • Disadvantages

    • Kernel Level Threads

      • Advantages

      • Disadvantages

    • Multithreading Models

    • Many to Many Model

    • Many to One Model

    • One to One Model

    • Difference between User Level & Kernel Level Thread

  • Memory Management

    • Dynamic Loading

    • Dynamic Linking

    • Logical versus Physical Address Space

    • Swapping

    • Memory Allocation

    • Fragmentation

    • Paging

    • Segmentation

  • Virtual Memory

    • Demand Paging

      • Advantages

      • Disadvantages

    • Page Replacement Algorithm

    • Reference String

    • First In First Out (FIFO) algorithm

    • Optimal Page algorithm

    • Least Recently Used (LRU) algorithm

    • Page Buffering algorithm

    • Least frequently Used (LFU) algorithm

    • Most frequently Used (LFU) algorithm

  • I/O Hardware

    • Overview

    • Daisy chain

    • Controller

    • I/O port

    • Polling

    • I/O devices

    • Direct Memory Access (DMA)

    • Device Controllers

  • I/O Software

    • Interrupts

    • Application I/O Interface

    • Clocks

    • Kernel I/O Subsystem

    • Device driver

  • File System

    • File

    • File Structure

    • File Type

      • Ordinary files

      • Directory files

      • Special files:

    • File Access Mechanisms

      • Sequential access

      • Direct/Random access

      • Indexed sequential access

    • Space Allocation

      • Contiguous Allocation

      • Linked Allocation

      • Indexed Allocation

  • Operating System Security

    • Authentication

    • One Time passwords

    • Program Threats

    • System Threats

    • Computer Security Classifications

  • Linux Operating System

    • Components of Linux System

    • Kernel Mode v/s User Mode

    • Basic Features

    • Architecture

  • About tutorialspoint.com

Nội dung

Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs The operating system is a vital component of the system software in a computer system This tutorial will take you through step by step approach while learning Operating System concepts Audience This reference has been prepared for the computer science graduates to help them understand the basic to advanced concepts related to Operating System Prerequisites Before you start proceeding with this tutorial, I'm making an assumption that you are already aware about basic computer concepts like what is keyboard, mouse, monitor, input, output, primary memory and secondary memory etc If you are not well aware of these concepts then I will suggest going through our short tutorial on Computer Fundamentals Copyright & Disclaimer Notice  All the content and graphics on this tutorial are the property of tutorialspoint.com Any content from tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com Failure to so is a violation of copyright laws This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the accuracy of the site or its contents including this tutorial If you discover that the tutorialspoint.com site or this tutorial content contains some errors, please contact us at webmaster@tutorialspoint.com ii Table of Contents Operating System Tutorial i Audience i Prerequisites i Copyright & Disclaimer Notice i Overview Definition Memory Management Processor Management Device Management File Management Other Important Activities Types of Operating Systems Batch operating system Time-sharing operating systems Distributed operating System Network operating System Real Time operating System Hard real-time systems Soft real-time systems Operating System Services Program execution 10 I/O Operation 10 File system manipulation 11 Communication 11 Error handling 12 Resource Management 12 Protection 12 Operating System Properties 13 Batch processing 13 Advantages 13 Disadvantages 14 Multitasking 14 iii Multiprogramming 16 Advantages 16 Disadvantages 16 Interactivity 17 Real Time System 17 Distributed Environment 17 Spooling 18 Advantages 18 Operating System Processes 19 Process 19 Program 20 Process States 20 Process Control Block, PCB 22 Operating System Process Scheduling 24 Definition 24 Scheduling Queues 24 Two State Process Model 26 Schedulers 27 Long Term Scheduler 27 Short Term Scheduler 27 Medium Term Scheduler 27 Comparison between Scheduler 29 Context Switch 30 Process Scheduling Algorithms 31 First Come First Serve (FCFS) 32 Shortest Job First (SJF) 33 Priority Based Scheduling 34 Round Robin Scheduling 35 Multi Queue Scheduling 36 Operating System Multi-Threading 37 What is Thread? 37 Difference between Process and Thread 38 Advantages of Thread 39 Types of Thread 40 User Level Threads 40 Advantages 40 Disadvantages 40 Kernel Level Threads 41 Advantages 41 iii Disadvantages 41 Multithreading Models 42 Many to Many Model 42 Many to One Model 42 One to One Model 43 Difference between User Level & Kernel Level Thread 44 Memory Management 45 Dynamic Loading 47 Dynamic Linking 47 Logical versus Physical Address Space 48 Swapping 49 Memory Allocation 50 Fragmentation 51 Paging 52 Segmentation 53 Virtual Memory 55 Demand Paging 57 Advantages 59 Disadvantages 59 Page Replacement Algorithm 60 Reference String 60 First In First Out (FIFO) algorithm 61 Optimal Page algorithm 61 Least Recently Used (LRU) algorithm 62 Page Buffering algorithm 62 Least frequently Used (LFU) algorithm 62 Most frequently Used (LFU) algorithm 62 I/O Hardware 63 Overview 63 Daisy chain 63 Controller 63 I/O port 64 Polling 65 I/O devices 66 Direct Memory Access (DMA) 67 Device Controllers 69 I/O Software 70 Interrupts 70 Application I/O Interface 71 iii Clocks 72 Kernel I/O Subsystem 73 Device driver 74 File System 75 File 75 File Structure 75 File Type 76 Ordinary files 76 Directory files 76 Special files: 76 File Access Mechanisms 77 Sequential access 77 Direct/Random access 77 Indexed sequential access 77 Space Allocation 78 Contiguous Allocation 78 Linked Allocation 78 Indexed Allocation 78 Operating System Security 79 Authentication 80 One Time passwords 81 Program Threats 82 System Threats 83 Computer Security Classifications 84 Linux Operating System 85 Components of Linux System 86 Kernel Mode v/s User Mode 87 Basic Features 88 Architecture 89 About tutorialspoint.com 90 iii CHAPTER Overview This chapter gives a basic idea about Operating System starting with definition of operating system, and its functions A n operating System (OS) is an intermediary between users and computer hardware It provides users an environment in which a user can execute programs conveniently and efficiently In technical terms, it is software which manages hardware An operating System controls the allocation of resources and services such as memory, processors, devices and information Definition An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs TUTORIALS POINT Simply Easy Learning Page Following are some of important functions of an operating System  Memory Management  Processor Management  Device Management  File Management  Security  Control over system performance  Job accounting  Error detecting aids  Coordination between other software and users Memory Management Memory management refers to management of Primary Memory or Main Memory Main memory is a large array of words or bytes where each word or byte has its own address Main memory provides a fast storage that can be access directly by the CPU So for a program to be executed, it must in the main memory Operating System does the following activities for memory management  Keeps tracks of primary memory i.e what part of it are in use by whom, what part are not in use  In multiprogramming, OS decides which process will get memory when and how much  Allocates the memory when the process requests it to so  De-allocates the memory when the process no longer needs it or has been terminated Processor Management In multiprogramming environment, OS decides which process gets the processor when and how much time This function is called process scheduling Operating System does the following activities for processor management  Keeps tracks of processor and status of process Program responsible for this task is known as traffic controller  Allocates the processor (CPU) to a process  De-allocates processor when processor is no longer required TUTORIALS POINT Simply Easy Learning Page Device Management OS manages device communication via their respective drivers Operating System does the following activities for device management  Keeps tracks of all devices Program responsible for this task is known as the I/O controller  Decides which process gets the device when and for how much time  Allocates the device in the efficient way  De-allocates devices File Management A file system is normally organized into directories for easy navigation and usage These directories may contain files and other directions Operating System does the following activities for file management  Keeps track of information, location, uses, status etc The collective facilities are often known as file system  Decides who gets the resources  Allocates the resources  De-allocates the resources Other Important Activities Following are some of the important activities that Operating System does  Security By means of password and similar other techniques, preventing unauthorized access to programs and data  Control over system performance Recording delays between request for a service and response from the system  Job accounting Keeping track of time and resources used by various jobs and users  Error detecting aids Production of dumps, traces, error messages and other debugging and error detecting aids  Coordination between other software and users Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems TUTORIALS POINT Simply Easy Learning Page File Type File type refers to the ability of the operating system to distinguish different types of file such as text files source files and binary files etc Many operating systems support many types of files Operating system like MS-DOS and UNIX has the following types of files: Ordinary files  These are the files that contain user information  These may have text, databases or executable program  The user can apply various operations on such files like add, modify, delete or even remove the entire file Directory files  These files contain list of file names and other information related to these files Special files:  These files are also known as device files  These files represent physical device like disks, terminals, printers, networks, tape drive etc These files are of two types  Character special files - data is handled character by character as in case of terminals or printers  Block special files - data is handled in blocks as in the case of disks and tapes TUTORIALS POINT Simply Easy Learning Page 76 File Access Mechanisms File access mechanism refers to the manner in which the records of a file may be accessed There are several ways to access files  Sequential access  Direct/Random access  Indexed sequential access Sequential access A sequential access is that in which the records are accessed in some sequence i.e the information in the file is processed in order, one record after the other This access method is the most primitive one Example: Compilers usually access files in this fashion Direct/Random access  Random access file organization provides, accessing the records directly  Each record has its own address on the file with by the help of which it can be directly accessed for reading or writing  The records need not be in any sequence within the file and they need not be in adjacent locations on the storage medium Indexed sequential access  This mechanism is built up on base of sequential access  An index is created for each file which contains pointers to various blocks  Index is searched sequentially and its pointer is used to access the file directly TUTORIALS POINT Simply Easy Learning Page 77 Space Allocation Files are allocated disk spaces by operating system Operating systems deploy following three main ways to allocate disk space to files  Contiguous Allocation  Linked Allocation  Indexed Allocation Contiguous Allocation  Each file occupies a contiguous address space on disk  Assigned disk address is in linear order  Easy to implement  External fragmentation is a major issue with this type of allocation technique Linked Allocation  Each file carries a list of links to disk blocks  Directory contains link / pointer to first block of a file  No external fragmentation  Effectively used in sequential access file  Inefficient in case of direct access file Indexed Allocation  Provides solutions to problems of contiguous and linked allocation  A index block is created having all pointers to files  Each file has its own index block which stores the addresses of disk space occupied by the file  Directory contains the addresses of index blocks of files TUTORIALS POINT Simply Easy Learning Page 78 CHAPTER 14 Operating System Security This section describes various security related aspects like authentication, one time password, threats and security classifications S ecurity refers to providing a protection system to computer system resources such as CPU, memory, disk, software programs and most importantly data/information stored in the computer system If a computer program is run by unauthorized user then he/she may cause severe damage to computer or data stored in it So a computer system must be protected against unauthorized access, malicious access to system memory, viruses, worms etc We're going to discuss following topics in this article  Authentication  One Time passwords  Program Threats  System Threats  Computer Security Classifications TUTORIALS POINT Simply Easy Learning Page 79 Authentication Authentication refers to identifying the each user of the system and associating the executing programs with those users It is the responsibility of the Operating System to create a protection system which ensures that a user who is running a particular program is authentic Operating Systems generally identifies/authenticates users using following three ways:  Username / Password - User need to enter a registered username and password with Operating system to login into the system  User card/key - User need to punch card in card slot, or enter key generated by key generator in option provided by operating system to login into the system  User attribute - fingerprint/ eye retina pattern/ signature - User need to pass his/her attribute via designated input device used by operating system to login into the system TUTORIALS POINT Simply Easy Learning Page 80 One Time passwords One time passwords provides additional security along with normal authentication In One-Time Password system, a unique password is required every time user tries to login into the system Once a one-time password is used then it cannot be used again One time password are implemented in various ways  Random numbers - Users are provided cards having numbers printed along with corresponding alphabets System asks for numbers corresponding to few alphabets randomly chosen  Secret key - User are provided a hardware device which can create a secret id mapped with user id System asks for such secret id which is to be generated every time prior to login  Network password - Some commercial applications send one time password to user on registered mobile/ email which is required to be entered prior to login TUTORIALS POINT Simply Easy Learning Page 81 Program Threats Operating system's processes and kernel the designated task as instructed If a user program made these process malicious tasks then it is known as Program Threats One of the common examples of program threat is a program installed in a computer which can store and send user credentials via network to some hacker Following is the list of some well-known program threats  Trojan horse - Such program traps user login credentials and stores them to send to malicious user who can later on login to computer and can access system resources  Trap Door - If a program which is designed to work as required, have a security hole in its code and perform illegal action without knowledge of user then it is called to have a trap door  Logic Bomb - Logic bomb is a situation when a program misbehaves only when certain conditions met otherwise it works as a genuine program It is harder to detect  Virus - Virus as name suggests can replicate them on computer system They are highly dangerous and can modify/delete user files, crash systems A virus is generally a small code embedded in a program As user accesses the program, the virus starts getting embedded in other files/ programs and can make system unusable for user TUTORIALS POINT Simply Easy Learning Page 82 System Threats System threats refer to misuse of system services and network connections to put user in trouble System threats can be used to launch program threats on a complete network called as program attack System threats create such an environment that operating system resources/ user files are mis-used Following is the list of some well-known system threats  Worm -Worm is a process which can choke down a system performance by using system resources to extreme levels A Worm process generates its multiple copies where each copy uses system resources, prevents all other processes to get required resources Worm processes can even shut down an entire network  Port Scanning - Port scanning is a mechanism or means by which a hacker can detects system vulnerabilities to make an attack on the system  Denial of Service - Denial of service attacks normally prevents user to make legitimate use of the system For example user may not be able to use internet if denial of service attacks browser's content settings TUTORIALS POINT Simply Easy Learning Page 83 Computer Security Classifications As per the U.S Department of Defense Trusted Computer System's Evaluation Criteria there are four security classifications in computer systems: A, B, C, and D This is widely used specifications to determine and model the security of systems and of security solutions Following is the brief description of each classification S.N Classification Type Description Type A Highest Level Uses formal design specifications and verification techniques Grants a high degree of assurance of process security Provides mandatory protection system Have all the properties of a class C2 system Attaches a sensitivity label to each object It is of three types Type B  B1 - Maintains the security label of each object in the system Label is used for making decisions to access control  B2 - Extends the sensitivity labels to each system resource, such as storage objects, supports covert channels and auditing of events  B3 - Allows creating lists or user groups for access-control to grant access or revoke access to a given named object Provides protection and user accountability using audit capabilities It is of two types  C1 - Incorporates controls so that users can protect their private information and keep other users from accidentally reading / deleting their data UNIX versions are mostly Cl class  C2 - Adds an individual-level access control to the capabilities of a Cl level system Type C Type D Lowest level Minimum protection MS-DOS, Window 3.1 fall in this category TUTORIALS POINT Simply Easy Learning Page 84 CHAPTER 15 Linux Operating System This section describes Linux operating system’s component and its functioning L inux is one of popular version of UNIX operating System It is open source as its source code is freely available It is free to use Linux was designed considering UNIX compatibility Its functionality list is quite similar to that of UNIX TUTORIALS POINT Simply Easy Learning Page 85 Components of Linux System Linux Operating System has primarily three components  Kernel - Kernel is the core part of Linux It is responsible for all major activities of this operating system It is consists of various modules and it interacts directly with the underlying hardware Kernel provides the required abstraction to hide low level hardware details to system or application programs  System Library - System libraries are special functions or programs using which application programs or system utilities accesses Kernel's features These libraries implements most of the functionalities of the operating system and not requires kernel module's code access rights  System Utility - System Utility programs are responsible to specialized, individual level tasks TUTORIALS POINT Simply Easy Learning Page 86 Kernel Mode v/s User Mode Kernel component code executes in a special privileged mode called kernel mode with full access to all resources of the computer This code represents a single process, executes in single address space and not require any context switch and hence is very efficient and fast Kernel runs each process and provides system services to processes, provides protected access to hardware to processes Support code which is not required to run in kernel mode is in System Library User programs and other system programs works in User Mode which has no access to system hardware and kernel code User programs/ utilities use System libraries to access Kernel functions to get system's low level tasks TUTORIALS POINT Simply Easy Learning Page 87 Basic Features Following are some of the important features of Linux Operating System  Portable - Portability means software can works on different types of hardware in same way Linux kernel and application programs support their installation on any kind of hardware platform  Open Source - Linux source code is freely available and it is community based development project Multiple teams works in collaboration to enhance the capability of Linux operating system and it is continuously evolving  Multi-User - Linux is a multiuser system means multiple users can access system resources like memory/ ram/ application programs at same time  Multiprogramming - Linux is a multiprogramming system means multiple applications can run at same time  Hierarchical File System - Linux provides a standard file structure in which system files/ user files are arranged  Shell - Linux provides a special interpreter program which can be used to execute commands of the operating system It can be used to various types of operations, call application programs etc  Security - Linux provides user security using authentication features like password protection/ controlled access to specific files/ encryption of data TUTORIALS POINT Simply Easy Learning Page 88 Architecture Linux System Architecture is consists of following layers  Hardware layer - Hardware consists of all peripheral devices (RAM/ HDD/ CPU etc.)  Kernel - Core component of Operating System, interacts directly with hardware, provides low level services to upper layer components  Shell - An interface to kernel, hiding complexity of kernel's functions from users Takes commands from user and executes kernel's functions  Utilities - Utility programs giving user most of the functionalities of an operating systems TUTORIALS POINT Simply Easy Learning Page 89 APPENDIX A About tutorialspoint.com Tutorials Point is not a commercial site, this site has been created just for educational purposes and to help the people who are enthusiastic to learn new technologies Tutorials Point is aiming to provide the Best Training Materials on highly demanding technical and managerial subjects like:                          Python Ruby HTML5 CSS JavaScript and related frameworks Ruby on Rails JAVA and related technologies PMP Exams Earned Value Management Six Sigma Parrot AJAX PHP Programming HTML and XHTML CGI and Perl C Programming C++ Programming XML-RPC SOAP Communication HTTP Protocol Unix Makefile Web Services WSDL and UDDI Wi-Fi and WiMAX Many more TutorialsPoint is a FREE site and will remain FREE in future as well If you think it is worth to visit this website, kindly share it with your friends and colleagues Please send us your feedback at webmaster@tutorialspoint.com Thanks for visiting us TUTORIALS POINT Simply Easy Learning Page 90

Ngày đăng: 28/08/2016, 12:40

TỪ KHÓA LIÊN QUAN