UNIX/Linux systems
Budget: $10 – $30 CAD
Part 1
Explanations of your solutions are important. Be specific in your explanations. Be factual.
Problem 2: Pagination
In a paged system, pages are 128 words of memory and each process is allowed to use at most 4 frames of main memory. Consider the following page table of process P1:
Page 0 1 2 3 4 5 6 8
Frame 011 110 111 100 000 010 101 001
Presence oui non Oui non Non non oui Non
Steps to follow :
1-How big is the address space of process P1?
2-How much RAM does this system have?
3-Calculate the real addresses corresponding to the following virtual addresses (you will report addressing errors if necessary):
120, 256, 132, 1023, 4096,115,56
4-What happens if P1 generates virtual address 425?
Part 2
The scripts you produce should be tested. In the case of development in C, make the development of your code on paper, as if you were a robot. If your script uses multiple parameters, test it with different data. To guarantee maximum points, it is important to test your solutions rigorously
Explanations of your solutions are important. Be specific in your explanations. Be factual.
Problem 1: File management
We consider a file system like that of UNIX/Linux, where we use inodes to access the information of the data blocks of a file.
We will assume that the size of the blocks that make up the files is fixed at 2k (2048 bytes), the inode of each file (its directory) contains 8 direct pointers to data blocks, 2 simple indirect pointers, 3 indirect pointers double and 2 triple indirect pointers.
Each pointer (block number) is represented on 2 bytes.
Steps to follow :
What is the largest file size this file system can support?
We consider a file containing 180,000 bytes. How many blocks of data are needed (in total) to represent this file on disk?
Problem 2: I/O Handling (inputs/outputs)
Write a program that takes as input 3 files file1.txt, file2.txt and file3.txt, the program should copy the contents of file1.txt to file3.txt, the contents of file3.txt to file2.txt and the contents from file file2.txt to file1.txt.
Explanations of your solutions are important. Be specific in your explanations. Be factual.
Problem 2: Pagination
In a paged system, pages are 128 words of memory and each process is allowed to use at most 4 frames of main memory. Consider the following page table of process P1:
Page 0 1 2 3 4 5 6 8
Frame 011 110 111 100 000 010 101 001
Presence oui non Oui non Non non oui Non
Steps to follow :
1-How big is the address space of process P1?
2-How much RAM does this system have?
3-Calculate the real addresses corresponding to the following virtual addresses (you will report addressing errors if necessary):
120, 256, 132, 1023, 4096,115,56
4-What happens if P1 generates virtual address 425?
Part 2
The scripts you produce should be tested. In the case of development in C, make the development of your code on paper, as if you were a robot. If your script uses multiple parameters, test it with different data. To guarantee maximum points, it is important to test your solutions rigorously
Explanations of your solutions are important. Be specific in your explanations. Be factual.
Problem 1: File management
We consider a file system like that of UNIX/Linux, where we use inodes to access the information of the data blocks of a file.
We will assume that the size of the blocks that make up the files is fixed at 2k (2048 bytes), the inode of each file (its directory) contains 8 direct pointers to data blocks, 2 simple indirect pointers, 3 indirect pointers double and 2 triple indirect pointers.
Each pointer (block number) is represented on 2 bytes.
Steps to follow :
What is the largest file size this file system can support?
We consider a file containing 180,000 bytes. How many blocks of data are needed (in total) to represent this file on disk?
Problem 2: I/O Handling (inputs/outputs)
Write a program that takes as input 3 files file1.txt, file2.txt and file3.txt, the program should copy the contents of file1.txt to file3.txt, the contents of file3.txt to file2.txt and the contents from file file2.txt to file1.txt.