Linux Os Overview Essay Research Paper The

Free Articles

Linux Os Overview Essay, Research Paper

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

The Linux Operating System The Linux Operating SystemThe following study contains a brief overview of the Linux operating system & # 8211 ; in peculiar, the system directors. First, the Linux interface is described, followed by the system directors: – memory manager- procedure manager- processor manager- file manager- device managerThis study is targeted at readers who have a general cognition of calculating and runing system basicss, and want to cognize a little more approximately Linux as compared to other runing systems in general. This study is a portion of a series which outlines some of the more popular commercially available runing systems. The Linux InterfaceThe Linux runing system has a user interface really much like that of Unix. Linux has command line interface on the most basic degree, but it besides incorporates the usage of a graphical user interface. The graphical user interface used by Linux is X-windows. X-windows, unlike traditional Personal computer windowing systems, is wholly decoupled from the underlying operating system, so much so that, in theory, another windowing system could be installed alternatively of X-windows without doing any difference to the underlying operating system. This, nevertheless, is wholly unneeded as X-windows topographic points no restraints upon any graphical plans with regard to window ornaments or sneak focus policies. This simply provides the model. X-windowsThe layout of the desktop, the expression and feel, is a map of a particular plan known as the window director. An X-windows window director provides window ornament, window province and arrangement, icon direction, mouse pointer focal point policy, popup bill of fare and user specified cardinal and sneak button bindings. There are many different window directors available for Linux / X-windows. Some of these emulate the Windows & # 8216 ; 95 expression and feel, others emulate the NextStep expression and feel and there are wholly different 1s once more. As one Linux user put it & # 8220 ; the user, non the package company, controls the expression and feel of the desktop & # 8221 ; . There are several extremely popular Linux shells commercially available to the populace: KDE, E-Desktop by Corel, Debian, and Gnome. Linux is & # 8220 ; unfastened beginning, & # 8221 ; intending that the existent codification is available publically. This allows a user with sufficient package development cognition to further orient the system to his/her preferences.The large advantage of X-windows over the traditional Personal computer windowing system is that it is web transparent. What that means is that XClients ( X-windows plans ) can expose on any XServer in the web. The XServer provides the model under which the XClients run. One practical application of this is that if some CPU intensive plan demands to be run, so it can be run on the most appropriate host, but the plan & # 8217 ; s expose can be on the local host. Some applications might merely be able to run on peculiar nodes, those with particular hardware devices attached or state a database installed. This poses no job for Xclients ; the XClient merely displays on whichever host it is told to. This allows for true multitasking across a web by leting for terminuss to merely run a shell that controls, via the web, another Linux machine transparently, without the user of the terminal detecting the difference. Of class, this wholly depends on web bandwidth.The X-windows system is non limited to Linux or to Unix at all. There are other shells presently commercially available for Windows.Another noteworthy property of the Linux operating system is its ability to take the basic functionality of the operating system, bundle it up utilizing a shell book such as PERL ( Programmers Extraction Report Language ) and basically add new functionality through scripting. This scripting is similar, but significantly more powerful, than the batch processing of MS-DOS. Memory ManagerThis subdivision will speak about how the Linux operating system manages memory, both physical and practical, and how plans are loaded into memory.Physical MemoryThe Linux meat uses a page distributor called a & # 8220 ; buddy heap & # 8221 ; to pull off physical memory for most instances. The infinites ( groups of pages ) in memory are organized in braces as follows: each little infinite of free memory in the system is unbroken path of, and each infinite has a sort of a & # 8220 ; sister & # 8221 ; infinite of free memory. If both become free at the same clip, they combine to make a larger free infinite, which, in bend can unite with it & # 8217 ; s larger sister infinite and organize an even larger infinite. By the same item, if a little occupation comes in to the system and doesn & # 8217 ; t suit good into any of the larger infinites, those larger infinites can be divided into two sibling infinites and the occupation will suit into one of them. If the infinite is still excessively big, the pieces will maintain dividing until an appropriate tantrum is found, or until the smallest size until is reached ( one page ) . In order to apportion memory country which is smaller than a page, the & # 8220 ; kmalloc & # 8221 ; service is used.The kmalloc service is used when a constituent of the operating system needs smaller blocks of memory, whose size may non be known in progress. The kmalloc service allocates pages which can so be split into smaller countries. These parts allocated by the kmalloc service can non be dis-allocated at a ulterior clip by the kmalloc system, which means that even in the instance of memory deficit, the kmalloc will non allow travel of memory that it has claimed.The Linux memory director uses two types of cache: the buffer cache and the page cache. The chief cache is the buffer cache, through which the input/output is performed to harrow thrusts and other such devices. Virtual MemoryThe Linux virtual-memory system keeps path of every reference location that some procedure can see. It shops the position of these references logically as follows: the instructions the practical memory director receives refering the province of the reference province is mapped. The address infinite looks like a set of parts which correspond to a practical reference keeping immediate pages of free memory. Each of these parts is associated with a set of belongingss ( read and compose privileges, associated files ) , and each part is sorted utilizing a binary hunt tree for fast entree. The meat besides maintains a 2nd, more physical position of the reference infinites, which is stored in the procedure page tabular array. This position is used to find the exact location in memory ( or on disc ) for each practical memory page. ProgramsLinux plans are loaded into memory utilizing the & # 8220 ; exec & # 8221 ; system call. When this happens, the pages of the plan are mapped into practical memory. When the plan goes to read a page, the page will lade into physical memory. Once the plan is running, the memory director needs to worry about associating with system libraries. This can be done all at one time upon burden of the plan by including the library maps in the feasible file ( inactive linking ) , or it can be done dynamically. The advantage of dynamic linking is evidently that it is uneconomical to bring forth transcripts of the same maps when we could acquire away with merely lading one transcript of the map ( as in the instance of dynamic associating ) . Linux implements Dynamic linking by reading the list of libraries that the plan will necessitate when the plan starts ( this information is embedded in the plan ) . Once the list is read, all of the library maps are mapped into practical memory in the same manner as the plan was, and as the pages are needed, they are brought into physical memory. Process & A ; Processor ManagementLinux is a concurrent execution and multiprocessing operating system. It organizes many procedures competing for the CPU & # 8217 ; s attending. Each viing procedure is kept as a separate entity, with its ain rights and properties. This allows each procedure to run independently, unaffected by another procedure crashing. Each procedure has its ain practical reference infinite and merely interacts with other procedures through kernel-managed mechanisms. The Linux scheduler chooses among procedures to happen the most appropriate one to run on the CPU. All of the properties and privileges of each procedure are stored in a information construction named task_struct. Linux so maintains an array, named undertaking, that contains arrows to every task_struct in the system. The undertaking array can keep a upper limit of 512 task_struct entries, therefore the system can hold a upper limit of 512 procedures at any one clip. Equally good, the current, running task_struct is pointed to by the current arrow. The task_struct informations construction contains all the information about a procedure. Its Fieldss can be divided into a figure of functional countries: -State-Scheduling Information-Identifiers-Inter-Process Communication-Links-Times and Timers-File System-Virtual Memory-Processor-Specific ContentThese countries each contain Fieldss that wholly define a procedure and let the procedure to be multiprogrammed. StateThe province of a procedure is specified as waiting, running, stopped, and & # 8220 ; zombie & # 8221 ; . Waiting indicates that the procedure is waiting for a resource or for an event to happen. Runing means that the procedure is either presently being executed on a CPU, or is ready and waiting to be executed on a CPU. Stopped indicates that the procedure has been stopped, which frequently happens when a plan is being debugged. Zombie indicates that the procedure is a dead procedure. Scheduling InformationThe scheduling information contained in the task_struct allows the scheduler to do a just determination as to which procedures should be allocated CPU clip. In Linux, there is no preemption of procedures by other procedures. Another procedure can non & # 8220 ; take & # 8221 ; the CPU off from the current, running procedures. It must wait until the running procedure relinquishes the CPU, such as when it has to wait for a system event like I/O. However, Linux does utilize preemptive programming to forestall a procedure without system calls from taking a disproportional sum of CPU clip. Each procedure is given a clip piece, normally about 200ms on the CPU, at the terminal of which, a new procedure is selected, and the old procedure must once more wait for its bend. The registries, program-counter, and other process-specific informations of the outgoing procedure are saved into its task_struct for the following clip that it receives processor attending. The registries, program-counter, and other process-specific informations of the new procedure are so loaded from its task_struct into the CPU. The Linux scheduler determines which procedure should be allocated CPU clip harmonizing to four Fieldss in the task_struct scheduling information: policy: The policy field indicates which scheduling policy should be applied to this task_struct. Linux supports two scheduling policies: normal and real-time. Real clip procedures will ever hold a higher precedence than normal procedures. Real-time procedures besides have two different types of policy: FIFO and round-robin. This is indicated here.

