OS expert- GemsOS
Budget: ₹12,500 – ₹37,500 INR
WIll pay 50 usd
deadline is 4 days
Task-1: Virtual memory area operations
In this task, you are required to provide the implementation for the function vm area mprotect
in the file [mprotect.c]). This function is invoked when mprotect system call is made.
vm area mprotect takes the current context, address, length, and required protection as
arguments. If the provided address is not part of any vm area, then mprotect should fail
and return -EINVAL.
As part of this task, you are expected to modify access protection of the VMA in the range
(addr, addr+ length-1) as shown in Figure 1. Change in access protections of a VMA can
lead to the splitting/ merging of VMAs.
Validation Procedure:
• In this part of the assignment, we will validate the state of VM area, a singly linked
list pointed to by vm area field in struct exec context in include/context.h. We will
examine the vm area linked list before and after the mprotect syscall.
• There can be at most 128 vm area at any point of time. If this limit is exceeded, then
return -EINVAL.
• If the address range for mprotect system call does not belong to a valid vm area then
return -EINVAL.
• Assume all the addresses provided to the mprotect syscall are page-aligned.
Task-2: Updating access rights of physical pages
In this task, you need to add additional functionality to the function vm area mprotect. On
changing the access protections of a vm area mapping, you have to modify the access protections of the mapped physical pages of the vm area by walking the page table. For example, if
we change a vm area permission to WRITE ONLY from READ ONLY through a mprotect system
call, then you have to modify the relevant page table entries to allow write operation on
them.
Note: pgd value can be found in struct exec context.
Validation Procedure:
• We will change access permissions through mprotect system call and validate read,
write access to corresponding vm area.
I will share files and codes in chat
deadline is 4 days
Task-1: Virtual memory area operations
In this task, you are required to provide the implementation for the function vm area mprotect
in the file [mprotect.c]). This function is invoked when mprotect system call is made.
vm area mprotect takes the current context, address, length, and required protection as
arguments. If the provided address is not part of any vm area, then mprotect should fail
and return -EINVAL.
As part of this task, you are expected to modify access protection of the VMA in the range
(addr, addr+ length-1) as shown in Figure 1. Change in access protections of a VMA can
lead to the splitting/ merging of VMAs.
Validation Procedure:
• In this part of the assignment, we will validate the state of VM area, a singly linked
list pointed to by vm area field in struct exec context in include/context.h. We will
examine the vm area linked list before and after the mprotect syscall.
• There can be at most 128 vm area at any point of time. If this limit is exceeded, then
return -EINVAL.
• If the address range for mprotect system call does not belong to a valid vm area then
return -EINVAL.
• Assume all the addresses provided to the mprotect syscall are page-aligned.
Task-2: Updating access rights of physical pages
In this task, you need to add additional functionality to the function vm area mprotect. On
changing the access protections of a vm area mapping, you have to modify the access protections of the mapped physical pages of the vm area by walking the page table. For example, if
we change a vm area permission to WRITE ONLY from READ ONLY through a mprotect system
call, then you have to modify the relevant page table entries to allow write operation on
them.
Note: pgd value can be found in struct exec context.
Validation Procedure:
• We will change access permissions through mprotect system call and validate read,
write access to corresponding vm area.
I will share files and codes in chat