0% found this document useful (0 votes)
53 views83 pages

Operating System

quantum series OS

Uploaded by

sid20037789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
53 views83 pages

Operating System

quantum series OS

Uploaded by

sid20037789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 83
B.TECH. (COMPUTER SCIENCE AND ENGINEERING) FOURTH SEMESTER (DETAILED SYLLABUS) ‘Operating system ‘Course Outcome (CO) Bloom’s Knowledge Level (KL) At the end of course , the student will be able to understand €CO.1 _ | Understand the structure and functions of OS KK: CO2 _ | Learn about Processes, Threads and Scheduling algorithms KK ‘CO3__| Understand the principles of concurrency and Deadlocks K CO4 | Lear various memory management scheme K €O5__| Study VO management and File systems KaKe DETAILED SYLLABUS 3-0-0 Unit Topic Proposed Lecture Introduction — Operating system and functions, Classification of Operating systems Batch, 1 _| Interactive, Time sharing, Real Time System, ‘Multiprocessor Systems, Multiuser Systems, | gg Multiprocess Systems, Multithreaded Systems, Operating System Structure- Layered structure, System Components, Operating System services, Reentrant Kernels, Monolithic and Microkernel Systems, ‘Concurrent Processes. Process Concept, Principle of Concurrency, Producer / Consumer Problem, 11 | Mutual Exclusion, Critical Section Probiem, Dekker’s solution, Peterson's solution, Semaphores, | 08 Test and Set operation, Classical Problem in Concurrency- Dining Philosopher Problem, Sleeping Barber Problem: Inter Process Communication models and Schemes, Process generation. ‘CPU Scheduling: Scheduling Concepts, Performance Criteria, Process States, Process Transition in| Diagram, Schedulers, Process Control Block (PCB), Process address space, Process identification information, Threads and their management, Scheduling Algorithms, Multiprocessor Scheduling | 08 Deadlock: System model, Deadlock characterization, Prevention, Avoidance and detection, Recovery from deadlock “Memory Management: Basic bare machine, Resident monitor, Multiprogramming with fixed IV_| partitions, Multiprogramming with variable partitions, Protection schemes, Paging, Segmentation, | 08 Paged segmentation, Virtual memory concepts, Demand paging, Performance of demand paging, Page replacement algorithms, Thrashing, Cache memory organization, Locality of reference. VO Management and Disk Scheduling 1/0 devices, and 1/0 subsystems, VO buffering, Disk V__| storage and disk scheduling, RAID. File System: File concept, File organization and access | 08 mechanism, File directories, and File sharing, File system implementation issues, File system protection and security ‘Text books: 1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, Wiley 2. Sibsankar Halder and Alex A Aravind, “Operating Systems”, Pearson Education 3. Harvey M Dietel, “ An Introduction to Operating System”, Pearson Education 4. DMDhamdhere, “Operating Systems - A Concept based Approach”, 2nd Edition, 5. TMH 5. William Stallings, “Operating Systems: Internals and Design Principles ", 6th Edition, Pearson Education Computer System Seen ee cee eee c cc naan a ante arena .. (1-2B to 1-9B) /* Introduction ; Operating System and Function * Classification of Operating System : Batch ° Interactive * Multi-processor Systems ¢ Multi-user Systems ‘© Multi-process Systems © Multi-threaded Systems 1-2B A. Concept Outline : Part-1 B. Long and Medium Answer Type Questions . .... (1-9B to 1-20B) Part-2 sooo Operating System Structure '¢ Layered Structure '° System Components © Operating System Services '« Re-entrant Kernels Monolithic and Micro-kernel System A. Concept Outline : Part-2 . 1-9B 1-10B B. Long and Medium Answer Type Questions Scanned by CamScanner * An operating system is a program that acts an intermediary between a user of a computer and the computer hardware. i Memory management * ii, Processor management iii, Device management iv, File management © The feature of a batch system is the the user and the job while that job is executing. e lack of interaction between _" Ammulti-processor is a computer system with two or more central processing units, with each one sharing the common main nt memory as well as peripherals. . Ee tis Geet a is software that manages the computer hardware. jate mechanisms to ensure the system and to prevent user programs Scanned by CamScanner Operating Systems en Bootin, © Uses diagnostic routines to test system for equipment failure, ii, Copies BIOS (Basic Input System) programs from ROM chips j, main memory, iti, Loads operating system into computer's main memory. 2 Formatting : Formats (initializes) diskettes so they can store data and programs, computer resource: Keeps track of locations in main memory where programs and data are stored (memory management). Moves data and programs back and forth between main memory and secondary storage (swapping) via partitioning, using foreground and background areas, and using buffers and queues. 4. Managing files : i. Copies files/programs from one disk to another. ii, Backup files/programs i. Erases (deletes) files/programs iv. Renames files. 5. Managing tasks : May be able to perform multi-tasking, multi-programming, time-sharing or multi-processing. QueL2 | Describe the classification of operating system. OR Write down the different types of operating system. Eee Various types of operating system are as follows : 1. Batch system : a. This type of operating system was used in the earlier age. b. To speedup processing, jobs with similar needs were batched together and were run through the computer as a group. ¢. The definitive feature of a batch system is the lack of interaction between the user and the job while that job is executing. d. In this execution environment, the CPU is often idle. Multi-programming system : In this type of operating system, more than one program will reside into main memory. The operating system picks and begins to execute one of the jobs in the memory. Scanned by CamScanner n isa special purpose operating system, used ‘requirements on the ‘operation of a processer Scanned by CamScanner Seamed wth camscamer 1 a oat ayera nd ey comma saeeenantercey hae econ ney 2 i ie ltr. ach pec eles © 1 aaah ace masteralove elation TEaTE enn ne tatong terme sa: 1 ponehrating (aera Mae] fn Bach of dhe threads ean rum in paral 2 2 ge divide precuring tia not only ements dao among each thread within aa ‘lock; instead, each processor fe meeoa poo et tawe,oChat hr opera Pee Thon inmultithreaded applications, multiple tasks sm PORTE ‘parallel with other applications FEET] Wet awn the sterence tween marae ‘and multi-programming operating system ‘through various communication a are runing onthe #7862 7. | Multi-processing refers Snot multiple| programs in main memory at he of malls ee time and exces ‘concurrently utilizing single CPU. 27 eter mii CPU, [iin gC Ttpermits parallel processing. [contest witching takes las Scanned by CamScanner Fig. 194. Prat sling Specling is weil tncae device aces ata at diferent ates ‘Te buffer provides awaiting satin where data can ret wile the lower Soriano. ‘ ‘The mart common poing application eprint poting, ‘erases are nad int # ‘Where te brats own ae . ‘Spee a med fo proenng data at remotes. The CPU ‘Mordatvia communion ath ia remote printer Advantages of spooling over buffering: {LT spoon pectin wes a disk a very tare bater, 12 Spolingiscapateofvertapping UO operation fr ne job with poser ‘peratne for another a Scanned by CamScanner Seamed wth camscamer Sane ‘a way that the Cn ‘Operating system : Refer Q 1.1, Page Structure of OS: |L_ Simple structure: MS-DOS written to 1-2, Unit, provide the most functionality inte least epace: ‘a. Not divided into modules. 'b. Although MS-DOS has some structure, its ‘functionality are not well separated. jnterfaces and levels amen ‘ROM BIOS device drivers Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer ‘ach program rou an ipa an fer procnting hI ‘Mima sc produces S a user in a oe opening a Sle, saving a file land deleting Be fro the storage disk. ‘bThis i an important task that is also performed by the operating: system. 4 Communication : 2 Operatig sem os So Carer mr a aig ® smay be implemented via shared memory. in which {oor more proces ad and writs toa shared ection of memory ‘ormessage passing, in which packets of information in predefined formate are moved between processes by the operating system. & Error detection : ‘Toe main fanction of operating system isto detect the errors ke ‘bad sectors on hard disk, memory a me ‘Wdevices. ‘overflow and errors related 1b Aer detecting the errors, operating system takes an appropriate ‘ection for consistent computing, | Scanned by CamScanner Seamed wth camscamer thy eo ant atte in fcimcoeomaclnatay ceramics FEET pitremite between thefallowint: kernel rs a a on “What ure the differences between shell and kernel? Scanned by CamScanner Seamed wth camscamer ‘System call: Refer Q. 1.17, Page 1-178, Unit- Scanned by CamScanner Seamed wth camscamer can be done eaars,| Mode switehing “ | ods atom cal Tisisaapesial interrupt is over, fe. Process switching is useful for ‘suspending and resuming of a process. Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer ‘TaeERT Piterentinte between te fitowing: 1 Proces and progrem Lt TATE) Program aa set of instructions | ‘perform s designated) "A proce is entirely dependent Programsare independent. | ‘onprogras.| \ 7 |Preemivanodic tarmentes| Program performs a tak ey reser Srey ling won 4 7 x petra ent a at of edna alta = impale Scanned by CamScanner Seamed wth camscamer ‘ted hvn timabuier an the tonsa remit “The producer cannot dope ada he ufler tf Shery 8 ‘onsuier cannot reticte an date the llr tempt 4. the tater ent fl producer can depot a data, "The ensue ‘shouldbe allywed to retrieve data tow four coma ‘Solution to prince : Readunt cect cas t ‘count = 0 1 ok binarvsempbore «= 1: int producers Scanned by CamScanner Seamed wth camscamer L.A ertial section is a code segment in a process in which a shared tenure is cremed. 2. Each process has u segment of code calle a critieal section. Critical fection used to avoid race conditionson data items ‘4. Incritiel section the process may be changing common variables, Updating a table, writing a file and a0 on. At any moment at most ane proces can execute inertial section (CS). 4. Whenone process s executing in its critieal section, no other process i to be allowed to execute in its critical section. The execution of erities section bythe process is mutually exclusive in time. Axolution to the critical seetion problem must satisfy the followin three requirements | Mutual exclusion : If process, is executing ints critical seetion, th ‘no other processes can be executing in their eritical sections. a Pee tins in is teal eta Processes wish to enter ther critical sections, then only those proces {iat are not exesting in their remainder scons ean parted deciding which will enter its critical section next, and this selec cannot be postponed indefinitely. Scanned by CamScanner Seamed wth camscamer sotto en ry rns ne ca [Each of thene graces np indefinitely, repeatedly enter peeves and Phat when oexacu ecen!uction ot “eaters the igh and bxamninies the Moekboard. ‘The proceer number ie writen on the lackboard, an that rors ‘Others that proces wil ‘Proceas renters inthe ig to check the Backboard {repeats thivexeciae until in allowed to oer tactical eeton. Tie pcre iow ae busy wait Bury waiting ating ecure wen a ‘Proviso that inte cater seta! rode. _ kind of problem occurs in sultprogramming system, waitirten: ceil section signal imaten), ‘remainder section 1 while TRUE, |. Busy waiting wastes CPU cyies that some other proces ight be ble ‘touse productively. Give the principle, mutual exclusion in critical section problem. Also discuss how well these principles are followed in ‘Dekker's solution, | Scanned by CamScanner Seamed wth camscamer ie sxecution CONCEPT GUTLINE : PART-2 ~ Asemaphore is variable or abstract datatype used 10 control ‘sees to common resource by multiple process in a concurrent Scanned by CamScanner Seamed wth camscamer armen? Seated ified | Wiat are the disadvantages of semaphores and discuss ‘srultabe technique to overcome them ? of semaphore: lit ems tha oe amar Thi acess ka ow level. Is ey to make programming i ust keep track ofall call o wat and to signal the ‘semaphore, Ifthisis nt dae in the correct order, ‘an cause deadlock ‘programmer error ‘Semaphores are used for both condition synchronization and fxcison ‘These sre distin and ferent events, and i fiat icapw which meaning any given oo eo ae eres i dincteeninge cement 1, Thomuia dinirantage cf thovemephoreisthat © coca accgeetapeneipiag cease | ater its critical section must loop continuously in the entry code. ll Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer of the lock byte (ether itis 09 1 ‘the vale a go back to step & ; | a ee suse of Uherenource ata Scanned by CamScanner Seamed wth camscamer Mnlanophera who pend most of eis yc nt ly ot any ond el a 9H bees gust sit at the table, pick up the two loot oa pate then serve and eat Sh Ma UPCHOPSTICK, CHOPSTICKIG+1 mad 5; Ear CHOPSTICKL, CHOPSTICREA mel i. 1 pilepher ay THINK indefinitely. Every philowoie wh “dz Petephers may PICKUP and PUTDOWN thebr Gases i easerender, or nendeterminiatically, butthese are atom actions ‘Tue problem is to design a protocol to satisfy the liveneas condita lany philosopher who tries to EAT, eventually does. Scanned by CamScanner Seamed wth camscamer Message passing stem Bera peng provides & mechasion 1 Oe _ etn od to roeronie erations without shang tb Same adress space. ae ll in tated aie hr espera process may reside on diferent compara Hare are several methods for logically implementing a inkand send (or receive () operations = {L_ Director indirect communication ‘2, Synchronous or asynchronous communication 3. Automatic or explicit buffering Scanned by CamScanner Seamed wth camscamer pmaexfor acess . customers) Aetomerst = customerst —T; Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer 1 A multilevel queue scheduling algorithm intoseveral separate queues Fig. 3.3.0, ‘Bach queue has te own ccheduling algorithm, For example, separate queues might be used Inackground processe ps The foreground queue might be scheduled thelarand quenched an POPS Scanned by CamScanner Seamed wth camscamer + Malte Scns eo ie pave waking ton aa ‘intext ofa CPU in process control block so that a pre ‘be resumed from the same point at a later time. +2 Anyoperating system that allows for multit ‘ttafcontextevitching te allow diferent processes to (© Acontext switch occurs when a computer's CPU ‘Processor thread toa different process or thread. Scanned by CamScanner Seamed wth camscamer In computer system, “simultaneously and each there are various Scanned by CamScanner Seamed wth camscamer canto block store the details (CPU) utiieatin nnd execotion Canufe to input / output : lock stores the detail pertaining and file opened during the process excites GER neeerive proven aaatrenn sce, oer | reenn ness pace means apace that alloted in menor fora ooo ‘Address paces a epace in computer memory, A Brery process has an address space. 4. AMaress space can be of two types : ‘a. Physical address space : Physical address space is crested in, RAM Ja Virtual address space : Virtual address space san address space that sereated outside the main memory inside the virtual memory, anditsereated in hard disk, 1. Process registration involves recording all information necessary to ‘Gentfy a registered process and to differentiate it from other processes Scanned by CamScanner of thread = inimize context switching time iuread provides concurrency within a process, 4 Bien ; “4 Thismore “5. The benefits of mult-threading can be greatly processor architecture. oe & Deel Scanned by CamScanner Seamed wth camscamer ii 3 ne @ S : 2 & 2 % : 2 22 is Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer ee Se ee | _ Garieen a process to move between the ueuah, - 5 eae oor mere ei ta ME (Fig. 92.1. Multilevel 5 Porexample, each process may start at the top level queue, I'he ses tucompleted within a given time slice it departs the system, {¢ Preeses that need more than one time slice may be reassigned the operating system to a lower priority queue, which gets «lower, [erentage ofthe processor time ! Scanned by CamScanner Seamed wth camscamer “hat would be the effect of patting we SHEN Gave eeu we none avenge od Siang ohne? (RTS NAS] mer | 1 Process appears twice in the ready queve and is scheduled twice a ‘often an ater preceses. 2 Ineffect, that process will have increased its priority since by wetting {ewe mare offen itis receiving preferential treatment 1 wail druble tbe time given to that process. |4, Treadvantage of this acheme a that more important obs could be ven ‘hore tne Iewll provide higher peority with minimal modification te Sthedaler. 14. Trediadvantage ofthis schemes thatthe shorter job wil muffler bene Aaarant jobs il execute with mare time. There willbe overhead for aiaaging pointers Itmay also increase overhead if same process Fane ack torback. {BBL Consider the set of the processes given in the table and the following scheduling algorithms : i" Round Robin (Quantum = 1) fi, Round Robin (Quantum =2) li, Shortest Remaining Job First eels te ‘Process 14 | Arrival Time | Execution Time 0 2 3 3s 4 mooe>. Irthereis tie within the processes, the tie is broken in the favour of the sldest process, Draw the Gantt chart and find the average Waiting time, response time and turnaround time for the algorithms. Comment “on your result, Which one is better and why ? ‘Round Robin (Quantum = 1) Prep Ta oraseseTs et Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer 4 Circular wait:Aset IP, Py.-P, of waiting processes mustexst veh ‘hat P, is waiting fora cexource Bld by P,P, i waiting fora resource ‘bold by oP is waiting for a resource bel by P, and Ps waiting fora resource held by Py. GEER] How deadlock are prevented? on etn and explain th dea prevention. What are the approuches that can be used for prevention of B+9+2+6 +5556, desk? (ARTUR) oresacet Bese What are the necessary, Deadlock prevention isan approach which ensures that sytem wil ever ‘enter indeadlock state. ‘Thew are following approaches of deadicee prevention: 41 Mutual exclusion : ‘2 Mutual exclusion condition must old fr non-sharable resources. 1 access toa resource requires mutual exclusion, then mutual ‘exclusion must be supported by te operating system. 2 Hold and wait: ‘The hold and wait condition canbe eliminated by forcing a process toreleaseall resources held by it, whenever it requests a re80ur3© ‘hat isnot arable Forexample, process copies data from afopp disk to hard disk, sort disk le and then prints the reelts toa printer. ‘all the resources must be requested at the beginning of the process, then the process must initially request the floppy disk, harddisk anda printer. 1 wil bold the priate rite entire execution, even though itneeds the printer only atthe end. & Nopre-emption: ‘Ifa process holding certain resources i denied a further request. ‘Thal process must release it orignal resources and if necessary ‘request them again, together with aditional resource. fa process requests a resource that is currently hed by another proces, the operating stem may preempt the secund process and equire it to releaso its resources. ‘& Preemption is posible for certain types of resources, such as CPU and min memory. 4 Circular wait: - | One ayo prevent the circular wait condition ish Hinear ordering of differen types of ester resources, Scanned by CamScanner Seamed wth camscamer Dn Resareloation gra x und a descr he dean alin {hick scm eure allocation grag ‘2 Graph consi owt oCeertcn ¥) and net of wes. 3 the etive recuse tent nated by PP, Py Pad ‘me ansaoalresore spe the tended by 44 Holding of erarc by proces ane y aaignment we Reusing of rescue by proces i deca by request sae 1k Porrepresnting pron nd reearee inthe rsnurcalestionerath ‘ito ty equate ad cr Bach preeaetveprenemt iy ich and ‘cscrce ty mare Do within the hare reprewots the mamber of Conner thefatowing system which consist ree proces Bund P, and four remurceste Ry Ry Rand, Henures Rao ‘Nive on nntance, haste instance and Rh three rss 1 process Pisin stance f resource type sn Saweiting Taran nance a reaoures type Process, heing a intance S¢, and, and waiting for an festancs a resare pe, +P Ry Ppp + Py RAPD Bs ® Scanned by CamScanner Seamed wth camscamer ® o 4, The ascumptions made inthe wait for graph areas alloms = a Anedg from PtoP na wait fr graphimplies that process P, {s waiting for process? to release a resource that P, needs. 1b Anedge P+ exits i a wait-for graph if and only if the ‘eeoure allocation graph contains two es FOE di +E focmen rere 6. irwrdcnlde pete hegoen bs endkedahervta ae AL. Several instances of resouree type: 11 Unmarkallactive processes from Allocation, Max and Available in ‘accordance with the system state, Scanned by CamScanner Seamed wth camscamer For’ =0,1, 1, if Allocation, 0, then Finish) = fale: thera, Finish = trae, Find an index uch that both Fnlshlil == fale aquest = Work aasuch exists, goto step) Work = Work + Aloation, Finish = troe Goto sep (2). Finish == alse for some 04 [Need > Available-+ 381 ¢ a10 “Hence, resource will not be granted, bP <21,0> [Need < Available -+ Tru priority processes et blocked, and high priority | process ‘Baforcement of priorities ‘uncontrolled resource’ Scanned by CamScanner Seamed wth camscamer ‘Explain performance criteria, Refer Q. 3.1 of CEU eehedeting tig: What lnCPU scheduling? Write the aiference Cmptive and non pre-emptive: eneenet aus Refer Q 3.1 and Q. 35. eae Explain process transition diagram BS eter. 35. tht, Discuss Process Control Black (PER. fase Befer 37 " {Q.5. Write short notes on process identification information. Se eer a. 5:10. 6. Write short notes on fllowing §; FOVS scheduling i, SUF scheduling i Round robin scheduling a H uefer@. 817. H.R. S18. Hh Refer. 320 G1. Write the difference between following: 1. Thread and process 1 Dice level thread and keenct level thread 2 ee form, short term and mid term scheduler at ane Ker Q.31s. 2 Refer Qars, Refer 3s 6 Baplnin Hk’ slortbn fr evokes of Geen Scanned by CamScanner Seamed wth camscamer “Memory management is mainly concerned withthe allocation of main Imemory to reqocsting proces, No process can ever run, before & {rtain amount of memory is allocated toit. ‘ho overall resource utilization and other perfarmance criteria of ‘ampater system are largely aflected by te performance of the memary ‘management module Five requirements of memory management are: 1. Relocation : ‘Programmers do not know where the program wil be placed in ‘memory when its executed. Wile the program executing, t may be rwapped te dik and abs returned to main memory at diferent location (relocated) | & Mery rfrence mathe tanated inte ade aan, Scanned by CamScanner Seamed wth camscamer ‘Address binding ie part of computer m to the opera = memory management andi ie aarees to acne. Teno allt te apltioon tak, Instructions and data to a aay ‘memory addresses can be done in following i. Compile time : When itis known st compile time where the rs will reside, comy ere pile time binding iv ved to generate the sh Load time + When it eno kamen at empl tine hare preces il ee n sraoy thn the compl roan Si Execution time Ifthe proces cane moved during taxation frmene menorysqguet omaha ing mt bape to be done at run time. = Write a short note on : 4. Dynamic loading i, Dynamic linking A Dynamic loading : 4. Indynamic loading, a routine of «program s not loaded until itis called bythe program. [Allzoutines are keptondiskin a relocatable load format. The main ‘program is loaded into memory and is executed. Other routines methods or modules are loaded on request, ‘Dynamicloading makes better memory space utilization and unused, routines are never loaded. ‘It is useful when large amounts of code are needed to handle infrequently occurring cases. No special support from the operating system is required, ‘implemented through program design. © a oe ee Scanned by CamScanner Seamed wth camscamer 4. Dynamic inking: 2 Linking isthe proces of ecleting and combining var ‘ode and data now exeewable eth canbe lade, and executed. Operating system can link aystem level libraries to p Wihan it combines the irae at ond ie the Linking ing inking and when tis linking is done athe ime of itis called as dynamic linking. aig 4. Instatic linking ibearies linked a compile ime. so ‘ie becomes bigger herearin dynamic king rare egeat ‘execution time so program ende size remains smaller Ne WEETAT] Write te short note on ee 1 Overlays is used to keep in memory only those instructions ant data that are needed at any given time 2. When other instructions are needed, they are loaded into spay ‘that was occupied previously by instructions that are no longer needed. ‘8. Overlays are implemented by user no special support needed rae operating system, programming design of overlay structure i, ik Swapping: 1A process must be in memory to be exceuted % Aprocess, however, can be swapped temporarily out of memoryto ‘backing store and then brought back into memory for continved execution. Swapping makesit posible forthe total phyical addres pe ail process to exced the real physical memory of the Yate {hosinereasiag the degre of maltprogramming in system Seretimos wap out proces aio known ws roll-out and maps process known as ral in " anicstT Sem) eo 88M Pryncal addres spac ina set fal pyri sess corresponding’ 2 Tpeselogeal addreses eal adress wenerated by CPU: Physica adress ithe arn of 3 bagepemiory and tis loaded into the memory address existe Compile time and load time ness binding methods generat ame 4 (fea and physical adresses. on tine adress binding scheme results in different logical and 5 ipsa addresses. mverally local address referred asa vrtal adres der alogealudress pee of ght page of 10% sich mapped ote a pysiea memory of3 frames then deo role ane nga sare? a How many bits are in physical address ? 5 (a a a) Taewer PP trelogcal address pitino two pars: the page address and then the ee ‘re page ares mst beable reference or distin pen Tis ures adress its vor efit mtb abl toreference 1,024 (or 2" distinct word ee 8 ett equres 10 adres te Therefore 8bis are reared or Theta ares = Toe pial reais alo spt nto two parts: the fame adres then te oe The munher frames 92(or 0 tha wil require Sits, same asthe sizeof he page therefore thie will 4 Thesizeofthe frame require 10bits. 1. Therefore, 15 bits are required forthe physical adres. WET] erine u i. Bare machine fi, Resident monitor Tarver] {Bare machine + 1. ‘Thisis the simplest form of memory management. 2 Thused by hardware diagnostic, by system boot code, real time! edicated systems. terms: Scanned by CamScanner Placement algorithm with partitions: ‘a. Bqualsize partitions: 1 tial thera abe pein pesam 4 Because all partitions are equal siz, oes not matter which partion sued. * Sooetunreate ieee |b Unequal-size partitions, use of multiple queues: ‘Tisalgorthm assign each proces tothe sale patton within vehi wil |i Aqueue exist for each partition se 4% etsen to minimize internal fagmentation. ji, Problem with this algorithms that some queues mht be empty ‘while sore mig be oad. “6 Unequal-size partitions, use of a single queue: |L-Inthisalgorithm, when etme to lad process into memory, the sullest avilable partition tha wil old the process elected AL Teineeassthe evel of ultiprogramming atthe expense of steal fragmentation. Scanned by CamScanner Seamed wth camscamer 2 meee, Nagel comorioe eto es taro sae 3 Weriiears Teoma moyen 4 octamer nrarneatntae 6 Wisplecdie ihe than Memeo ee poe ae ante remy nd eter ts nevi dd cin Tear, th te Semele etiesoag ree FEE vice yume memory alan eng on ‘Discuss first fit, best fit and worstfit memory allocation techniques. 1 Prat ft, best it, and worst tae the most common strategies used to Select a fee bole fom the set of avaiable oles. 2 Fast fit and best fit are better than worst Bt in terms of speed and. ‘sorage utilization respectively. Dynamic memory allocation techniques 1. First ft: Allocate the first ole that isbig enough. Searching canstart titer at the beginning of the st of holes oa the leaton where the first t search ended. We can stp searching soon. aswe ind ‘afree hole that is large enough, 2 Best fit: Allocate the smallest hole that isbig enough. We must search “the entire list, unless the list is ordered by sie. This strategy produces ‘the emallest leftover hole. | Worst fit: Allocate the largest hole. Again, we must search the entire reget el = me td eT crore eos Scanned by CamScanner Seamed wth camscamer Process P¢has no memory} ‘Twomemory partition of size 100 K and 300K are fre which ant be ‘Tlocrted to Pl because it has ice more than these memory partitions. Best fit: Scanned by CamScanner Seamed wth camscamer ies = | ——— —— oer 7 ean index into the pag tte and isthe dolce thin erore ‘What is paging ? Describe how logieal address ts Irasated to physical adress in a paged system. Further Hamutovty prceemeaiveniplasoreras on -Q. 4.16, Page 4-198, Unit-d. ‘of logical address to physical address : Scanned by CamScanner Seamed wth camscamer ee Pipette diene : ie erating yer erie the memary cen tering Pa, fan rid free frame in oeated and VO is requested 8 Wit Noa ito the fre frame, 2 ae jon af VO, the process table and page table are pated Veet instructinse restarted. a > a page fault by operating system + Mechs neo able asl ep ith pee ate Wechecrocee tn Setcrmine whether the reference is vali oF 3% reall memory access. + “ page iron ® backing store Scanned by CamScanner Seamed wth camscamer iS —___seo terest ‘TLB contains only fw ofthe page-tabe entries. When a yearns cea eee na a number i found Oxnown as TB i) its frame numbe a 4, 10h [oth avalabe and is weds ence emery = swe modify the internal table kn ‘page number is notin the TLE (known asa TLB miss) a memory toindiate thatthe pravis now ingest 30. WIMP. the pe table must be made th wa iterated by tee. The ris te frase number i oMaied, we can we to aces memory. page as though ited always been in merger 1h Jpadaiton we add the page number and frame number to he TLB, so 1. Iasi be nnd guy on th net fren sa TLB i lendy fl of entre, the operating apse mast mac Meter rel septacerent policies range from least recently used (LRU) to random. in the TLB consists oftwo parts: key (r tag) and vlog associative memory is presented with an iter, th item keys simultaneously. Jaswer me ofthe most common structures of page tables are Hierarchical page table : % the corresponding value field is returned. 4 en pnd hierarchical page table the logical adress space is divided the number of entries in « TLB is small, often numbering multiple page tables 164 and 1,024. Je technique used is a two-level page table used with page tables inthe following way ¢._ Tworlevel paging as shown in Fig. 4.20.1 age tle Fig. 4.20.1. Two-level paging scheme 4 Alogical address (on 32-bit machine with 4K page size) in tort isdivided into following two parts Scanned by CamScanner ~ sn en ee ae prom pa naa When a memory reer ca pa el dre triton put Sapo psoas pes Seer tent hen aero Af mach Gund eyo ary en pli nd = is generated. If no match if found, error is indicated. ‘BEGET wat doy mean segmentation ivetbehardare Inpeentation of omen Scanned by CamScanner Seamed wth camscamer adres space within ‘Bach segment is treated as single, smal linea rn dese space is “the container logical adress space proper, and tis > 4 Medico ramon the minor pes ne Sewing scheme. Scanned by CamScanner Seamed wth camscamer ‘aleatate, adres ‘OS maintain a list of free holes ia : = nnn nem tee ins ain Sei aoe hee ase ae Saya ttre eg nice nent Bee on ae cee es i pena per Orr viru aasrets i. Segment number: Virtua ares space consist of apt 16 segments , 16-2 {bits are needed to specify segment number. fi Page number: Hardware pages each seyment into S\2bytes pages 512 = 2 byte pages ‘Sire of segment is 2"* bytes. Ff 2/2 = 64 "= T pages “bits are required to specify the page number. {M, Offeet within page: For byte page, hits are needed, I tne vl nro nomi oe mae Ai 44749220 | Wi aresementtonandpaing omnes raet alll Scanned by CamScanner Seamed wth camscamer aoa ogres the ee ardor o al gael ers oe oe eS ccektres taal eee vial wena em Rees «eee ea pie nl carn Serra ea done dynamically, wil programsarebeing xen the CPU. of virtual memory: “Alors sto it many large programs ito aelatively small RAM, 4 Only part of «program needs tobe loaded into memory. Memory can be used efficient because a setion of program eae aly when it is needed in CPU, 44 Virtual memory allows sharing ofcode and data, unlimited amounts mult: programming: 7 TAG] Explain the process of demand pain, « ‘The process of loading the page into memory on demand (whenever Pas ess m= eo a "The process inciodes the ‘memory, it generates an interrupt indicating memory access alt, 2. TheOS puts the interrupted process in. blocking state. Por the execs} toprceed the OS must bring the required page ita Ube memory Scanned by CamScanner Seamed wth camscamer re ee a iment nop ft en mene [Consider a demand poged system. Page tales are held gute. 1¢ takes 8 milliseconds to service page fault fan im bay pace is available or the replaced page is not modified, and’ cart condsif the replaced pageis modified. Memory access ines aignoneconds. Assume thatthe page to he replaced ismoified 70 une of te ine, Whats he maximum acuptale page fasts pereretfective access time of not more than 200 nanoseconds? Fee pve conditions, we et D2 ye=(1—P) x 0.1 ys (0.90) x8 millisee + (0.7P) x20 millisee T= =p + 2400 P + 14000 F100 ns-=0.1 psec and 200 ns = 02 psec] 1 = 16390 p= 0.00006 GeGA, | Consider a demand paged system. Page ablesare stored Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer [tring for f0¥r page frames using A BT TRNTB IIA 42 2 r fa] 7 [2] ber of page fault will be 13. ae a eee a 5 3) I) 2 z a 3 3] Palle 4 HC] 542 a z 3 « ‘otal umber of page fault will be 13 Consider the following reference string 1234215621 all Scanned by CamScanner Seamed wth camscamer What do you mean Cbeate tener Differentiate betm OS fer 428, Paging and, ioerrs dered arenccaee ss me Maes Br) pox FeforQ t27 and 48, stvanoge and Discuss the Se eter 5:2, 2” PMSMeRE alpine, @.2. What is thrashing ? State the solution. State the cause of a pos, Refer Q. 4.57, ae 200 Scanned by CamScanner Ee ts ict tia Kee mes ran oe Eee rear ios chetoc ga Pye rcrsehetuleg STF scheduling SCAN scheduling Explain the terms VO devices. What are the c aodevices? 1 lapuvoutput, or VO, is the collection of interfaces that different functional urits (sub-systems) ofan information processing system ‘eta communicate with each other, or the sguals information sent through those interfaces, 1b Imptsare the signals received by the unt, and output are the signals sot from it “1 Thetorm can also be used as part of an action; todo VO" iso perform __atinput or output operation TO devices are used by « person (or other system) to communicate ‘witha computer. Scanned by CamScanner ‘Scanned by CamScanner Seamed wth camscamer ‘overvrite buffers before they bad been consumed. - ig The producer can ony fill up tober /—1 while data buffer) jewaiting t be Scanned by CamScanner Seamed wth camscamer pee simplest frm fdisk scheduling isthe Fist. Come Fis Served Feces algorithm. iqueve 96, 183,57, 122,14, 196,65, 67 starts at 5 ee im ‘Fig. 5.6.1. FCPS disk seh ‘This algorithm is intrinsically fair, but it generally does not provide : the fastest service. aa Consider, for example, a disk queue with requets for UOtablocks em 1 1d, a 12, 65,67 that ode. frst move from S300 Scanned by CamScanner Seamed wth camscamer quove = 98, 183,37, 12,14, head starts at 53 el 9 14 87 536567 98 tania. ans OK scheduling Inthis the disk arm reverses direction all the way to the end ofthe disk. and C-LOOK scheduling, beeause the _ delore continuing to move ina given direction. Scanned by CamScanner Seamed wth camscamer ‘Come, First Serve (FCFS) ‘286, 147, 91,177, 94,150 Scanned by CamScanner Seamed wth camscamer ieee (66 - 62) + (165. v # (120-1) yuan tes 8 #89 a <4 900110 ees O22 2 65 ne ag. ‘Total head movement _ = (68-62) + (65-92) + (92-12) ¢<490-19) + (142 ~ 120) +485 —149) = 4344204108226 %=21 Assume that head initially moves towands zo, 0 12 32 62 66 120 12 165 ‘Fig. 5.103, =| t | nna _ asa | + (120 ~ 66) + (142—120) + = 30+ 20+ 12 + 66454422: =m Scanned by CamScanner Seamed wth camscamer se, blocks 2,3, 45,8, 9,10, “Rare fre and thereat ofthe blocks were ats sitoation, we would keep aprinter toc: 2 would contain a pointer ablackd ehh Boiron pin works tick ls ae ‘is scheme is not efficent; to traverse the lt, * eck, which requires substantial VO time the bit is0, naam Scanned by CamScanner Seamed wth camscamer orm of RAID datas striped Ne te sreater than ach data word it having its ova hemig dea te than cote vere Bobi ecg, | * beta the data urracyend dre “« ‘ths ret te tre er ia saa e ertarive failures 7 |g Minimum two drives are required inthis 7 aa po 2 rr : the performance J rye data block i epit and in writn onda dk, E «Stipe party's generated on writes and thi wring iene sierra | «See ie pert mt ty and higher datz, | ARAIDSarray can recover fom har rv file miele higher inenvironments where applications need igh now stands on nae “Inthis level the read/write speeds igh. dozen RAID level schemes IDLevel 4: prevailing RAID lee Inthis RAID level the requirement of three drives ia seenandin this evel, the entire block i written ona disk, "Party is generated in writes and recorded on parity disks and -hecked on reads. : This level of RAID has high reading spends ands bil fice 52 ei adem rit data disks and parity’ -don reads. _Ghtrbted onto three dives edi : Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer fea San ith fe Sn vs poral een thera renin nt ae invested or Dat dir gen ‘hedirectory can he viewed as a symbol table ha tranalaes eames ther directory entries take such a view, we see thatthe irecoryitslfcan be organi’ | famany ways organization must be allowed to insert entries, ta delet nti 12 ach fora namned entry, and to ist ll he entries i the dineetors. ull Scanned by CamScanner Seamed wth camscamer Scanned by CamScanner Seamed wth camscamer advent of the Internet, a file transfer y Protocol (FTP) has become widely-used. abe used to access (read and IP sites offer public file sharing orat by downloading them, using a pu be “anonymous”), Scanned by CamScanner Seamed wth camscamer ier of the file up to maxintum Hit mast be knwwn atthe ime sy idsk space is wasted due to fragmentation. ‘ sito remove fragmentation. a allocation : al inlined allocation, each file ie alinked it oink Mocs: the Wocks may be seattered anywhere onthe disk. 7 Medirectory contains a pointer tothe rst and last locks the = example, a file o ive blocks might tart at ble 9and continue tblock 16, then block Meee ec 0, and finaly Wok * block contains a pointer to the next block. ‘pointers are not made available tothe user. hus, i each block is 512 bytes in size, and a ) requires 4 bytes, then the user see Scanned by CamScanner Seamed wth camscamer entry for every recordin the main fle ‘Rta inteaforwutned as a seqential Se for eumeteehing ‘pertains contain enti to record where the felieoae ent ans 77s of variable length, some record wil no conain al fields Thema new record is added othe main fl, ll he index flemst be updated, Fig. 6.22.2 shows the index with relative Mes Indexed fle are used mestly in applications where timelines of information are

You might also like