Marri Laxman Reddy Institute Of Technology And Management Operating .

1y ago
9 Views
2 Downloads
1.67 MB
166 Pages
Last View : 4d ago
Last Download : 3m ago
Upload by : Oscar Steel
Transcription

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALOPERATING SYSTEMSLAB MANUALSubject Code:Regulations:Class:A50589R13 – JNTUHIII Year I Semester (CSE)Prepared ByMrs.M.PallaviAssistant Professor1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUAL1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM OUTCOMESPO1Engineering knowledge: Apply the knowledge of mathematics, science, engineeringfundamentals, and an engineering specialization to the solution of complexengineering problems.PO2Problem analysis: Identify, formulate, review research literature, and analyzecomplex engineering problems reaching substantiated conclusions using firstprinciples of mathematics, natural sciences, and engineering sciences.PO3Design/development of solutions: Design solutions for complex engineeringproblems and design system components or processes that meet the specified needswith appropriate consideration for the public health and safety, and the cultural,societal, and environmental considerations.PO4Conduct investigations of complex problems: Use research-based knowledge andresearch methods including design of experiments, analysis and interpretation of data,and synthesis of the information to provide valid conclusions.PO5Modern tool usage: Create, select, and apply appropriate techniques, resources, andmodern engineering and IT tools including prediction and modeling to complexengineering activities with an understanding of the limitations.PO6The engineer and society: Apply reasoning informed by the contextual knowledge toassess societal, health, safety, legal and cultural issues and the consequentresponsibilities relevant to the professional engineering practice.PO7Environment and sustainability: Understand the impact of the professionalengineering solutions in societal and environmental contexts, and demonstrate theknowledge of, and need for sustainable development.PO8Ethics: Apply ethical principles and commit to professional ethics and responsibilitiesand norms of the engineering practice.1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPO9Individual and team work: Function effectively as an individual, and as a memberor leader in diverse teams, and in multidisciplinary settings.PO10Communication: Communicate effectively on complex engineering activities withthe engineering community and with society at large, such as, being able tocomprehend and write effective reports and design documentation, make effectivepresentations, and give and receive clear instructions.PO11Project management and finance: Demonstrate knowledge and understanding of theengineering and management principles and apply these to one’s own work, as amember and leader in a team, to manage projects and in multidisciplinaryenvironments.Life-long learning: Recognize the need for, and have the preparation and ability toPO12engage in independent and life-long learning in the broadest context of technologicalchange.PROGRAM EDUCATIONAL OUTCOMESPEO1To induce strong foundation in mathematical and core concepts, which enablethem to participate in research, in the field of computer science.PEO2To be able to become the part of application development and problem solvingby learning the computer programming methods, of the industry and relateddomains.PEO3To Gain the multidisciplinary knowledge by understanding the scope ofassociation of computer science engineering discipline with other engineeringdisciplines.PEO4To improve the communication skills, soft skills, organizing skills which buildthe professional qualities, there by understanding the social responsibilities andethical attitude.1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALOPERATING SYSTEMS LAB SYLLABUSS. No.List of Experiments1Simulate the following cpu scheduling algorithms:a) FCFS b)SJF c)Round Robind)Priority2Simulate the file allocation strategies:a) Sequential b) Indexed c) LinkedSimulate MVT and MFT34Simulate all File Organization techniquesA)Single level directory b)Two level c)Hierarchical d)DAG5Simulate Bankers Algorithm for Deadlock Avoidance6Simulate Bankers algorithm for Deadlock Prevention7Simulate all page replacement Algorithmsa)FIFO b) LRU c) LFU8Simulate Paging Technique of memory management.9**Write a C program to stimulate the following contiguous memory allocationtechniquesa) Worst-fitb) Best fitc) First fit10**Write a C program to stimulate the disk scheduling algorithms.a) FCFSb) SCAN c) C-SCAN11**Write a C program to simulate optimal page replacement algorithms12**Write a C program to simulate the concept of Dining-Philosophersproblem.Faculty1.HoD

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALCOURSE OBJECTIVES:This lab complements the operating systems course. With this course Students areable to:COB 1.Implement practical experience with designing and implementing conceptsof operating systemsCOB 2: write the code to implement and modify various concepts in OperatingSystems using Linux environment.COB3: Implement Various CPU Scheduling algorithmsCOB4: : Implement Various Page replacement algorithms algorithmsCOB5:. Understand and Implement Banker’s AlgorithmCOURSE OUTCOMES:CO1: Understand and implement basic services and functionalities of the operating system usingsystem calls and able to Understand the benefits of thread over process and implementsynchronized programs using multithreading concepts.CO2: Use modern operating system calls and synchronization libraries in software/ hardwareinterfaces.CO3: Analyze and simulate CPU Scheduling Algorithms like FCFS, Round Robin, SJF, and Priority.CO4 :Implement memory management schemes and page replacement schemes.CO5: Simulate file allocation and organization techniques.CO6: Understand the concepts of deadlock in operating systems and implement them inmultiprogramming system.1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALATTAINMENT OF PROGRAM OUTCOMES & PROGRAM ttained1Simulate the following cpu scheduling algorithms:a) FCFS b)SJF c)Round Robind)Priority2Simulate the file allocation strategies:a) Sequential b) Indexed c) Linked3Simulate MVT and MFT4Simulate all File Organization techniques5A)Single level directory b)Two level c)HierarchicalSimulated)DAG Bankers Algorithm for Deadlock Avoidance6Simulate Bankers algorithm for Deadlock Prevention7Simulate all page replacement Algorithmsa)FIFO b) LRU c) LFUPO1, PO28Simulate Paging Technique of memory management.PO1, PO2, PO49**Write a C program to stimulate the followingcontiguous memory allocation techniquesa) Worst-fitb) Best fitc) First fitPO1, PO2, PO4,PO1210**Writea C programtofitstimulatethe diskschedulingWorst-fitb) Bestc) Firstfit Worst-fitalgorithms.b) Best fitc) First fita)FCFSb) SCAN c) C-SCANPO1, PO2, PO4,PO1211**Write a C program to simulate optimal pagereplacement algorithms*Write a C program to simulatetheconcept of diningphilosophers problem12*1.ProgramSpecificOutcomesAttainedPO1, PO2, PO4PEO1PO1, PO2, PO4PEO1PO1, PO2, PO4PEO1PO1, PO2, PO4PEO1PO1, PO2, PO4PEO1PO1, PO2, , PO2, PO12PO1, PO2, PO3,PO4, PO5, PO12PEO1,PEO2

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALATTAINMENT OF COURSE OBJECTIVES & COURSE COMESAttainedattained1Simulate the following cpu scheduling algorithms:a) FCFS b)SJF c)Round Robind)Priority2Simulate the file allocation strategies:a) Sequential b) Indexed c) Linked3Simulate MVT and MFT4Simulate all File Organization techniques5A)Single level directory b)Two level c)HierarchicalSimulated)DAG Bankers Algorithm for Deadlock Avoidance6Simulate Bankers algorithm for Deadlock Prevention7Simulate all page replacement Algorithmsa)FIFO b) LRU c) LFUCOB1,COB2,COB48Simulate Paging Technique of memory management.COB1,COB2,COB49**Write a C program to stimulate the followingcontiguous memory allocation techniquesa) Worst-fitb) Best fitc) First fit10**Writea C programtofitstimulatethe diskschedulingWorst-fitb) Bestc) Firstfit Worst-fitalgorithms.b) Best fitc) First fita)FCFSb) SCAN c) OB1,COB3CO3COB1,COB2,COB4*Write a C program to simulate optimal pagereplacement algorithms*Write a C program to simulatetheconcept of diningCOB1,2philosophers problem1.CO4CO4CO1

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUAL1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT-11.1OBJECTIVEWrite a C program to simulate the following non-preemptive CPU scheduling algorithms to find turnaroundtime and waiting time for the above problem.a) FCFS b) SJF c) Round Robin d) Priority1.2DESCRIPTIONAssume all the processes arrive at the same time.1.2.1FCFS CPU SCHEDULING ALGORITHMFor FCFS scheduling algorithm, read the number of processes/jobs in the system, their CPU burst times. Thescheduling is performed on the basis of arrival time of the processes irrespective of their other parameters.Each process will be executed according to its arrival time. Calculate the waiting time and turnaround time ofeach of the processes accordingly.1.2.2SJF CPU SCHEDULING ALGORITHMFor SJF scheduling algorithm, read the number of processes/jobs in the system, their CPU burst times. Arrangeall the jobs in order with respect to their burst times. There may be two jobs in queue with the sameexecution time, and then FCFS approach is to be performed. Each process will be executed according to thelength of its burst time. Then calculate the waiting time and turnaround time of each of the processesaccordingly.1.2.3ROUND ROBIN CPU SCHEDULING ALGORITHMFor round robin scheduling algorithm, read the number of processes/jobs in the system, their CPU bursttimes, and the size of the time slice. Time slices are assigned to each process in equal portions and in circularorder, handling all processes execution. This allows every process to get an equal chance. Calculate thewaiting time and turnaround time of each of the processes accordingly.1.2.4PRIORITY CPU SCHEDULING ALGORITHMFor priority scheduling algorithm, read the number of processes/jobs in the system, their CPU burst times, andthe priorities. Arrange all the jobs in order with respect to their priorities. There may be two jobs in queuewith the same priority, and then FCFS approach is to be performed. Each process will be executed accordingto its priority. Calculate the waiting time and turnaround time of each of the processes accordingly.AIM: Using CPU scheduling algorithms find the min & max waiting time.HARDWARE REQUIREMENTS: Intel based Desktop Pc RAM of 512 MBSOFTWARE REQUIREMENTS: Turbo C/ Borland C.THEORY:CPU SCHEDULINGMaximum CPU utilization obtained with multiprogramming1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALCPU–I/O Burst Cycle – Process execution consists of a cycle ofCPU execution and I/O waitCPU burst distributiona) First-Come, First-Served (FCFS) SchedulingProcessBurst TimeP124P23P33Suppose that the processes arrive in the order: P1 , P2 , P3The Gantt Chart for the schedule is:024Waiting time for P1 0; P2 24; P3 27Average waiting time: (0 24 27)/3 17ALGORITHM1. Start2. Declare the array size3. Read the number of processes to be inserted4. Read the Burst times of processes5. calculate the waiting time of each processwt[i 1] bt[i] wt[i]6. calculate the turnaround time of each processtt[i 1] tt[i] bt[i 1]7. Calculate the average waiting time and average turnaround time.8. Display the values9. Stop1.2730

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM:#include stdio.h #include conio.h void main(){int i,j,bt[10],n,wt[10],tt[10],w1 0,t1 0;float aw,at;clrscr();printf("enter no. of processes:\n");scanf("%d",&n);printf("enter the burst time of processes:");for(i 0;i n;i )scanf("%d",&bt[i]);for(i 0;i n;i ){wt[0] 0;tt[0] bt[0];wt[i 1] bt[i] wt[i];tt[i 1] tt[i] bt[i 1];w1 w1 wt[i];t1 t1 tt[i];}aw w1/n;at t1/n;printf("\nbt\t wt\t tt\n");for(i 0;i n;i )printf("%d\t %d\t %d\n",bt[i],wt[i],tt[i]);printf("aw %f\n,at %f\n",aw,at);getch();}INPUTEnter no of processes3enter bursttime12820EXPECTED OUTPUTbt wt tt12 0 128 12 2020 20 40aw 10.666670at 24.000001.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALVIVA QUESTIONS1.What is First-Come-First-Served (FCFS) Scheduling?2.Why CPU scheduling is required?3.Which technique was introduced because a single job could not keep both the CPU and the I/O devices busy?1) Time-sharing 2) SPOOLing 3) Preemptive scheduling 4) Multiprogramming4.CPU performance is measured through .1) Throughput 2) MHz 3) Flaps 4) None of the above5.Which of the following is a criterion to evaluate a scheduling algorithm?1 CPU Utilization: Keep CPU utilization as high as possible.2 Throughput: number of processes completed per unit time.3 Waiting Time: Amount of time spent ready to run but not running.4 All of the above1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT : 1b)NAMEOF THE EXPERIMENT: Simulate the following CPU Scheduling Algorithmsb) SJFAIM: Using CPU scheduling algorithms find the min & max waiting time.HARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:Example of Non Preemptive SJFProcessPArrival TimeBurst Time10.07P2.044.013.04PP234P10P378P212P416Example of Preemptive SJFProcessPPPPArrival TimeBurst Time10.0722.044.013.04341.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALP1P2P3P2P4P1Average waiting time (9 1 0 2)/4 3ALGORITHM1. Start2. Declare the array size3. Read the number of processes to be inserted4. Read the Burst times of processes5. sort the Burst times in ascending order and process with shortest burst time is first executed.6. calculate the waiting time of each processwt[i 1] bt[i] wt[i]7. calculate the turnaround time of each processtt[i 1] tt[i] bt[i 1]8. Calculate the average waiting time and average turnaround time.9. Display the values10. StopPROGRAM:#include stdio.h #include conio.h void main(){int i,j,bt[10],t,n,wt[10],tt[10],w1 0,t1 0;float aw,at;clrscr();printf("enter no. of processes:\n");scanf("%d",&n);printf("enter the burst time of processes:");for(i 0;i n;i )scanf("%d",&bt[i]);for(i 0;i n;i ){for(j i;j n;j )if(bt[i] bt[j]){t bt[i];bt[i] bt[j];bt[j] t;}}for(i 0;i n;i )printf("%d",bt[i]);1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALfor(i 0;i n;i ){wt[0] 0;tt[0] bt[0];wt[i 1] bt[i] wt[i];tt[i 1] tt[i] bt[i 1];w1 w1 wt[i];t1 t1 tt[i];}aw w1/n;at t1/n;printf("\nbt\t wt\t tt\n");for(i 0;i n;i )printf("%d\t %d\t %d\n",bt[i],wt[i],tt[i]);printf("aw %f\n,at %f\n",aw,at);getch();}INPUT:enter no of processes3enter burst time12820OUTPUT:bt wt tt12 8 208 0820 20 40aw 9.33at 22.64VIVA QUESTIONS:1) The optimum CPU scheduling algorithm is(A)FIFO(B)SJF with preemption. (C)SJF without preemption.(D)Round Robin.2) In terms of average wait time the optimum scheduling algorithm is(A)FCFS (B)SJF (C)Priority (D)RR3) What are the dis-advantages of SJF Scheduling Algorithm?4) What are the advantages of SJF Scheduling Algorithm?5) Define CPU Scheduling algorithm?1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT : 1c)NAMEOF THE EXPERIMENT: Simulate the following CPU Scheduling Algorithmsc) Round RobinAIM: Using CPU scheduling algorithms find the min & max waiting time.HARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:Round Robin:Example of RR with time quantum 3ProcessaaaBbbCccDddEeeBurst time43251ALGORITHM1. Start2. Declare the array size3. Read the number of processes to be inserted4. Read the burst times of the processes5. Read the Time Quantum6. if the burst time of a process is greater than time Quantum then subtract time quantum form the burst timeElseAssign the burst time to time quantum.7.calculate the average waiting time and turn around time of the processes.8. Display the values9. Stop1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM:#include stdio.h #include conio.h void main(){int st[10],bt[10],wt[10],tat[10],n,tq;int i,count 0,swt 0,stat 0,temp,sq 0;float awt 0.0,atat 0.0;clrscr();printf("Enter number of processes:");scanf("%d",&n);printf("Enter burst time for sequences:");for(i 0;i n;i ){scanf("%d",&bt[i]);st[i] bt[i];}printf("Enter time quantum:");scanf("%d",&tq);while(1){for(i 0,count 0;i n;i ){temp tq;if(st[i] 0){count ;continue;}if(st[i] tq)st[i] st[i]-tq;elseif(st[i] 0){temp st[i];st[i] 0;}sq sq temp;tat[i] sq;}if(n count)break;}for(i 0;i n;i ){wt[i] tat[i]-bt[i];swt swt wt[i];stat stat tat[i];}awt (float)swt/n;atat (float)stat/n;printf("Process no Burst time Wait time Turn around time");for(i 0;i n;i )printf("\n%d\t %d\t %d\t %d",i 1,bt[i],wt[i],tat[i]);printf("\nAvg wait time is %f Avg turn around time is %f",awt,atat);getch();1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUAL}Input:Enter no of jobs4Enter burst time512820Output:Bt wt tt50512 5 138 13 2520 25 45aw 10.75000at 22.000000VIVA QUESTIONS:1.Round Robin scheduling is used in(A)Disk scheduling. (B)CPU scheduling(C)I/O scheduling.(D)Multitasking2. What are the dis-advantages of RR Scheduling Algoritm?3.What are the advantages of RR Scheduling Algoritm?4.Super computers typically employ .1 Real time Operating system 2 Multiprocessors OS3 desktop OS4 None of the above5. An optimal scheduling algorithm in terms of minimizing the average waiting time of a given set of processes is.1 FCFS scheduling algorithm2 Round robin scheduling algorithm3 Shortest job - first scheduling algorithm 4 None of the above1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT : 1d)NAMEOF THE EXPERIMENT: Simulate the following CPU Scheduling Algorithmsd) PriorityAIM: Using CPU scheduling algorithms find the min & max waiting time.HARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:In Priority Scheduling, each process is given a priority, and higher priority methods are executed first, while equalpriorities are executed First Come First Served or Round Robin.There are several ways that priorities can be assigned: Internal priorities are assigned by technical quantities such as memory usage, and file/IO operations.External priorities are assigned by politics, commerce, or user preference, such as importance and amount beingpaid for process access (the latter usually being for mainframes).ALGORITHM1. Start2. Declare the array size3. Read the number of processes to be inserted4. Read the Priorities of processes5. sort the priorities and Burst times in ascending order5. calculate the waiting time of each processwt[i 1] bt[i] wt[i]6. calculate the turnaround time of each processtt[i 1] tt[i] bt[i 1]6. Calculate the average waiting time and average turnaround time.7. Display the values8. Stop1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM:#include stdio.h #include conio.h void main(){int i,j,pno[10],prior[10],bt[10],n,wt[10],tt[10],w1 0,t1 0,s;float aw,at;clrscr();printf("enter the number of processes:");scanf("%d",&n);for(i 0;i n;i ){printf("The process %d:\n",i 1);printf("Enter the burst time of processes:");scanf("%d",&bt[i]);printf("Enter the priority of processes %d:",i 1);scanf("%d",&prior[i]);pno[i] i 1;}for(i 0;i n;i ){for(j 0;j n;j ){if(prior[i] prior[j]){s prior[i];prior[i] prior[j];prior[j] s;s bt[i];bt[i] bt[j];bt[j] s;s pno[i];pno[i] pno[j];pno[j] s;}}}for(i 0;i n;i ){wt[0] 0;tt[0] bt[0];wt[i 1] bt[i] wt[i];tt[i 1] tt[i] bt[i 1];w1 w1 wt[i];t1 t1 tt[i];aw w1/n;at t1/n;}printf(" \n job \t bt \t wt \t tat \t prior\n");for(i 0;i n;i )printf("%d \t %d \t %d\t %d\t w %f \t at %f \n",aw,at);getch();}1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALInput:Enter no of jobs4Enter bursttime10247Enter priority values4213Output:Bt priority wt tt410422467 3 6 1310 4 13 23aw 5.750000at 12.500000VIVA QUESTIONS:1. Priority CPU scheduling would most likely be used in a os.2. Cpu allocated process to priority.3. calculate avg waiting time 4.Maximum CPU utilization obtained with5.Using algorithms find the min & max waiting time. ]\oiui1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT- 22.1OBJECTIVEWrite a C program to simulate the following file allocationstrategies. a) Sequential b) Linked c) ) Indexed2.2DESCRIPTIONA file is a collection of data, usually stored on disk. As a logical entity, a file enables to divide data intomeaningful groups. As a physical entity, a file should be considered in terms of its organization. The term "fileorganization" refers to the way in which data is stored in a file and, consequently, the method(s) by which itcan be accessed.2.3SEQUENTIAL FILE ALLOCATIONIn this file organization, the records of the file are stored one after another both physically and logically. Thatis, record with sequence number 16 is located just after the 15th record. A record of a sequential file can onlybe accessed by reading all the previous records.2.4LINKED FILE ALLOCATIONWith linked allocation, each file is a linked list of disk blocks; the disk blocks may be scattered anywhere onthe disk. The directory contains a pointer to the first and last blocks of the file. Each block contains a pointerto the next block.2.5INDEXED FILE ALLOCATIONIndexed file allocation strategy brings all the pointers together into one location: an index block. Each file hasththits own index block, which is an array of disk-block addresses. The i entry in the index block points to the ithblock of the file. The directory contains the address of the index block. To find and read the i block, thethpointer in the i index-block entry is used.2a)AIM: Simulate the file allocation strategies using file allocation methodsHARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:File Allocation Strategies:The main problem is how to allocate disk space to the files so that disk space is utilized effectively band files can beaccessed quickly. We have 3 space allocation method.1.Contiguous allocation (Sequential)It requires each file to occupy a set of contiguous blocks on the hard disk where disk address define a linearordering on the disk.Disadvantages:i.Difficult for finding space for a new file.ii.Internal and external fragmentation will be occurred.1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALALGORITHM:1.2.3.4.5.6.StartRead the number of filesFor each file, read the number of blocks required and the starting block of the file.Allocate the blocks sequentially to the file from the starting block.Display the file name, starting block , and the blocks occupied by the file.stopPROGRAM:#include stdio.h #include conio.h main(){int tf("Enter no.of files:");scanf("%d",&n);for(i 0;i n;i ){printf("Enter no. of blocks occupied by file%d",i 1);scanf("%d",&b[i]);printf("Enter the starting block of file%d",i 1);scanf("%d",&sb[i]);t[i] sb[i];for(j 0;j b[i];j )c[i][j] sb[i] ;}printf("Filename\tStart block\tlength\n");for(i 0;i n;i )printf("%d\t %d \t%d\n",i 1,t[i],b[i]);printf("blocks occupiedare:");for(i 0;i n;i ){ printf("fileno%d",i 1);for(j 0;j b[i];j PUT:Enter no.of files: 2Enter no. of blocks occupied by file1 4Enter the starting block of file1 2Enter no. of blocks occupied by file2 10Enter the starting block of file2 5FilenameStart block length12425101.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALVIVA tedtochainedfileallocationondisk?2. Define Sequential File allocation3.Why we use file allocation strategies?4.what are the advantages and dis-advantages of Sequential File allocation?5.The average waiting time .EXPERIMENT :2 b)NAME OF EXPERIMENT: Simulate file Allocation strategies:b) IndexedAIM: Simulate the file allocation strategies using file allocation methodsHARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:Indexed allocationIn linked allocation it is difficult to maintain FAT – so instead of that method indexed allocation method is used.Indexed allocation method solves all the problems in the linked allocation by bringing all the pointers together into onelocation called index block.ALGORITHM:1.2.3.4.5.6.7.StartRead the number of filesRead the index block for each file.For each file, read the number of blocks occupied and number of blocks of the file.Link all the blocks of the file to the index block.Display the file name, index block , and the blocks occupied by the file.Stop1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM:#include stdio.h #include conio.h main(){int r no. of files:");scanf("%d",&n);for(i 0;i n;i ){printf("Enter index block :",i 1);scanf("%d",&ib[i]);printf("Enter blocks occupied by file%d:",i 1);scanf("%d",&m[i]);printf("enter blocks of file%d:",i 1);for(j 0;j m[i];j )scanf("%d",&b[i][j]);} printf("\nFile\t index\tlength\n");for(i 0;i n;i )printf("%d\t%d\t%d\n",i 1,ib[i],m[i]);printf("blocks occupiedare:");for(i 0;i n;i ){ printf("fileno%d",i 1);for(j 0;j m[i];j )printf("\t%d--- :Enter no. of files:2Enter index block 3Enter blocks occupied by file1: 4enter blocks of file1:94 6 7Enter index block 5Enter blocks occupied by file2:2enter blocks of file2: 10 8File index length134252blocksoccupiedare:file13--- 93--- 43--- 63--- 7file25--- 105--- 81.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALVIVA QUESTIONS:1. What file allocation strategy is most appropriate for random access files?2.Define File?3.Define Directory?4. Why we use file allocation strategies?5.what are the advantages and dis-advantages Indexed Allocation?EXPERIMENT : 2 c)NAME OF EXPERIMENT: Simulate file Allocation strategies:c) LinkedAIM: Simulate the file allocation strategies using file allocation methodsHARDWARE REQUIREMENTS: Intel based Desktop PcRAM of 512 MBSOFTWARE REQUIREMENTS:Turbo C/ Borland C.THEORY:Linked AllocationLinked allocation of disk space overcomes all the problems of contiguous allocation. In linked allocation each file is alinked list of disk blocks where the disk blocks may be scattered anywhere on the disk. The directory contains a pointerto the first and last blocks of the file.Disadvantages : Space required to maintain pointers.ALGORITHM:1.2.3.4.5.6.StartRead the number of filesFor each file, read the file name, starting block, number of blocks and block numbers of the file.Start from the starting block and link each block of the file to the next block in a linked list fashion.Display the file name, starting block, size of the file , and the blocks occupied by the file.stop1.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALPROGRAM:#include stdio.h #include conio.h struct file{char fname[10];int start,size,block[10];}f[10];main(){int i,j,n;clrscr();printf("Enter no. of files:");scanf("%d",&n);for(i 0;i n;i ){printf("Enter file name:");scanf("%s",&f[i].fname);printf("Enter starting block:");scanf("%d",&f[i].start);f[i].block[0] f[i].start;printf("Enter no.of blocks:");scanf("%d",&f[i].size);printf("Enter block numbers:");for(j 1;j f[i].size;j \tsize\tblock\n");for(i 0;i n;i .size);for(j 0;j f[i].size;j )printf("%d--- ("\n");}getch();}OUTPUT:Enter no. of files:2Enter file name:venkatEnter starting block:20Enter no.of blocks:6Enter block numbers: 412154532251.

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEnter file name:rajeshEnter starting block:12Enter no.of blocks:5Enter block numbers:65432File start size blockvenkat 20620--- 4--- 12--- 15--- 45--- 32--- 25rajesh 12512--- 6--- 5--- 4--- 3--- 2VIVA tedtochained2. What file allocation strategy is most appropriate for random access files?3. Mention different file allocation strategies?4. Why we use file allocation strategies?5 .what are the advantages and dis-advantages of each strategies?6. The contains a pointer to the first and last blocks of the file.1.fileallocationondisk?

