Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming with system calls Write a system call to report statistics of a process's virtual address space. The system call should take a process

image text in transcribed

C programming with system calls

Write a system call to report statistics of a process's virtual address space. The system call should take a process ID as input and outputs the following information about the process 1. The size of the process's virtual address space 2. Each virtual memory area's access permissions 3. The names of files mapped to these virtual memory areas Write two user-level programs to test your system call. One test program just calls the new system call and report the calling process's statistics. The other test program should create multiple threads and report information about individual threads. The purpose of the second test program is to study if threads share the same address space. Hints The Linux kernel uses the memory descriptor data structure to represent a process's address space. The mem ory descriptor struct mm_struct is defined in and included in a process's task_struct. In mm_struct the mm users field is the number of processes using this address space and the mm_count field is the reference count for this mm_struct. The vm_area_struct describes a single memory area over a con- tiguous interval in an address space space. To calculate the size of a virtual address space, one only needs to sum the sizes of individual virtual memory areas (VMA). The VMAs in a process can be accessed in two ways. mmap in mm_struct points toa sorted linked list of all VMAs of a process. mm_rb points to a red-black tree of VMAs, which can be used to search for a given VMA. You can verify your result using pmap All the virtual memory areas together form a process's virtual address

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions

Question

sin u / 2 = - 1 - cos u / 2 When u is in the second quadrant.

Answered: 1 week ago