1 / 45

Linux Overview

Linux Overview. Linux is a 32-bit operating system Multi-platform, most popular are Intel x86, Sparc, Alpha and Power PC On alpha platform, actually operates as 64-bit operating system Did not advance the state of the art

joshwa
Download Presentation

Linux Overview

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. Linux Overview Linux is a 32-bit operating system Multi-platform, most popular are Intel x86, Sparc, Alpha and Power PC On alpha platform, actually operates as 64-bit operating system Did not advance the state of the art Linux can and should be considered a full implementation of UNIX, but cannot be called UNIX because the word UNIX is a trademark owned by AT&T Open Source means that Linux is free to everyone and can even be sold for a profit, but the all source code must be available as stated in the Public License Agreement Open Source also means that any any problems are found and updated and redistributed much faster than any commercial operating system. Open Source does not mean that Linux is any less reliable than commercial operating systems, maybe even more reliable.

  2. Linux Overview Continued Linux has been comercially successful, even though it was not developed by a commercial orgainzation. Every email sent has up to a 50% chance of being handled by Linux Sendmail. Linux has been economically successful, it has been packaged and sold for-profit by companies such as Red Hat, Debian, SuSe, Caldera, Mandrake and Slackware. Linux is the first full blown operating system that is open source, on top that it is very reliable, for this reason it is very technically successful. There is no customer support for Linux. This is because the companies who sell Linux did not write all of the code included in the distribution. However Usenet groups such as www.dejanews.com have answered many questions about Linux.

  3. Linux Overview Continued Usenet groups are how Linus Torvalds announced his project named Linux to the world, and gave a place for interested people to look and possibly contribute to the project. Linux was originally designed to exploit the new instructions added to the Intel x86 architecture with the introduction of the 386 processor. Linux has evloved to become primarily a network operating system like UNIX. Linux is very scalable and is equally at home on a server or a workstation. With the recent introduction of Red Hat Package Management (RPM), it has become even easier to install software packages to suit specific needs. Linux is highly reliable and has been known to run for as long as five years without rebooting. Linux is still very difficult to configure and it is easier to re-install everything in order to upgrade to a newer version than it is to patch in new libraries and re-compile the kernel.

  4. Linux Overview Continued X-windows has made Linux a graphical operating system X-windows is very customizable and the user may change it to look and act however he/she wants by using different window managers. Fvwm95 makes Linux look and act like Microsoft Windows 95/98, however the underlying operating system is still Linux and it is still much more stable than Microsoft. Recently Linux has been seen media attention due to the Microsoft Anti-Trust hearing because Microsoft claimed that Linux is a viable alternative to Microsoft Windows. Linux has been gaining popularity due to it’s low cost (free) and it’s growing support by major software developers such as Oracle, Corel, Netscape and game developers such as IdSoftware who makes Quake and Quake II for Linux. Many hardware developers are also releasing Linux drivers for their products. Especially hardware where speed and efficiency is critical such as 3dfx, Nvidia and sound card Manufacturers.

  5. Linux Overview Continued Printers are still very difficult to configure in Linux because they must use generic drivers. Hp sells it’s own distribution of UNIX and does not provide driver support for it’s own printers. Dell has recently begun selling a computer that comes pre-configured with Linux installed. This is the first time in history that a major computer company has manufactured a PC that comes with Linux. Some people say that Linux was done right because it is very scalable, customizable and reliable. Some people say that Linux was done wrong because it is not easy to configure or use. Ease of use is something that would limit a system that would limit a very scalable and customizable system. For this reason, Linux was done right.

  6. Data Structures • An organization of information • Data about relative subject put into a form that can be managed and understood • Memory Management • Process Management • File Management

  7. Memory Management • Basics on how Memory Management Works • Physical Memory • Actual memory available on system (hardware) • Virtual Memory • Memory created by the system/OS • Must map to physical memory

  8. Pages • Memory is broken up into Pages • Page Size • 4 kilobytes in x86 system • 8 kilobytes in Alpha sytsem • Pages are managed by structure called Page Table • Main purpose is to translate between physical and virtual memory addresses

  9. What a Page Table Looks Like

  10. Page Table • Translation from Virtual to Physical Memory • Each slot holds information about location of actual physical address • There are several Page Tables for each mapping • Traverse 2 times on a x86 processor • Traverse 3 times on an Alpha Processor

  11. Slots of The Page Table • Each Slot Contains Information about the Page • Physical Page Address • Access Rights • Can page be written to? • Can page be executed? • Valid Flag • If not valid passed on to operating system for error control

  12. Other Memory Data Structures • Mem_map • Contains information about each page • Sections of mem_map • Count – Used only if there are more then one processor using the page • Age – Keeps track of how long page has been in memory, when it was last accessed, etc. • Map_nr – Holds the physical address location

  13. Free_Area Data Structure • Hold information about blocks of memory • Main use is for finding and releasing pages in memory • Free_area is an array • 1st Element – Sets of 1 page • 2nd Element – Sets of 2 pages • 3rd Element – Sets of 4 pages • Etc.

  14. Process Data Structures • Goal of Linux Process Management is to have a process on a processor at all times • Each process has its own data structure • Task_struct • Task vector array contains pointers to every task_struct on the system

  15. Task_Struct Areas • State • The current running state of the process • Running, Waiting, Stopped, Zombie • Scheduling Data • When the process will run • Identifiers • Every process has a unique identifier number • Each process also contains a User and Group identifier Number

  16. Task_Struct (Cont.) • Links • Holds pointers to the parent processes • No such thing as an independent process in Linux except for very first process • Time • When process created and how much CPU time used (measured in jiffies)

  17. Task_Struct (Cont.) • File System • Pointers to every open file descriptor • Virtual Memory • Tracks Virtual Memory mappings • Processor Context • When the process is put on hold, the context is stored here

  18. File System Data Structures • 2 main file system structures • Fs_struct • Files_struct

  19. Fs_struct • Hold pointers to the process virtual file system nodes (explained later) and the umask • The umask is the mode that new files are in when they are first created.

  20. Files_struct • Manages information about all of the files a process is using • Includes pointers for up to 256 files per file_struct • Every time a file is opened three descriptors are opened by default • Standard Input – programs read from • Standard Output – programs write to • Standard Errors – all errors go here

  21. File_struct (Cont.) • F_mode area tells what what mode file is in • Read only, read/write, write only • F_inode area points at the VFS inode which describes the file • F_ops area is a pointer to address vector • Contains functions that can be performed on files

  22. Memory Management in Linux • Virtual Memory Addressing • Uses a three level page table structure • Three types of tables • Page Directory • Each active process has one page directory in main memory. • Each entry in the page directory points to one page in the page middle directory • Page Middle Directory • Each entry in the page middle directory points to one page of the page table. • Page Table • Each entry points to one virtual page of the process.

  23. Virtual Memory Addressing Cont. • 4 fields in a virtual address starting from the left. • Index of the page directory • Index into the page middle directory • Index to the page table • Offset within the selected page of memory

  24. Memory Management Cont. • Page allocation • Mechanism for dealing with contiguous blocks of pages mapped to contiguous blocks of page frames. • Buddy system is used where the kernel keeps a list of contiguous page frame groups of a fixed size. • Groups can have 1, 2, 4, 8, 16, or 32 page frames. • Groups split and merged using buddy algorithm as pages are allocated and deallocated.

  25. Memory Management Cont. • Page Replacement • Modified version of Simple Clock Algorithm • Use bit replaced with an 8 bit age variable. • Age variable incremented every time page is accessed. • Age variable decremented periodicall by Linux • Larger the page variable, less likely it will be replaced • Kernel memory allocation • Based on the page allocation mechanism used for virtual memory. • Kernel memory can be allocated and deallocated in units of one or more pages using buddy algoritm

  26. Kernel memory allocation cont. • Minimum amount of memory that can be allocated using this system is one page. • Kernel also requires small short-term memory chunks in odd sizes • Linux uses a scheme called slab allocation to take care of these chunks

  27. File Management • File Systems • Linux has a large advantage in that it has many available file systems • VFAT/FAT – DOS/Windows • NTFS – Windows 2000/NT 4.0 • Ext2 – Extended File System – Linux • Many more available (see mount manpage for list) • Virtual File System (VFS) – Reason for so many available file systems

  28. Virtual File System • The virtual file system is a layer between the target file system and the system • Allows modular transparency for different file systems

  29. Ext2 File System • Data kept in data blocks • Trade off of space for less CPU usage • 1240 bytes takes up 2 blocks totaling 2048 bytes even though total space is 1240 bytes • Inodes • Holds which blocks file data will occupy • Access Rights of files • File modification type • Type of File

  30. Ext2 (Cont.) • Each file has one inode with a unique number identifier • Files that have access paths are directories • Superblocks • Holds information about the file system size and shape • Read when the file system is mounted • Holds vital information about starting blocks and block size and groups

  31. Processor Modes • Processor Modes • User Mode • Mode where user programs run • Cannot run privileged instructions • Kernel Mode • Mode that allows access to all kernel functions • Can run privileged instructions

  32. Privileged Instructions • “An instruction that can be executed only in a specific mode, usually by a supervisory program” – Stallings • In the case of Linux the mode that runs privileged instructions is the kernel mode • Privileged instructions are privileged so that the user cannot accidentally change something that could cause the system to crash • Examples of privileged instructions are I/O, process and memory instructions

  33. Uniprocessor or Multiprocessor? • Linux supports both uniprocessor and multiprocessor systems • Multiprocessors • Linux can run on any or all of the available processors, sharing memory between them

  34. Symmetric Multiprocessing • Linux uses symmetric multiprocessing • Allows Linux to run on any available processor or on multiple processors simultaneously • Current kernel supports up to 16 processors using SMP

  35. Process States in Linux • 5 process states in Linux • TASK_RUNNING • TASK_ZOMBIE • TASK_STOPPED • TASK_UNINTERRUPTABLE • TASK_INTERRUPTABLE

  36. Process States Cont. • TASK_RUNNING • Corresponds to both the running and ready states listed in the textbook. • TASK_ZOMBIE • Corresponds to the exit state in textbook. • Process is terminated but still must have its task structure in the process table.

  37. Process States Cont. • TASK_STOPPED • Process has been halted • Can only be resumed by an action from another process • Used in Debugging • No corresponding state in the textbook

  38. Process States Cont. • TASK_INTERRUPTABLE • Corresponds to Blocked in the textbook • Process is waiting for an event • I/O • Resource to become available • Signal from another process. • TASK_UNINTERRUPTABLE • Also corresponds to blocked state • Waiting directly on hardware conditions • Cannot accept signal from another process

  39. Deadlock • What is it? • “An impasse that occurs when multiple processes are waiting for the availability of a resource that will not become available because it is being held by another process that is in a similar wait state” – Stallings • Depending on the version of Linux deadlock can be handled different ways • Three ways to deal with deadlock • Deadlock prevention • Deadlock avoidance • Deadlock detection

  40. Deadlock Prevention • Tries to prevent deadlock from occurring by not allowing all three of the conditions for deadlock (mutual exclusion, hold and wait, no preemption)to occur or by checking for a circular wait • Advantages • Works well with processes that perform a single burst of activity • Disadvantages • Inefficiency • Preempts without much use and more often than necessary

  41. Deadlock Avoidance • Makes resource assignments based on potential for deadlock. If a process that has not started and might lead to deadlock then it is not started and if a process makes an incremental resource request that could lead to deadlock that request is denied. • Can result in initiation denial or allocation denial to prevent deadlock • Advantages • No preemption necessary • Disadvantages • Process can block for long periods of time • Future resource requirements must be known

  42. Deadlock Detection • Grants resources if possible and checks for a circular wait periodically • This strategy does not prevent deadlock but determines if deadlock exists • Advantages • No delays in process initiation • Disadvantages • Preemptive losses • Slower system performance depending on how often a check for circular wait is made

  43. Threads in Linux • Older versions of Linux used both Kernel-space threads and User-Space threads. • POSIX-threads are now a standard part of all modern Linux distributions. (multi-threaded) • LinuxThreads

  44. Scheduling in Linux • Based on the time-sharing technique • Scheduling is also based on a ranking process (priority) • Process priority is dynamic • Processes are preemptive • Supports symmetric multiprocessor architecture

  45. Scheduling limitations • Algorithm doesn’t scale well • Predefined time interval too large

More Related