Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Operating System Practical (CS604p) Total marks = 20

Assignment # 02 Deadline
19/01/2024
Fall 2023

Please carefully read the following instructions before attempting the assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 Strict action will be taken if the submitted solution is copied from any other student or the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

UPLOADING INLINE ASSIGNMENT INSTRUCTION


Follow the given instructions to submit Inline assignments:
Microsoft Word (doc/docx) and Adobe Acrobat (pdf) file uploading options will not be available in inline
assignment submission.
 Students can submit HTML, Images, and plain text only in this inline Mode. You may also insert an image
file/table.
 Students can insert the images or snapshots in the following formats.

 Images and tables can be inserted using the following highlighted option in the interface .

OBJECTIVE
 The objective of this assignment is to provide hands-on experience in the:
 Paging parameters
 Logical and Physical Address Space
 Compiling and Running C Programs in a Linux environment.
NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding
or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is
recommended to upload the solution at least two days before its closing date.

If you people find any mistake or confusion in the assignment (Question statement), please consult with your
instructor before the deadline. After the deadline, no queries will be entertained in this regard.

For any query, feel free to email me at:


cs604p@vu.edu.pk
Questions No 01 20 marks
You are required to create the C program, that prompts the user to get the number of bits needed for Logical
Address Space and then prompts the user to get the total size of physical memory in MB. Finally, it should
prompt the user to get the Page Size in KB. After taking the required information your C Program should
calculate the following information:

 Maximum number of Pages p that can be accommodated in Logical Address Space.


 Number of Bits needed for the page size i.e. d
 Number of bits needed for the total number of pages p
 Number of frames f that can be accommodated in the Physical Memory
For the above calculations, you can use the following math functions: pow(), log2(), and ceil() in your C
Program.

The following should be the flow of your program.


 Firstly, compile your C program through the command line and link the math library by using the -
lm option.
 Run your program.

Note: You are required to send the screenshot along with the C Code.
Following is the sample screenshot:

Note: in case you have installed the Virtual Box you can take the screenshot as follows. Go to the view
menu and click on Take Screenshot as follows.
See the following link for the installation of Virtual Box and Ubuntu (Linux) on your system.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?
File=tutorial_for_installing_virtualbox_and_ubuntu.mp4

See the following link installing gcc and compiling and running your first program in Linux.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?File=How%20to%20install%20gcc%20on
%20Ubuntu%20and%20compile%20a%20C%20program.mp4

The End

You might also like