precedence: The precedence field indicates the precedence of the procedure. This is besides the sum of

time that the process will be allowed to run on the processor when it receives its turn. The time is measured in “jiffies”. rt_priority: The field indicates the priority of a real-time process. counter: This is the total amount of time left that the process is allowed to run on the processor for this turn. Each clock tick that the process has CPU-attention, this number is decremented by one. The process scheduler looks through the processes waiting for CPU time and gives the real-time processes a higher priority weighting than the normal processes. The priority assigned to a normal process is counter. The priority assigned to a real-time process is counter plus 1000. Because the current process has consumed some of its time-slice, indicated by the counter, it is has a disadvantage to other processes that have equal priority in the system. If several processes have the same priority, the one nearest the front of the queue will be selected and the current process will be placed at the rear of the queue. Linux supports symmetric multiprocessing (SMP). In an SMP system, each task_struct also contains the number of the processor that it is currently running on, stored in processor, as well as the last processor it ran on, stored in last_processor. Processes that last ran on a certain processor gain a slight priority advantage over processes last run on other processor, because there is usually a slight performance overhead in switching processors. A process can be restricted to one processor as well, by specifying a certain processor number in the processor_mask. IdentifiersEvery process in the system has a unique process identifier. It is a number. Each process also has user and group identifiers, which allow and disallow the process to have access to certain files and devices. According to the user and group identifiers, the process may be restricted to no access, read-only access, write access, etc. for certain files. LinksThe links information in the task_struct allows the process to be related to the process that created it. In Linux, every process in the system has a parent process, except for the initial system process. New processes are not created, but are cloned from previous processes. The task_struct of each process has pointers to its parent process, sibling processes, and children processes. (You can see a tree of the family relationships of the running processes in Linux by typing pstree at the command prompt.) Times and TimersInformation pertaining to time in the task_struct are the process creation time and the consumed CPU time during the process’s full lifetime. Each clock tick that this process has CPU attention, one “jiffy” is incremented in this field. As well, information about interval timers may be stored in the task_struct. Interval timers are used by processes to signal themselves when a certain time interval expires. Every clock tick, the jiffies in the interval timers are decremented, until they expire, signaling the process. File SystemThe task_struct contains two pointers to data structures that maintain file system information that is specific to the process. One of these pointers is fs, and it points to the fs_struct data structure. The other pointer is named files, and it points to the files_struct data structure. The fs_struct contains pointers to the process’s VFS inodes as well as the value of the umask, which is the default mode that new files will be created in. The files_struct contains the pointers to a file data structure for each of the files that the process is using. files_struct can contain a maximum of 256 different file pointers. The file data structures, pointed to by the files_struct, contain all relevant information about the process’s use of the files, for example, the position in the file that the next read or write will occur. There is always at least three files open for each process, standard input, standard output, and standard error. Virtual MemoryLinux uses demand paging. To implement this, in each process’ task_struct, there is a pointer to an mm_struct data structure that holds all information about the contents of each process’ virtual memory space, as well as contains information about the process’ loaded executable image and has a pointer to the process’ page table. Processor-Specific ContentThe process-specific content that must be saved when the CPU switches to serve another process is saved here. The registers, stacks, and program counter must be stored for the next time the process receives time on the CPU. The management of processes in Linux is done primarily through the maintenance of the task_struct data structure for each process. The task_struct contains all information about the process that is necessary to allow it to execute in this multiprogrammed environment. File ManagerFiles are organized on the Linux platform in a way quite similar to the UNIX platform. On a Unix system a file does not have to necessarily be a physical data block on a hard disk. Files can be used to represent other file system objects such as device drivers or network sockets. Underlying the Linux file system is the Virtual File System (VFS)The Virtual File System As with some of its other system features, Linux takes advantage of the principles of object-oriented design in the Virtual File System. Each object in the file system has two parts to it, the attributes of the object, and the operations to manipulate those objects. Within the VFS, there are three main object types as follows:+ Inode-object+ File-object+ File-system objectEach of the above objects has a defined set of operations that are accessed from a function table that each object points to. With this capability the VFS can perform a generic operation on these objects without having to know what kind of object it is actually dealing with. Therefore the object could be a networked file, a disk file, etc, and this would be transparent to the file system and to the user. An example of the power of the VFS is in the Linux Proc File System. This system treats each directory as an active process, and each directory contains information about that process. As a result, instead of querying the process manager in the operating system, information about active processes is read directly from the file system.File System HierarchyThe file-system object represents a connected set of files that forms a self contained directory hierarchy. The operating-system kernel maintains a single file-system object for each disk device mounted as a file system and for each networked file system currently connected. The VFS identifies every inode by a unique file system-inode number pair, and it finds the inode corresponding to a particular inode number by asking the file-system object to return the inode with that number. An inode-object represents the file as a whole, and a file-object represents a point of access to the data in the file. Directory files themselves are inode-objects, and are dealt with slightly differently from other files. The Linux programming interface defines a number of operations on directories, such as creating, deleting, and renaming a file in a directory. Figure 1.1 Linux File System HierarchyPhysical Disk Allocation On most standard Linux distributions the file system used is called Extfs32. This file system is based on the Berkley Software Distribution (BSD) Fast File System (ffs). Files are stored in a set of data blocks that are located through pointers in index blocks with up to three levels of indirection, the first index block being the files inode-object. Directories are a list of entries that include the following:+ the length of the entry+ the name of the file+ the inode number of the inode-object for the entryDisk space is allocated to files in blocks of 1 kilobyte, although block sizes of 2 and 4 kilobytes are available. These blocks are purposefully made small to guard against internal block fragmentation. Also blocks that are logically adjacent (such as in one file) are placed into physically adjacent blocks on the physical disk. The Ext2fs file system is partitioned into multiple block groups. When allocating a file, ext2fs must first select the block group for that file. For data blocks, it attempts to choose the same block group as that the file’s inode-object has been allocated. For inode allocations, it selects the same block group as the file’s parent directory. The Linux Operating System uses innovative means for file management. Fragmentation is very low and the file system is very scalable to other system uses. Device Manager The device I/O system in Linux is also very similar to the UNIX system. Linux device drivers work through a special kernel code that directly accesses the hardware. The kernel uses the special files to make the services that the device offers to normal user programs. One end of the file can be opened normally and the other end is attached to the kernel. So: hardware kernel special file user program and the same path back from user program to hardware; this is the general idea of how the I/O system works in Linux. Linux splits all devices into three classes: – block devices- character devices- network devices.Block devicesBlock devices are devices that allow random access to fixed-sized blocks of data, such as hard disk and floppy disk. Block devices provide functionality to ensure disk access is as fast as possible. In order to achieve this functionality, two system components are introduced: the block buffer cache and the request manager. l Block buffer cache: a pool of buffers for active I/O, and a cache for completed I/O.l Request manager: software that reads and writes buffer contents to and from a block-device driver.Character deviceDevices do not need to support all the functionality of regular files, such as a mouse. The kernel performs almost no preprocessing, but rather passes on the request to the device and let the device deal with it.Network deviceNetwork devices are dealt with differently from block and character devices. Networking is a key area of functionality for Linux. Linux supports the standard Internet protocols used for most UNIX-to-UNIX communications, but it also implements a number of protocols native to non-UNIX operating systems. These protocols are implemented under Linux as drivers that, at one end appears to the terminal system, and at the other end appears to the networking system. Three layers of software implement the Linux kernel: the socket interface, protocol drivers, and network-device drivers. ReferencesOperating System Concepts 5th Edition. Silberschatz, Abraham. Galvin, Peter Baer.http://www.grad.math.uwaterloo http://www.linux.org/http://www.itknowledge.com/reference/archive/0672310120/ewtoc.htmlSlackware Linux Unleashed, Third Edition (Publisher: Macmillan Computer Publishing) Author(s): Timothy Parker et al ISBN: 0672310120 Publication Date: 03/10/97

Post a Comment

Your email address will not be published. Required fields are marked *

*

x

Hi!
I'm Katy

Would you like to get such a paper? How about receiving a customized one?

Check it out