Case Study of Linux Opertaing System

Embed Size (px)

Citation preview

  • 8/8/2019 Case Study of Linux Opertaing System

    1/18

    BY:

    Usama zarif

    Saad Mehmood

    Bakhtawar Taimoor

    Abuzar Khalid

  • 8/8/2019 Case Study of Linux Opertaing System

    2/18

    ` Introduction to linux.

    ` Advantages of linux

    ` User interface.

    ` Different versions of linux.` Process management in linux.

    ` Memory management in linux.

    ` Difference between linux and windows operatingsystem.

  • 8/8/2019 Case Study of Linux Opertaing System

    3/18

    ` Linux, in simplest terms is an operating system on a computer that enablesapplications and the users through GUI to access the devices on the computerto perform desired functions.

    ` The Linux operating system represented a $25 billion ecosystem in 2008.` Since its inception in 1991, Linux has grown large to become a force in

    computing, powering everything from the New York Stock Exchange to mobilephones, and supercomputers to consumer devices.

    ` One of the most noted properties ofLinux is where it can be used. Windowsand OS X are predominantly found on personal computing devices such asdesktop and laptop computers. Other operating systems, such as Symbian, arefound on small devices such as phones and PDAs, while mainframes andsupercomputers found in major academic and corporate labs use specializedoperating systems such as AS/400 and the Cray OS.

    ` Linux, which began its existence as a server OS and has become useful as a

    desktop OS, can also be used on all of these devices. From wristwatches tosupercomputers, is the popular description ofLinux capabilities.

  • 8/8/2019 Case Study of Linux Opertaing System

    4/18

    ` Low cost` Stability` Performance` Network friendliness

    ` Flexibility` Compatibility` Choice` Fast and easy installation` Full use of hard disk` Multitasking` Security` Open Source

  • 8/8/2019 Case Study of Linux Opertaing System

    5/18

    ` Users can control a Linux-based system through a command lineinterface (or CLI), a graphical user interface (or GUI), or throughcontrols attached to the associated hardware (this is common forembedded systems). For desktop systems, the default mode isusually graphical user interface, where the CLI is availablethrough terminal emulator windows or on a separate virtual console.

    ` On desktop machines, KDE, GNOME, and Xfce are the mostpopular user interfaces, though a variety of additional userinterfaces exist. Most popular user interfaces run on top of theXWindow System (often simply called "X"), which provides network

    transparency, enabling a graphical application running on onemachine to be displayed and controlled from another.

  • 8/8/2019 Case Study of Linux Opertaing System

    6/18

    ` Debian-based

    ` Knoppix-based

    ` Ubuntu-based

    ` Gentoo-based

    ` Pacman-based

    ` RPM-based

    ` Fedora-based

    ` Red Hat Enterprise Linux-based

    ` Mandriva Linux-based` PCLinuxOS-based

    `

  • 8/8/2019 Case Study of Linux Opertaing System

    7/18

  • 8/8/2019 Case Study of Linux Opertaing System

    8/18

    Process control and the ability for inter process communication is handled by

    the Linux kernel.

    TOOLS FOR WORKING WITH PROCESSES:

    ` accton - Turns process accounting on and off. Uses the file /var/log/pacct. To turn it on type"accton /var/log/pacct". Use the command with no arguments to turn it off.

    ` kill - Kill a process by number` killall - Send a signal to a process by name

    ` lastcomm (1) - Display information about previous commands in reverse order. Works only ifprocess accounting is on.

    ` nice - Set process priority ofnew processes.

    ` ps(1) - Used to report the status of one or more processes.

    ` pstree(1) - Display the tree of running processes.

    ` renice(8) - Can be used to change the process priority of a currently running process.

    ` sa(8) - Generates a summary of information about users' processes that are stored in the/var/log/pacct file.

    ` skill - Report process status.

    ` snice - Report process status.

    ` top - Displays the processes that are using the most CPU resources.

  • 8/8/2019 Case Study of Linux Opertaing System

    9/18

    Computer time onLinux systems is allocated in jiffies. A jiffie is amicroprocessor time slice. On most Linux systems it is 1/100 of a second.On some systems it is 1/1024 of a second. The Linux kernel controlsprocess scheduling. There are three types of scheduling:

    ` NORMAL - Referred to as other, this is the scheduling type set fornormalprograms

    ` FIFO - This is a real time scheduling priority. The FIFO term means the firstprocess started (first in) will be the first done (first out). The only time thistype of process exits is if it sleeps, is rescheduled, or if it must wait on otherkernel priorities to be done.

    ` RR - This is a round robin type of scheduling, where each task gets acertain amount of time then it must exit, yield control to the next task andget back into the task queue. This is a real time scheduling priority.

  • 8/8/2019 Case Study of Linux Opertaing System

    10/18

    Linux processes have the following characteristics:

    POLICY - normal or real time. Real time processes have ahigher priority thannormal processes.

    PRIORITY - The process priority. It is a number between -20 and 19. The value of -20 is the highest, and 19 is thelowest priority. Process priority can be set with thenice(1) command and changed using the renice(8)

    command.Inter-Process Communication

  • 8/8/2019 Case Study of Linux Opertaing System

    11/18

    The types of inter process communication are:

    ` Signals - Sent by other processes or the kernel to a specific process to indicate variousconditions.

    ` Pipes - Unnamed pipes set up by the shell normally with the "|" character to route outputfrom one program to the input of another.

    ` FIFOS - Named pipes operating on the basis of first data in, first data out.` Message queues - Message queues are a mechanism set up to allow one or more

    processes to write messages that can be read by one or more other processes.` Semaphores - Counters that are used to control access to shared resources. These

    counters are used as a locking mechanism to prevent more than one process from usingthe resource at a time.

    ` Shared memory - The mapping of a memory area to be shared by multiple processes.` Message queues, semaphores, and shared memory can be accessed by the processes if

    they have access permission to the resource as set up by the object's creator. The processmust pass an identifier to the kernel to be able to get the access.

  • 8/8/2019 Case Study of Linux Opertaing System

    12/18

  • 8/8/2019 Case Study of Linux Opertaing System

    13/18

    ` As there is much less physical memory than virtual memory theoperating system must be careful that it does not use thephysical memory inefficiently. One way to save physical memoryis to only load virtual pages that are currently being used by theexecuting program.

    ` Linux uses demand paging to load executable images into aprocesses virtual memory. Whenever a command is executed,the file containing it is opened and its contents are mapped intothe processes virtual memory. This is done by modifying the datastructures describing this processes memory map and is knownas memorymapping. However, only the first part of the image isactually brought into physical memory. The rest of the image is

    left on disk. As the image executes, it generates page faults andLinux uses the processes memory map in order to determinewhich parts of the image to bring into memory for execution

  • 8/8/2019 Case Study of Linux Opertaing System

    14/18

    ` If a process needs to bring a virtual page into physicalmemory and there are no free physical pagesavailable, the operating system must make room forthis page by discarding another page from physicalmemory.

    ` Linux uses a Least Recently Used (LRU) page agingtechnique to fairly choose pages which might beremoved from the system. This scheme involves everypage in the system having an age which changes asthe page is accessed. The more that a page is

    accessed, the younger it is; the less that it is accessedthe older and more stale it becomes. Old pages aregood candidates for swapping.

  • 8/8/2019 Case Study of Linux Opertaing System

    15/18

  • 8/8/2019 Case Study of Linux Opertaing System

    16/18

    ` Linux assumes that there are three levels of page tables. EachPage Table accessed contains the page frame number of the nextlevel of Page Table. Figure shows how a virtual address can bebroken into a number of fields; each field providing an offset into aparticular Page Table. To translate a virtual address into a physical

    one, the processor must take the contents of each level field,convert it into an offset into the physical page containing the PageTable and read the page frame number of the next level of PageTable. This is repeated three times until the page frame number ofthe physical page containing the virtual address is found. Now the

    final field in the virtual address, the byte offset, is used to find thedata inside the page.

  • 8/8/2019 Case Study of Linux Opertaing System

    17/18

    FIGURE..Figure of virtual address memory

  • 8/8/2019 Case Study of Linux Opertaing System

    18/18