UNIVERSITY OF HOUSTON Department of Computer Science COSC 4330-Operating System Fundamentals Assignment #3: Page Replacement Policies in Memory Management (due April 30, 2007, 11:59pm CDT) Objective You are to write a short program simulating the FIFO, LFU, and OPT page replacement policies for a mobile operating system found in cellular phones and other wireless information devices. An additional constraint on a mobile OS is that page replacement can only be performed when airtime (bandwidth or channel) is available. Specifications Your program should be able to simulate three page replacement policies: (a) the FIFO (first-in-first-out) page replacement policy (the replaced page is the one which came in first). (b) the LFU (least-frequently-used) page replacement policy (the replaced page is the one which has been least-frequently-used; ties broken using FIFO). (c) the optimum (OPT) page replacement policy with x pages of look-ahead (minimizes the number of page faults by looking-ahead at the memory references). All parameters are to be passed through the program argument vector: assign3 policy memory_size In case of OPT: assign3 OPT memory_size x where policy is either FIFO, LFU, or OPT, and memory_size is the total number of page frames in the physical memory. Run your program for each replacement policy. Your input data will be a sequence of page references such as: 1:a 1:a 1:n 1:a 2:n 3:a 3:n 3:n 4:a 4:a 4:n ... Each page number is followed by : and either a (means air bandwidth is available for page replacement if needed) or n (means air bandwidth is NOT available for page replacement). If air bandwidth is not available for page replacement when needed, then this page reference is queued until air bandwidth becomes available, at which time the page replacement is performed. In a real scenario, this means delayed service. Optional Bonus Part: Implement a look-ahead OPT-MOBILE technique (examine x page reference ahead) that will minimize the number of delayed page replacements. All parameters are to be passed through the program argument vector: assign3 OPT-MOBILE memory_size x Your program should print for each run the total number of page references in the input data, the number of page faults, and the number of delayed page replacements due to unavailable air bandwidth. Hints You may want to use the atoi() function to convert string values into integers.