Segmentation is a memory-management scheme that supports user view of a program. A program is a collection of segments.
Implementation of Allocation and deallocation techniques using segmentation.
- User inputs total memory size
- User inputs holes starting address and size.
- User inputs Processes one by one.
- User inputs for each process:
a. Number of segments.
b. Name and size of each segment. - User inputs the method of allocation (first fit or best fit).
- Allocate segments using either First-Fit or Best-Fit allocation methodology.
- If one segment or more of a process can not fit in any hole you should generate a message to state that this process does not fit.
- Deallocate a process (The user chooses a process to deallocate, you should deallocate all segments of this process and consider their spaces as holes to be used later and add them to any neighbouring holes).
The output is a drawing representing memory layout after each allocation or deallocation. Also, It shows the contents of the segment table for each process.