Question: Q 2 . Write a program that simulates an operating system's memory management using segmentation. Your task is to simulate the process of translating logical
Q Write a program that simulates an operating system's memory management using
segmentation. Your task is to simulate the process of translating logical addresses to
physical addresses using the concept of segmentation. Additionally, you will simulate
conditions where a segmentation fault occurs. Add your assumptions, if any, to a
ReadMe file. pts
Design:
The system has three segments: Code, Heap, and Stack.
Each segment has a base and a limit bounds which define where the segment
starts in memory and its length.
Assume the system has a KB physical memory, and memory is reserved as
follows:
Code Segment: Starts at KB size KB
Heap Segment: Starts at KB size KB
Stack Segment: Starts at KB and grows downwards, size KB
A segmentation fault should be raised if the offset exceeds the segment's limit
Use the pseudocode from Chapter for the address translation.
Input: The user can enter a bit logical address in hex format. For example: af
Output: bit physical address in hex format or segmentation fault. solve
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
