Starting from:

$29.99

Assignment - 7 system calls

CS2610: Computer Organization and Architecture
Lab
Lab Assignment - 7

• Objective: To understand the working of system calls.
• Team Size: 2
• Problem Statement: On modern operating systems, it is possible to mmap a file to a region
of memory. When it is done, the file can be accessed just like an array in the program.
Given an integer n, write a program in assembly to create a file input.txt and store n
(integer) numbers in it. Then your program should mmap the created file into your memory
using the mmap() system call, perform the following tasks by reading the numbers from the
file:
– Compute the sum of all numbers.
– Sort the numbers in ascending order using Insertion Sort.
fork() system call allows you to create child processes. Use fork() system call to create
a child process. The child process should do the first sub-task while the parent process
should do the second sub-task. You must issue the system calls using int instruction. Note
that the usage of mmap() and fork() system calls is must in this assignment. If there is
an issue with mmap, use mmap2.
• Sample Input:
3
10
5
8
• Child Output:
23
• Parent Output:
5
8
10
• Submission Guidelines:
– Write the code with proper comments wherever necessary and maintain proper indentation.
– Name the program with your roll no. Ex: If your roll no is CS20B151, your file
name should be CS20B151.asm. If there are multiple files, use CS20B151 1.asm,
CS20B151 2.asm etc.
– Place all the required files in a folder and compress the folder using zip compression.
Name your folder in the following format. If your roll no is CS20B151, name it as
CS20B151 A$.zip, where ’$’ denotes the assignment number.

More products