Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
31 views
Operating System
Os
Uploaded by
Madhu
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Operating system For Later
Download
Save
Save Operating system For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
31 views
Operating System
Os
Uploaded by
Madhu
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Operating system For Later
Carousel Previous
Carousel Next
Save
Save Operating system For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 25
Search
Fullscreen
Fifth Semester B.E. Degree Examination, Dec.2013/Jan.2014 Pp a a WE 4 3 3 Operating Systems A eS . Max. Maxi 0 7 Note: Answer FIVE full questions, selecting Fd ‘ at least TWO questions from each part. ~ i PART-A % z is N 2 1 a Explain thegdvantage of the layered approach with a neat diagrags\> (06 Marks) z b. What are vistybmachines? Explain its advantage with a neat gig (08 Marks) g ¢. What are the &Sseryial properties of batch, real time and di operating systems? g2 (06 Marks) 8 XV 4S 2 a. Differentiate berweenk7 ar i) Process anda ti © ii) Short term and sgn mney 3 iii) User level and kernel le 7 j £ iv) Waiting and tum around inom Ss (08 Marks) = i b. Consider the following set of proces th arrival time: 3 i Pi jurst Gime | Arrival time + 1 0 ae Re Topo = Py 2 1 aR OTF 4 Gr : 3 > Ps a 2, 33 i) Draw ax as using FCFS, SJF preemptive and tive scheduling. 3 it) Cale average waiting time for each of the sched rithm, (08 Marks) 23 c. il tions an operating system takes to context switch processes. 5 i x (04 Marks) § a 3 Dining-Philosopher’s problem using monitors. P10 Marks) ag Bi, is race condition? Explain Reader’s writer’s problem with semaphores. 7”, _(10 Marks) ia sy B= _ 4G" Forthe following snapshot find the safe sequence using Banker's algorithm: 32 \\ The number of resource units are Ri, Ro, Rs which are 7, 7, 10 respectively. th Process | Allocated resources | Maximum requirements RES SP R [RR ae Pi 272 73 3 6 8 i Rpt 2 ape fe | 4 ; (06 Marks) g b. Explain different methods to recover from deadlock. (06 Marks) = ©. Dead lock exists if a cycle exists. Yes or no. Justify your answer with a suitable example. (08 Marks) 1of2PART-B 5 a. Why are translation Joan-aside bubbles (TLB) important? In a simple paging system, what information is stored in TLB? Explain. (08 Marks) ». Given memory partitions of 100K, 500K, 200K, 300K and 600K, apply first fit bt best fit, algorithm to place 212K, 417K, 112K and 426K. . What is swapping? Does this increase the operating systems overhead? Justify aly ark) {isa file? Explain the different allocation methods. Axio Marks) are directories? Write a brief note on mounting file systems. AL OS Marts) Pepe ‘space managed? Explain, % (05 Marks) Ta put i between protection and security? Dee oy ‘scheme of capability lists to i protection. (10 Marks) b. Write short A i) Swap yement. ‘ il) Revocation Reet Vv (10 Marks) 8 a. What are the design princi of Linux operating ems? Explain, (08 Marks) b. What do you mean by clo1 yw is it achi¢yed, in Linux systems? (06 Marks) c table example, (06 Marks) ._ How is IPC handled in Linux? ws 20f21(a) Explain the advantages of the layered approach with a neat diagram (6 Marks) Ans: LAYERED APPROACH + The 0S is divided into 2 number of layers. + Each layer is built on the top of another layer. * The bottom layer is the hardware. The highest is the user interface (Figure 1.19). +A layer is an implementation of an abstract-object. Le. The object is made up of — data and — operations that can manipulate the data. ‘+ The layer consists of a set of routines that can be invoked by higher-layers. * Higher-layer — does not need to know how lower-layer operations are implemented — needs to know only what lower-layer operations do. + Advantage: 1. Simplicity of construction and debugging. * Disadvantages: 1. Less efficient than other types. 2. Appropriately defining the various layers.(°.’ a layer can use only lower-layers, careful planning is necessary). Figure 1.19 A layered OS 1(b) What are virtual machines? Explain its advantage with a neat (8 Marks) Ans: For answer, refer Solved Paper June-2013 Q.No.1c.1(c) What are the essential properties of i) Batch system Real time system and Distributed system? (6 Marks) Ans (i BATCH SYSTEMS * Early computers were physically enormous machines run from a console. ‘+ The common input devices were card readers and tape drives. ‘= The common output devices were line printers, tape drives, and card punches. The user — prepared a job which consisted of the program, the data, and control information » submitted the job to the computer-operator. The job was usually in the form of punch cards. ‘+ At some later time (after minutes, hours, or days), the output appeared. + To speed up processing, operators batched together jobs with similar needs and ran them through the computer as a group. * Disadvantage: 1. The CPU is often idle, because the speeds of the mechanical 1/0 devices. Ans (ii): REAL-TIME EMBEDDED SYSTEMS ‘+ Embedded computers are the most common form of computers in existence. + These devices are found everywhere, from engine/robot to VCR. «These devices can be used to perform a very specific task. * Usually, these devices run on are primitive operating systems. Therefore, operating systems provide limited features. + Usually, these devices spend their time monitoring & managing hardware devices such as — automobile engines and — robotic arms. ‘+ Almost always, embedded systems run real-time operating systems. * A real-time system is used when strict time requirements have been placed on the operation of a processor. Ans DISTRIBUTED SYSTEM * This is a collection of physically separate, possibly heterogeneous computer-systems. + The computer-systems are networked to provide the users with access to the various resources. * Access to a shared resource increases — computation speed — functionality — data availability and = reliability ‘+ A network is a communication path between two or more systems. = Networks vary by the = protocols used — distances between nodes and — transport media. ‘+ Common network protocol are » TCP/IP = ATM. ‘= Networks are characterized based on the distances between their nodes. = A local-area network (LAN) connects computers within @ building. — A wide-area network (WAN) usually links buildings, cities, or countries. — A metropolitan-area network (MAN) could link buildings within a city. * The media to carry networks are equally varied. They include — copper wires, — fiber strands, and — wireless transmissions.2(a) Differentiate between: i) Process and thread ii) User level and kernel level thread }) Waiting and turnaround time. iv) Short term and medium term scheduler (8 Marks) 1s (i): Sr. No. Process Thread 1 | Process is heavy weight or resource | Thread is light weight, taking lesser intensive. resources than a process. Z| Process switching needs interaction with | Thread switching does not need to ‘operating system. interact with operating system. 3 [In multiple processing environments, | All threads can share same set of open each process executes the same code but | files, child processes. has its own memory and file resources. ‘| If one process is blocked, then no other | While one thread is blocked and waiting, Process can execute until the first process | a second thread in the same task can is unblocked. run. 5 | Multiple processes without using threads | Multiple threaded processes use fewer use more resources. resources. 6 [in multiple processes, each process | One thread can read, write or change operates independently of the others. another thread's data. User-Level Threads ‘Kernel-Level Thread Implemented by a thread library at the user. ‘Supported directly by the OS vie system- calls. spent —+ waiting to get into memory — waiting in the ready-queue — executing on the CPU and = doing YO. 2 |The library provides support for thread | The kernel performs thread creation, creation, scheduling, and management | scheduling, and management in kernel with no support from the OS kernel Examples: 1) POSIX Pthreads 1) Windows xP/2000, li) Win32 threads Ii) Solaris il) Java threads i) Linux. 3 | User-level thread is generic and can run |Kernel-level thread is specific to the ‘on any operating system. operating system. 4 [Multi-threaded applications cannot take| Kernel routines themselves can be advantage of multiprocessing. multithreaded. 5 Advantage: Faster to create & manage | Disadvantage: Slower to create & because the kemel is unaware of user |manage than user threads decause threads and doesn't interfere. thread management Is done by the OS 6 _ | Disadvantage: User-level threads requires | Advantage: Kernel-level threads are non-blocking systems call i.e., a | especially good for applications that multithreeded kernel. frequently block. ‘Ans (iii) Sr. No. Turnaround Time Waiting Time 1 |The interval from the time of submission |The amount of time that a process of a process to the time of completion. | spends waiting in the ready-queue. 2 | ex: Entering the ATM card to the ATM| ex: Asking for Pin number in ATM and machine until the full process finished _| wait until the pin passed. 3 [Turnaround time is the sum of the periodsAns (iv): S.N. | Long-Term Scheduler | Short-Term Scheduler Medium-Term Scheduler 1 | itisa job scheduler. Tt is a CPU scheduler. Tt is @ process swapping scheduler. 2 [Speed is lesser than | Speed is fastest among other | Speed is in between both short term scheduler. | two. short and long term scheduler. 3 | It controls the degree of | It provides lesser control over | It reduces the degree of multiprogramming. degree of multiprogramming _| multiprogramming. 4 [it is almost absent or|It is also minimal in time | It isa part of Time sharing minimal in time sharing | sharing system. systems. system. 5 | It selects processes from | It selects those processes [It can re-introduce the pool and loads them into | which are ready to execute. | process into memory and memory for execution. execution canbe continued. 2(b) Consider the following set of process with arrival time: i) Draw grant chart using FCFS, SJF preemptive and non preemptive scheduling. ii) Calculate the average waiting and turnaround time for each process of the scheduling algorithm. (8 Marks) Process | Arrival Time | Burst Time PL 0 10 P2 0 1 PS 1 2 Pa 2 4 PS: 2 3 Ans: (i) FCFS: Pl P2] Ps Pa PS ° 1 1B 1 20 Average waiting time = (0+10+10+11+15)/5 = 9.2 Average turnaround time = (10+11+13+17+20)/5 = 14.2 (ii) SIF (non-preemptive): iP2] P3 Ps P4 PL oe. 6 10 20 Average waiting time = (10+0+0+4+1)/5 = 3 Average turnaround time = (20+1+3+10+6)/5 Gi SJF (preemptive! 2 | Average waiting time = (10+0+0+44+1)/5 = 3 Average turnaround time = (20+1+3+10+6)/5,2(c) Describe the actions an operating system takes to context switch between processes. (4 Marks) Ans: CONTEXT SWITCH * Context-switch means saving the state of the old process and switching the CPU to another process. * When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run. * The context of a process is represented in the PCB of the process; it includes — value of CPU registers — process-state and — memory-management information. * Disadvantages: 1. Context-switch time is pure overhead, because the system does no useful work while switching. 2. Context-switch times are highly dependent on hardware support.3(a) Explain Dining-Philosopher's problem using monitors. (10 Marks) Ans: DINING PHILOSOPHERS PROBLEM = Problem Objective: To allocate several resources among several processes in a deadlock-free & starvation-free manner (Figure 3.10). Figure 3.10 Situation of dining philosophers DINING-PHILOSOPHERS SOLUTION USING MONITORS The restriction: A philosopher may pick up her chopsticks only if both of them are available. * Description of the solution: 1. The distribution of the chopsticks is controlled by the monitor dp (Figure 3.15). 2. Each philosopher, before starting to eat, must invoke the operation pickup(). This act ‘may result in the suspension of the philosopher process. 3. After the successful completion of the operation, the philosopher may eat. 4. Following this, the philosopher invokes the putdown() operation. 5. Thus, philosopher i must invoke the operations pickup() and putdown() in the following sequence: ‘ap-piekup(); ot ép.putdown(i), ‘monitor dp : enum (THINKING, MUNGRY, EATING} condition salt {s} void pickup(ine 1) { state [i] = HUNGRY; test (i): if (szate(i) t= EATING) self (i) -wait); ) voId putcown(int 1) { state til = THINKING; teat (+a) #5) reat ( (4 62) #5) ) void test (int 4) ( if ((scare((i + 6) ¢ 5) {= EATING) Ge jacate (i) = HINGRY) Se ftate((i +1) 85) t= Ear: state [1] = EATING; self [1] .eigral snttsaltzation-code () { for (int 1-0; 1<5; ite) state [i] = THINKING; ) Figure 3.15 A monitor solution to the dining-philosopher problem3(b) What is race condition? Explain Readers writers problem. (10 Marks) An: RACE CONDITION * A situation where several processes access & manipulate same data concurrently and the ‘outcome of the execution depends on particular order in which the access takes place, is called a race condition. ‘To prevent race conditions, concurrent-processes must be synchronized. READERS-WRITERS PROBLEM * A data set is shared among a number of concurrent processes. + Readers are processes which want to only read the database (DB). Writers are processes which want to update (i.e. to read & write) the DB. + Problem: > Obviously, if 2 readers can access the shared-DB simultaneously without any problems. > However, if a writer & other process (either a reader or a writer) access the shared-DB simultaneously, problems may arise, Solution: > The writers must have exclusive access to the shared-DB while writing to the DB. + Shared-data Senaphore auter, wrt; Sse readeounty where, > ‘mutex is used to ensure mutual-exclusion when the variable readcount is updated. > wrt is common to both reader and writer processes. wrt is used as a mutual-exclusion semaphore for the writers. wrt is also used by the first/last reader that enters/exits the critical-section. > readcount counts no. of processes currently reading the object. Initialization mutex = 1, wrt = 1, readcount = 0 Writer Process: Reader Process: do { ao ( vait(resutex); watt (eutex) ; Feadcountes} (/+ writing ie performed */ if ead.cout == 1) ait (ruamutex) ; signal (ru.motex) ‘signal Gutex); V while (cru); /+ vending 49 parforned +/ 1 Guten) ; ead count; 4f (road.count = 0) signal (renutex) ; signal autex); V while (crue); * The readers-writers problem and its solutions are used to provide reader-writer locks on some systems. # The mode of lock needs to be specified: 1. read mode > When a process wishes to read shared-data, it requests the lock in read mode. 2. write mode > When a process wishes to modify shared-data, it requests the lock in write mode. ‘+ Multiple processes are permitted to concurrently acquire a lock in read mode, but only one process may acquire the lock for writing. ‘+ These locks are most useful in the following situation: 1. In applications where it is easy to identify = which processes only read shared-data and >: which threads only write shared-data. 2. In applications that have more readers than writers.4(a) For the following snapshot, find the safe sequence using Banker's algorithm: The number of resource units is (A, B, C) which are (7, 7, 10) respectively. (6 Marks) Allocation Max. aleiclals[clalB[c pif2[2/3|3/6|s|7|7|10 p2t2tol3l4{[3{3 psfil2tal[3la[a Ans: Solution: * The content of the matrix Need is given by Need = Max - Allocation * So, the content of Need Matrix is: Need AlBic Pililals p2t2 {3 0 p3[2 [2 To * Applying the Safety algorithm on the given system, Step 1: Initialization Here, m=3, n=3 Work = Available i.e. Work =7 7 10 P: bone. Finish = | false | false | false Step 2: For i=1 Finish[P1] = false and Need[P1]<=Work i.e, (1 4 5)<=(7 7 10) > true So P1 must be kept in safe sequence. Step 3: Work = Work + Allocation[P1] =(7 7 10)+(2 2 3)=(9 9 13) Step 2: For I=2 Finish[P2] = false and Need[P2]<=Work i.e. (2 3 0) <=(9 9 13) > true So P2 must be kept in safe sequence. Step 3: Work = Work + Allocation[P2] =(9 9 13)+(2 0 3)=(11 9 16) true | true | false Finish =3 ish[P3] = false and Need[P3]<=Work i.e. (2 2 0)<=(11 9 16) > true So P3 must be kept in safe sequence. Step 3: Work = Work + Allocation[P3] = (11 9 16)+(1 2 4)=(12 11 20) pa PD PQ eee PBaa Finish = | true | true | true Step Step 4: Finish[Pi] = true for 1<=i<=3 Hence, the system is currently in a safe state. The safe sequence is
. Conclusion: Yes, the system is currently in a safe state.4(b) Explain different methods to recover from deadlock. (6 Marks) Ans: PROCESS TERMINATION + To remove deadlocks, following 2 methods can be used: 1. Abort all deadlocked processes. > This method clearly will break the deadlock cycle. » This method incurs great expense. This is because — Deadlocked-processes may have computed for a long time. — Results of these partial computations must be discarded. — Probably, the results will have to be recomputed later. 2. Abort one process at a time until the deadlock cycle is eliminated. > This method incurs large overhead. This is because after each process is aborted, deadlock-detection algorithm must be invoked to determine whether any processes are still deadlocked + For process termination, many factors need to be considered. They are: . What is the priority of process? . How long the process has computed? . How many resources are used by the process? . How many extra resources the process needs in order to complete? . How many processes need to be terminated for proper execution? . Whether the process is interactive or batch? OuawNE RESOURCE PREEMPTION ‘+ We pre-empt (prevent) some resources from processes. We give these resources to other processes until the deadlock-cycle is broken. + Three issues need to be considere: 1. Selecting a victim > Which resources and which processes are to be pre-empted? » We must determine the order of pre-emption to minimize cost. » Cost factors includes — number of resources being held ~ amount of time consumed by the process. 2. Rollback > If we preempt a resource from a process, the process can't go on with normal execution because it is missing a resource. > We must roll back the process to a safe-state and restart it. 3, Starvation > How do we ensure that starvation will not occur? > In a system where victim selection is based on cost-factors, the same process may always be picked. > To ensure a process can be picked few times, include the number of rollbacks in the cost-factor.4(c) Deadlock exists if a cycle exists. Yes or no. Justify your answer with a suitable example (8 Marks) Ans: RESOURCE ALLOCATION GRAPH * Deadlocks can be expressed in terms of directed-graph called resource-allocation graph (RAG). + RAG consists of a — set of vertices (V) and — set of edges (E). * The vertices (V) are divided into 2 types: 1) P= {Pi, Pz, .., Pa}. This set consists of all the active processes in the system. 2) R= {Ri, Ra, «= Rn} This set consists of all resource-types in the system. + Here, we have 2 types of directed-edges: 1) Request Edge ¥ A directed-edge P, — R, is called a request edge. > P, + R, indicates that — process P, has requested an instance of resource-type R, and —+ process P, is currently waiting for that resource R,. 2) Assignment Edge ¥ A directed-edge R, — P, is called an assignment edge. > R, +P, indicates that an instance of resource-type R, has been allocated to process P. + Pictorially, “+ We represent each process P, as a circle. — We represent each resource-type R, as a rectangl + As shown in below figures, the RAG illustrates the following 3 situation: 1) RAG with a deadlock 2) RAG with a cycle and deadlock 3) RAG with a cycle but no deadlock Ri] [Rs Figure 5.22 RAG with a deadlock Figure 5.23 RAG with a cycle and deadlock RL fo al RD he oD Figure 5.24 RAG with a cycle but no deadlock Conclusion: 1) If a resource allocation graph contains no cycles, then no process is deadlocked. 2) Ifa resource allocation graph contains a cycle, then a deadlock may exist. Therefore, a cycle means deadlock is possible, but not necessarily present.5(a) Why are translation loan-aside bubbles (TLB) important? In a simple paging system, what information is stored in TLB? Explain. (8 Marks) Ans: TRANSLATION LOOKASIDE BUFFER + Most OS's store a page-table for each process. * A pointer to the page-table is stored in the PCB. * The TLB is associative, high-speed memory. * The TLB contains only a few of the page-table entries. * Working: > When a logical-address 's generated by the CPU, its page-number is presented to the TB. > If the page-number is found (TLB hit), its frame-number is » immediately available and — used to access memory. > If page-number is not in TLB (TLB miss), a memory-reference to page table must be made. » The obtained frame-number can be used to access memory (Figure 5.10). > In addition, we add the page-number and frame-number to the TLB, so that they will be found quickly on the next reference. * If the TLB is already full of entries, the OS must select one for replacement. + Percentage of times that a particular page-number is found in the TLB is called hit ratio. * Advantage: Search operation is fast. Disadvantage: Hardware is expensive. * Some TLBs have wired down entries that can't be removed. * Some TLBs store ASID (address-space identifier) in each entry of the TLB that uniquely — identify each process and — provide address space protection for that process. logical adress ceu L-fe Td page fame umber number ie physical adress CTs} 713 118 miss pamnnd physical memory age table Figure 5.10 Paging hardware with TLB 5(b) Given memory partitions of 100K, 500K, 200K, 300K and 600K, apply first fit and best fits algorithm to place 212K, 417K, 112K and 426K. (4 Marks) Ans: For answer, refer Solved Paper June-2013 Q.No.5a.5(c) What is swapping? Does this increase the operating systems overhead? Justify your answer. (8 Marks) Ans: ‘SWAPPING * A process must be in memory to be executed. * A process can be — swapped temporarily out-of-memory to a backing-store and — then brought into memory for continued execution. * Backing-store is a fast disk which is large enough to accommodate copies of all memory-images for all users. + Roll out/Roll in is a swapping variant used for priority-based scheduling algorithms. > Lower-priority process is swapped out so that higher-pricrity process can be loaded and executed. > Once the higher-priority process finishes, the lower-priority process can be swapped back in and continued (Figure 5.5). operating ‘ysten ‘space backing store main memory Figure 5.5 Swapping af two processes using a disk as @ backing-store + Swapping depends upon address-binding: 1, If binding is done at load-time, then process cannot be easily moved to a different location. 2. If binding is done at execution-time, then a process can be swapped into a different memory-space, because the physical-addresses are computed during execution-time. ‘* Major part of swap-time is transfer-time; i.e. total transfer-time is directly proportional to the ‘amount of memory swapped. * Disadvantage 1. Context-switch time is fairly high. 2. If we want to swap a process, we must be sure that it is completely idle. Two solutions: i) Never swap a process with pending 1/0. ii) Execute 1/0 operations only into OS buffers.6(a) What is a file? Explain the different Ans: FILE * A file is a named collection of related information on secondary-storage. * Three methods of allocating disk-space: 1) Contiguous 2) Indexed and 3) Linked 1) CONTIGUOUS ALLOCATION * Each file occupies a set of contiguous-blocks on the disk (Figure 6.17) * Disk addresses define a linear ordering on the disk. + The number of disk seeks required for accessing contiguously allocated files is minimal + Both sequential and direct access can be supported. + Problem: 41. Finding space for a new file ¥ External fragmentation can occur. 2. Determining how much space is needed for a file > If you allocate too little space, it can't be extended. ‘Two Solutions: 1) The user-program can be terminated with an appropriate error-message. The user must then allocate more space and run the program again. ii) Find a larger hole, copy the contents of the file to the new space and release the previous space. ‘+ To minimize these drawbacks: 1. A contiguous chunk of space can be allocated initially and 2. Then, when that amount is not large enough, another chunk of contiguous space is added. location methods. (10 Marks) cctey com te aan enon nny aie] | con 0 2 aaa : er i ee ‘ ie |t. 3 e a0) eo} | 2 ¢ pee iy jiatellls 2060460 7 3 s
Here, normal file-system routines can be used to create it, name it, and allocate its space. » Advantage: This approach easy to implement, > Disadvantage: This approach is inefficient. This is because i) Navigating the directory structure and the disk structures takes time and extra disk accesses. ii) External fragmentation can greatly increase swapping times by forcing multiple seeks during reading or writing of a process image. 2) The swap space can be in a separate raw (disk) partition. > No file system or directory structure is placed in the swap space. Rather, a separate swap-space storage manager is used to allocate and de-allocate the blocks from the raw partition. >» This manager uses algorithms optimized for speed rather than for storage efficiency, because swap space is accessed much more frequently than file system.Ans ( REVOCATION OF ACCESS RIGHTS + In a dynamic protection system, we may sometimes need to revoke access rights to objects shared by different users. * Following questions about revocation may arise: 1. Immediate versus Delayed > Does revocation occur immediately, or is it delayed? > If revocation is delayed, can we find out when it will take place? 2. Selective versus General > When an access right to an object is revoked, does it affect all the users who have an access right to that object, or can we specify a select group of users whose access rights should be revoked? 3. Partial versus Total > Can a subset of the rights associated with an object be revoked, or must we revoke all access rights for this object? 4. Temporary versus Permanent > Can access be revoked permanently (that is, the revoked access right will never again be available), or can access be revoked and later be obtained again? * Schemes that implement revocation for capabilities include the following 1. Reacquisition > Periodically, capabilities are deleted from each domain. > If a process wants to use a capability, it may find that that capability has been deleted. > The process may then try to reacquire the capability. 2. Back-Pointers > A list of pointers is maintained with each object, pointing to all capabilities associated with that object. > When revocation is required, we can follow these pointers, changing the capabilities as necessary 3. Indirection > The capabilities point indirectly, not directly, to the objects. » Each capability points to a unique entry in a global table, which in turn points to the object. > We implement revocation by searching the global table for the desired entry and deleting it. 4. Keys > Akey is a unique bit pattern that can be associated with a capability. > This key is defined when the capability is created, and it can be neither modified nor \spected by the process that owns the capability,8(a) What are the design principle of Linux OS? Explain. (8 Marks) Ans: LINUX DESIGN PRINCIPLES * Linux is a multiuser, preemptively multitasking system with a full set of UNIX-compatible tools. * Linux's file systern adheres to traditional UNIX semantics. * The standard UNIX networking model is fully implemented. * Main design goals are speed, efficiency, and standardization * Linux is designed to be compliant with the relevant POSIX documents; at least two Linux distributions have achieved official POSIX certification. ‘management as vsiy ‘compliers Programs ere programs system shared libraries LUnux kemet loadable kemel modules Figure 15.1 Components of the Linux system COMPONENTS OF A LINUX SYSTEM * The Linux system is composed of 3 main bodies of code: 1. Kernel > The kernel is responsible for maintaining all the important abstractions of the operating system > The abstractions include i) virtual memory and i) processes. 2. System Libraries > The system libraries define a stendard set of functions through which applications can interact with the kernel. > These functions implement much of the operating-system functionality that does not eed the full privileges of kernel code. > The most important system library is the C library, known as libc. > libc implements + user mode side of the Linux system call interface, and > other critical system-level interfaces. 3. System Utilities > The system utilities are progrems that perform individual, specialized management tasks. > Some system utilities are invoked just once to initialize and configure some aspect of the system. > Other daemons run permanently, handling such tasks as — responding to incoming network connections — accepting logon requests from terminals, and = updating log files. * The system can operate in 2 modes: 1) Kernel mode 2) User mode. ‘Sr. No. Kernel Mode User Mode 1 [All the kernel code executes in the | Any operating-system-support code that processor's privileged mode with full | does not need to run in kernel mode is ‘access to all the physical resources of the | placed into the system libraries and runs computer. This privileged moce called as | in user mode. kernel mode 2 | No user code is built into the kernel. User mode has access only to a controlled subset of the system's resources.8(b) What do you mean by cloning? How is it achieved, in Linux systems? (6 Marks) Ans: CLONING * Linux provides the ability to create threads via the clone() system call. * The clone() system call behaves identically to fork(), except that it accepts as arguments a set of flags. * The flags dictate what resources are shared between the parent and child. * The flags include: tag ‘moaning cuowz_es | Filesystem information is shared. ‘cuowz_v# | Tho same memory spacais shared. cuows_srckap| Signal handlers are shared. cuowz_rrues | The sot of open fies is shared. * If clone() is passed the above flags, the parent and child tasks will share — same file-system information (such as the current working directory) — same memory space — same signal handlers and — same set of open files. However, if none of these flags is set when clone() is invoked, the associated resources are not shared * A separate data structures is used to hold information of process. Information includes: = file-system context — file-descriptor table — signal-handler table and — virtual memory context * The process data structure contains pointers to these other structures. * So any number of processes can easily share a sub-context by — pointing to the same sub-context and — incrementing a reference count. * The arguments to the clone() system call tell it — which sub-contexts to copy and — which sub-contexts to share. * The new process is always given a new identity and a new scheduling context8(c) How is IPC handled in Linux. Explain with suitable example. (6 Marks) Ans: INTERPROCESS COMMUNICATION + In some situations, one process needs to communicate with another process. * Three methods for IPC are 1) Synchronization and Signals 2) Message Passing Data between Processes 3) Shared Memory Object 1) SYNCHRONIZATION AND SIGNALS inux informs processes that an event has occurred via signals. * Signals can be sent from any process to any other process. + There are a limited number of signals, and they cannot carry information. + Only the fact that a signal has occurred is available te a process. + The kernel also generates signals internally. + The Linux kernel does not use signals to communicate with processes running in kernel mode. Rather, communication within the Kernel is accomplished via scheduling states and wait_queve structures. * Whenever a process wants to wait for some event to complete, the process — places itself on a wait queue associated with that event and — tells the scheduler that it is no longer eligible for execution. + Once the event has completed, every process on the wait queue will be awoken. «This procedure allows multiple processes to wait for a single event. 2) MESSAGE PASSING DATA BETWEEN PROCESSES * The standard UNIX pipe mechanism allows a child process to inherit a communication channel from its parent. + Data written to one end of the pipe can be read at the other. + Shared memory offers an extremely fast way to communicate large or small emounts of data. + Any data written by one process to a shared memory region can be read immediately by any other process. + Main disadvantage of shared memory: 1. It offers no synchronization. 2. A process cannot — ask the operating system whether a piece of shared memory has been written or — suspend execution until the data is written, 3) SHARED MEMORY OBJECT * The shared-memory object acts as a backing store for shared-memory regions, just as a file can act as a backing store for a memory-mapped memory region. + Shared-memory mappings direct page faults to map in pages from a persistent sharedmemory object. * Also, shared memory objects remember their contents even if no processes are currently mapping them into virtual memory.
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6127)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brené Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (932)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8215)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2923)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Tóibín
3.5/5 (2061)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2641)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2542)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
Jarvis Presentation
PDF
No ratings yet
Jarvis Presentation
2 pages
Advaya CSE Magazine Article Ideas
PDF
No ratings yet
Advaya CSE Magazine Article Ideas
2 pages
Ada m5 Part 1 Notes - @Vtupadhai
PDF
No ratings yet
Ada m5 Part 1 Notes - @Vtupadhai
12 pages
New_Solveathon 2.0 templete_1
PDF
No ratings yet
New_Solveathon 2.0 templete_1
9 pages
Clean Water and Sanitation
PDF
No ratings yet
Clean Water and Sanitation
13 pages
auv_paper_(1)[1] (1)
PDF
No ratings yet
auv_paper_(1)[1] (1)
8 pages
assignment 2
PDF
No ratings yet
assignment 2
16 pages
DIGITAL Disgram
PDF
No ratings yet
DIGITAL Disgram
6 pages
m1 Maths
PDF
No ratings yet
m1 Maths
2 pages
BCS304-Module 3 Notes (Sowmya)
PDF
100% (1)
BCS304-Module 3 Notes (Sowmya)
6 pages
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Yes Please
From Everand
Yes Please
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
Jarvis Presentation
PDF
Jarvis Presentation
Advaya CSE Magazine Article Ideas
PDF
Advaya CSE Magazine Article Ideas
Ada m5 Part 1 Notes - @Vtupadhai
PDF
Ada m5 Part 1 Notes - @Vtupadhai
New_Solveathon 2.0 templete_1
PDF
New_Solveathon 2.0 templete_1
Clean Water and Sanitation
PDF
Clean Water and Sanitation
auv_paper_(1)[1] (1)
PDF
auv_paper_(1)[1] (1)
assignment 2
PDF
assignment 2
DIGITAL Disgram
PDF
DIGITAL Disgram
m1 Maths
PDF
m1 Maths
BCS304-Module 3 Notes (Sowmya)
PDF
BCS304-Module 3 Notes (Sowmya)
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel