


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



In this phase you will develop an upgraded version of the operating system you implemented in Phase1. The assignment for this version of the operating system is divided into two steps: Step I : To execute a set of processes (20 or 30) given to you as the data file using a two different CPU scheduling algorithms, SJF and Priority Scheduling. (Use process size to select the ‘shortest’ process under SJF.) Step II : To execute the same set of processes using the same scheduling algorithms and introducing the memory management technique - paging. Step I In the first step the processes from the disk would be moved into the memory and executed (i) according to their priority and (ii) according to the Shortest Job First algorithm and the priority policy. Dispatcher The dispatcher is a module that gives control of the CPU to the process selected by the short-term scheduler. This function involves Switching context. Switching to user mode (executing the processes). Jumping to proper location in the user program to restart that program. . The short-term scheduler will extract parameter data from the PCB and accordingly set the CPU’s PC before the OS calls the CPU to execute. In case of SJF, the short-term scheduler will select the shortest process (based on the number of instructions left to execute) from the ready queue to be dispatched to the CPU. In case of Priority scheduling the short term scheduler will select the highest priority process (having highest numerical value) to be dispatched to the CPU. Context switching will involve two major functions.
Causing an interrupt Swapping the processes/pages (required in step II) When the CPU finishes execution of a process, it causes an interrupt. The OS switches from the user mode to kernel mode, the short-term scheduler selects the next process, the dispatcher dispatches the process to the CPU, and the OS then switches back to user mode. What to expect/observe – data collection and analysis Collect and analyze data on timings (average waiting and completion times) for the processes given the program/data file. Compare the timing data for the processes and discuss the effect of the different process size and different CPU scheduling algorithms on the performance/timings. Step II : In this part, you will introduce the paging scheme. Physical memory is broken into fixed-sized block called frames and logical memory is also broken into blocks of same size called pages. Page and frame size is 4 words. Each process will be assigned 4 frames, and any additional requests will be honored by a page-manager, depending on availability from the pool. When no more frames are available a process must wait until others are completed and more frames are returned to the pool. [We are skipping page replacement implementation in Phase 2 but taking care page fault servicing.] Page table You will have to implement a page table. The address generated by the CPU is divided into page number (p) and page offset (d). The page number is used as an index to the page table. The page table contains the base address of each page in physical memory. This base address is combined with the page–offset to define the physical memory address that is sent to the memory unit. The page table is kept in the main memory and a page-table base register (PTBR), which is a component of the PCB, points to the page table. A valid-invalid bit should be associated with every entry in the page table. The status of the bit is used to determine if