Operating Systems Questions

You might also like

Download as pdf
Download as pdf
You are on page 1of 2
Operating Systems Major-1 Department of Electrical Engineering, IIT Delhi EEL602 Operating Systems: Major Examination (Closed book/Closed Notes) Time: 2 hour Maxirnun Marks: 25 “Thou shalt not covet thy neighbour's answers” 1. The sole soul of wit: Brevity. Brief answers only, please! (a) Briefly explain ‘copy-on-vrite’ (b) What is an atomic operation? (c) Describe a simple scheme to avoid a busy wait/spin lock in the m= plementation of « semaphore. Please mention only the main points (14148 marks) 2. No faults, please! Consider the page size to be 100 bytes, and the following aridresses referenced: 100, 101, 205, 318, 451, 182, 111, 208, 519, 119, 222, 226, 311, 382, 328, 408, 551 («) Write down the page reforence sting, (b) Consider the FIFO page replacement strategy, and the number of frames in memory to be 3. Show the contents of the frames on ench item in the page replacement string, and mark each page fault. How ‘many page faults do you get? (©) Now, consider the number of frames to be 4. Repent the above (a) What do you conelu (1464641 marks) Producing Consumerism! Consider the following solution to the Producer ‘Consumer problem that uses no semaphores, mntexes, or any specin! eon- currency control measures. in, out und counter are integer variables, and the variable counter is shared between the producer and the consumer [75 = conmmar Free ‘while (TRUE) { ‘hile (counter=-BUFFER_S1ZE) bufferiinl = nextProduced: in = (ined) % BUFFER_SIZE; countert+; Drocess execute concurrently. Mhusteate th ‘Suppose that counter is inltally 6, and that the wht le(counter==0) nextConeuned = buffer{out] ; ‘out = Coutt1) % BUFFER SIZE; ree eases as to how the value of counter can be either 4, 5 oF 6, respectively. “Consider countert® 10 consist of | the following assembly language stave. rents: jnonen Leoanter = st ‘Samantre Dutta Roy, BE, “TD ‘Consider —countar-—— to consist of the following assembly language state- ments: 32 = counter r2=r2-1 [counter = 12 (Ge T5E mas) ‘somnatrates.4itd.ac.in Operating Systems Major 4. Answer efFortleasly! The steep entrance road to the Gwalior fort in Central Indis allows a width of only one vehicle to pass through. The ‘guards at the start and the end of this entrance rond communicate with ‘each other via telephone to allow at mast one vehicle to pass through at acme, in either direction. Suppose you are to simulate this using a ‘emaphore/muitex variable, perniseion. (2) Write pseudo-code for a process (in an infinite loop!) to be executed by a vehicle in any direction. Use the wait © and signal( func- tons. (b) What will you initialise this semaphore /mutex tot (c) What will the Critieal section be? (140.5405 marks) Santen Dulia Rey, EE, HTD ‘umantradee. 1104.0 tm

You might also like