Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

Operating Systems Assignment

1. What is the difference between symbolic and hard links to files? On the os server, What happens when you try to create a symbolic link in /temp to a file that is in your home directory? How about a hard link? Explain what happens.

2. A UNIX file system has 4096-byte blocks (this is typical) and 4-byte disk addresses. What is the maximum file size if i-nodes contain 100 direct entries, and one single and one double indirect entry? What happens when you add one triple indirect entry?

3. Using the stat utility on the os server, what can you say about how renaming a file differs from copying a file and deleting the old one, and how copying a file to a different directory differs from moving the file there?

4. One way to use contiguous allocation of the disk and not suffer from holes is to compact the disk every time a file is removed. Since all files are contiguous, copying a file requires a seek and rotational delay to read the file, followed by the transfer at full speed. Writing the file back requires the same work. Assume you have a modern disk with an average seek time of 15 msec, operates at 7200RPM, and has a transfer rate of 6 Gbps. If the average file size is 16 KB, how long does it take to read a file into main memory and write it back to a new location? (Assume no prefetching and cold caches.) How long would it take to compact half of a 2 TB disk?

5. How many disk operations are needed to fetch the i-node for the file /dir1/dir2/dir3/myfile? Assume that the i-node for the root directory is in memory, but nothing else along the path is in memory. Also assume that all directories fit in one disk block.

6.

(a) Write a C program that reverses the bytes of a given arbitrary length file and outputs them to another specified file, which should be overwritten if it already exists. So, invoking your program as follows

./reverse infile outfile

will result in the first byte of outfile being the last byte of infile, and so on until the last byte of outfile is the first byte of infile. The given filenames are just an example, make your own infile. You must use fseek()/fread()/fwrite().

(b) Write another C program that reverses the bytes of a given arbitrary length file in-place, as in, the contents of the file are swapped without a temporary file and without producing a second file. Use mmap(). E.g. ./reverse2 infile results in the contents of infile being reversed after the call, and calling ./reverse2 infile twice should result in the same file as you started with.

(c) Compare the performance of ./reverse with ./reverse2. Use the timing function below to target your timing to just the portion of the program which actually does the reversing and produces output. Get the averages of a bunch of runs.

#include #include #include

// you may use this to convert the contents of the timeval struct to ns long nanosec(struct timeval t){
return((t.tv_sec*1000000+t.tv_usec)*1000);
}

int main(){ int res;
struct timeval t1, t2;

res=gettimeofday(&t1,NULL); assert(res==0);
//stuff you want to measure might go here res=gettimeofday(&t2,NULL); assert(res==0);
//find average time here
}

7. Write a wc utility that takes in a single filename as an argument, and computes the number of characters, words, and lines present in that file. Now, have this wc store the name of the input file, and numbers of characters, words, and lines in a binary file (put all the information you're going to save into a struct, then write that struct out to a file); call the file wc.saved. Each time this wc is invoked from the command line, and only if the input file exists and is readable, use explicit file I/O to add the file's information to wc.saved if that file's information is not already present in wc.saved. If information about the file already exists use mmap to edit its entry to reflect the latest counts. Add a -p option to your program so that invoking wc -p prints all the collected data out of wc.saved (reasonably formatted, of course).

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M92518387
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Operating System

Question 1answer the following questions 10 marks a

Question 1 Answer the following questions: 10 marks a. Consider the following page reference string: 3, 1, 4, 1, 2, 3, 5, 3, 2, 1, 2,5, 4, 3, 5, 2, 4,2, 5,3 Using the above page reference string display the contents of t ...

Question students working at individual pcs in a computer

Question : Students working at individual PC's in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for ...

Question topic computerized operating systems os are almost

Question: Topic: Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use our phone or tablet. Find articles that describes the diff ...

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

Assignment -building a multi-threaded web server using c

Assignment - Building a multi-threaded web server using C and p threads, following the model from the lecture. Your program will have one thread acting as a dispatcher thread, listening fornetwork connections with reques ...

Question research hex editors available for mac os and

Question : Research hex editors available for Mac OS and Linux. Based on the documentation, how easy would validating these tools be? Select at least two hex editors for each OS, and discuss what you would do to validate ...

Catalog course descriptionin this course students carry out

Catalog Course Description In this course students carry out independent research in a significant technical area of information, network, and computer security. The student is to investigate a technical area, research i ...

Question you are a security administrator responsible for

Question: You are a security administrator responsible for providing secure configuration requirements for new laptop deployments. After reading Module 2 of Certified Secure Computer User v2exercises, apply the configura ...

Question note apa format 250 words and three reference

Question: Note: APA format 250 words and three reference without plagarism Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use ...

Taskyour job in this assignment is to create two virtual

Task Your job in this assignment is to create two Virtual machines each running a different but the latest distribution of Linux e.g. Ubuntu Server and CentOS. Each of these VM's is to offer services to a user base. The ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As