IN C PROGRAMMING CODE ONLY! DO NOT INCLUDE C++ CODE OR ELSE WILL CALL answers SUPPORT AND REPORT YOU RIGHT AWAY!! 1. segme

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

IN C PROGRAMMING CODE ONLY! DO NOT INCLUDE C++ CODE OR ELSE WILL CALL answers SUPPORT AND REPORT YOU RIGHT AWAY!! 1. segme

Post by answerhappygod »

IN C PROGRAMMING CODE ONLY! DO NOT INCLUDE C++ CODE ORELSE WILL CALL answers SUPPORT AND REPORT YOU RIGHTAWAY!!
1. segmentation:p3_test1.txt
2. paging:p3_test2.txt
The goal of this project is to write a simple memory managementsimulator based on the topics covered in class. You must write amemory manager that supports both segmentation and paged memoryallocation. For simplicity, assume that processes do not grow orshrink, and that no compaction is performed by the memorymanager.
Segmentation: Write a segmentation based allocator whichallocates three segments for each process: text, data, and heap.The memory region within each segment must be contiguous, but thethree segments do not need to be placed contiguously. Instead, youshould use either a best fit, first fit, or worst fit memoryallocation policy to find a free region for each segment. Thepolicy choice is yours, but you must explain why you picked thatpolicy in your README. When a segment is allocated within a hole,if the remaining space is less than 16 bytes then the segmentshould be allocated the full hole. This will cause some internalfragmentation but prevents the memory allocator from having totrack very small holes. You should consider the following issueswhile designing your memory manager:
Efficiency of your search algorithms: First-fit, worst-fit, andbest-fit all require you to search for an appropriate hole toaccommodate the new process. You should pay careful attention toyour data structures and search algorithms. For instance, keepingthe list of holes sorted by size and using binary search to searchfor a hole might improve efficiency of your best-fit algorithms. Wedo not require you to use a specific algorithm/data structure toimplement the selected policy; you have the flexibility of usingany search algorithm/data structure that is efficient. We'll giveyou 10 points for any design that is more efficient than abrute-force linear search through an unsorted list of holes.Similarly, use an efficient search algorithm when deallocating aprocess from the processList. Explain all design decisions, thedata structures and search algorithms used clearly in the READMEfile.
Free block coalescing: When a process terminates, the memoryallocated to that process is returned to the list of holes. Youshould take care to combine (coalesce) holes that are adjacent toeach other and form a larger contiguous hole. This will reduce thedegree of fragmentation incurred by your memory manager.
Paging: Next write a paging based memory allocator. This shouldsplit the system memory into a set of fixed size 32 byte pages, andthen allocate pages to each process based on the amount of memoryit needs. Paging does not require free block coalescing, but youshould explain in your README your choice of algorithm and datastructure for tracking free pages.
Sample Outputs:
Data Structures:
Both of your memory managers should maintain a processList thatlists all currently active processes, the process Id and size ofeach process. For the segmentation allocator, you should also trackthe start location of each segment. For the paging allocator youmust track what physical page is mapped to each virtual page withinthe process, as well as the number of bytes used in each page.
You are free to use any data structures (arrays, linked list,doubly linked list, etc) to implement these lists, but you shouldexplain why you pick the data structure you choose. This decisionwill also affect the use of search algorithms in the segmentationallocator.
Input File:
You program should take input from a file and perform actionsspecified in the file, while printing out the result of eachaction. The format of the input file is as follows:
An actual file may look as follows
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply