C+ Programming, Operating System and Memory Table

1. The ultimate aim of this question is to find out how your Unix system layouts different parts of your process in the virtual memory. The question consists of three parts. The first part is to complete a program that prints out the memory addresses of various components of the process (eg, global variables, local variables, dynamically allocated variables, functions, command line arguments, and environment variables). This program is then used in the second part to recreate a snapshot of the memory layout of the process. Finally in the third, you will answer a number of questions related to the memory management based on your observation and analysis.

Complete the following C program, memory.c, so that it displays the addresses of

functions f1, f2, and main;

all string literals such as "Hello, world!";

all initialized global variables;

all un-initialized global variables;

all dynamically allocated memories;

all formal parameters in functions;

all local variables;

start and end of its command line arguments;

start and end of its environment (variables and values)

2. Based on the information generated from the above program, produce a memory map table showing the layout of literals, initialised global variables, uninitialised global variables, formal parameters of each function, local variables, dynamically allocated variables, functions, environment and command line arguments in the memory when the program runs at label L in function f2.

The memory map table must show the addresses of each variable, literal, and function and their sizes. It should also show the start and end addresses of the environment and the command line arguments and their sizes.

The memory map table must contain at least the following columns:

The start address of an entity such as a variable or a function

The length of the storage space of the entity in bytes

The name of the entity, such as global_pointer1 or Hello, world!

The nature of the entity, such as function, or uninitialsed global variable

The memory section, eg, environment, command line arguments, code (or text), global initialised data, global uninitialed data, stack, heap etc.

In addition, you must use seven different background colours to highlight the following seven memory sections as indicated below::

[Green] initialised global variables (including constants and literals)

[Red] uninitialised global variables

[Blue] stack (containing the local variables and returning addresses of function calls)

[Magenta] heap (containing the dynamically allocated memories)

[Yellow] code (functions)

[Cyan] process environment

[White] command line arguments

Please also note that in your memory table, the memory addresses must be strictly sequential, from the lowest address to the highest address to reflect how different components of a running program are layout in the virtual memory. Your memory table will not be accepted if the addresses are not lined up sequentially in the table. If you find that components from one section are split in more than one continuous area of memory, it is a sure indication that there is something wrong with your memory map and you should find out what went wrong and fix it.

3. Based on the experiment and analysis you have carried out in 1 and 2 above, answer the following questions:

What is the size of the virtual address space of that process?

How does the operating system on your machine layouts the following process components in the virtual address space: command line arguments, environment, literals, initialised global variables, uninitialised global variables, functions, formal parameters and local variables of a function, and dynamically allocated variables (or memories)?

Beceriler: C Programlama, C++ Programlama, Linux, Yazılım Mimarisi, UNIX

Daha fazlasını gör: memory management in c++, memory manager c++, c program for segmentation in os, write a c program to implement memory management using segmentation, virtual memory implementation in c, virtual memory program in c, dynamic memory allocation in c++ with example program, custom memory manager c++, C Programming in Embedded System , food order management system in c programming, College management system source code in c programming language, student rigestration system in c++ programming, c++ programming table of weights year of birth, need help in c programming, https://wwwfreelancercom/projects/c-programming/system-monitor-the-temperature-the/, c project using command line arguments on linux, c program operating system, best online jobs in dubai related with c programming, multi programming batch operating system, webcam snapshot command line

İşveren Hakkında:
( 0 değerlendirme ) Singapore

Proje NO: #17159926

Bu iş için 6 freelancer ortalamada $75 teklif veriyor


I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Daha Fazla

in %bids___i_period_sub_35% gün içinde250%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(149 Değerlendirme)
in %bids___i_period_sub_35% gün içinde100%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(38 Değerlendirme)
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% SGD
(1 Yorum)

Hello dear Hiring manager I have read your job post & being an expert Web developer, I offer myself for the job. I am having extensive knowledge and 5+ years of experience in PHP & WordPress website development u Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% SGD
(1 Yorum)

Over 8 years of software development experience across various domains. Primary skills include C/C++ on Windows as well as Linux platform. Good at shell scripting. Expert in debugging.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% SGD
(0 Değerlendirme)

I have worked in research organisations and feeling extremely comfortable in the C programming, Data Structures and Operating System concepts. I have worked in this area for last 3 -4 years. You can trust on me as its Daha Fazla

in %bids___i_period_sub_35% gün içinde27%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(0 Değerlendirme)