MARRI LAXMAN REDDY INSTITUTE OF TECHNOLOGY AND MANAGEMENTOPERATING SYSTEMS LAB MANUALEXPERIMENT- 33.OBJECTIVEWrite a C program to simulate the MVT and MFT memory management techniques3.1DESCRIPTIONMFT (Multiprogramming with a Fixed number of Tasks) is one of the old memory management techniques inwhich the memory is partitioned into fixed size partitions and each job is assigned to a partition. The memoryassigned to a partition does not change. MVT (Multiprogramming with a Variable number of Tasks) is thememory management technique

This lab complements the operating systems course. With this course Students are able to: COB 1.Implement practical experience with designing and implementing concepts of operating systems COB 2: write the code to implement and modify various concepts in Operating Systems using Linux environment.

Related Documents:

Selección de poemas de David Aniñir yeyipun marri- marri wenu kvze Marri- marri wenu fvcha Marri-marri newen ñuke mapu Marri-marri kuifi keche mapuche Marri marri kvyem wanglen kom newen wenumapu allkutuain taiñ dugu allkutuaiñ taiñ pvlyv allkutuaiñ taiñ rakiduam Memoria pú lonko, Pu machi, Pu weichafe, Pu werken

1 Dr. Prathap C Reddy - AAGPP9786N 2 Ms.Sucharitha Reddy AASPS4292G 3 Ms. Preetha Reddy AAEPR5656F 4 Ms. Suneeta Reddy AAEPR46O2H 5 Ms. Shobana Kamineni AAIPK7589G 6 Ms. Sangita Reddy AASPS6786K 7 Mr. P. Vijayakumar Reddy ACKPV5876B 8 Mr. P. Dwarkanath Reddy AFDPD98O6R 9 Mr. Anil Kamineni ADOPK87O1D

chalmeda anand rao institute of medical sciences, bommakal, karimnagar (telangana) . 81 madasthu amith rahul m 82 sarvadevabatla sainaga apoorva f 83 katakam mohana sai kumar m 84 narra priyani reddy f . 5 md - general medicine marri sai kiran reddy m 6 md .

1. SR Reddy, Principles of Agronomy, 4th Edition, Kalyani Publishers 2. SR Reddy, Principles of Crop Production, Kalyani Publishers, ISBN 9788127243197 3. Agronomy Terminology, Indian Society of Agronomy, New Delhi. 4. Reddy and Reddy, Principals of Agronomy 5. Textbook of Ag

A Ashok Kumar, Belum VS Reddy, P Sanjana Reddy and B Ramaiah International Crops Research Institute for the Semi-Arid Tropics, Patancheru 502 324, Andhra Pradesh, India Introduction Sorghum [Sorghum bicolor (L.) Moench] is the fi fth important cereal crop in the world after wheat, rice,

Dr. Reddy's Laboratories Ltd. 8-2-337, Road No. 3, Banjara Hills, Hyderabad 500 034, India www.drreddys.com DR. REDDY'S LABORATORIES LIMITED ANNUAL REPORT 2015-16 Good Health Starts From Within ANNUAL REPORT 2015-16 Good health starts from within. www.kalajyothi.com Title_Dr. Reddy's Non-Stat_Kala.indd I 28/06/2016 4:16:41 PM

24. Mr. Ram owns a house property. He lent it to Laxman at 10,000 p.m. Laxman sublet it to Mr.Maruti on monthly rent of 20,000 p.m. Rental income of Ram is taxable under the head _. A. Income from Salary B. Income from Other Sources C. Income from House Property D. Income from Business 25. Mr. Ram owns a house property.

3 For referenced ASTM standards, visit the ASTM website, www.astm.org, or contact ASTM Customer Service at service@astm.org. For Annual Book of ASTM Standards volume information, refer to the standard’s Document Summary page on the ASTM website. 4 Withdrawn. 5 Available fromAmerican Concrete Institute (ACI), P.O. Box 9094, Farmington