Question: Part I: Virtual Memory Questions 1 . A certain computer provides its users with a virtual - memory space of 2 3 2 bytes. The
Part I: Virtual Memory Questions
A certain computer provides its users with a virtualmemory space of bytes. The
computer has bytes of physical memory. The virtual memory is implemented by
paging, and the page size is bytes. A user process generates the virtual address
this is in hexadecimal base Explain how the system establishes the
corresponding physical location. Distinguish between software and hardware
operations. Feel free to use a diagram simple ASCII is fine if you wish, but thats
not required.
Assume we have a demandpaged memory. The page table is held in registers. It takes
milliseconds to service a page fault if an empty page is available or if the replaced
page is not modified, but milliseconds if the replaced page was modified. Memory
access time is nanoseconds.
Assume that the page to be replaced is modified of the time. What is the
maximum acceptable pagefault rate for an effective access time of no more than
nanoseconds? Show your work
Coding:
Write UnixLs, a program that emulates ls in UnixLs.c
Implement only the following options:
i
l
Testing:
To test the program simply run the program and specify the options the same way
you would for the ls command. Be sure to test every option you have
implemented and all the permutations of the various options egililil
etc. Of course, don't forget the most obvious test of all, no options. You can
determine if your output is correct by observing what ls with similar options
produces.
The output of your program should mimic the standard ls command with the following
exceptions:
You should require that any options l il i to your command come before any
directory names. The standard ls command allows options to appear between and
after directory arguments.
File listing order does not have to be identical to ls You may list the files in whatever
order is convenient for you rather than sorted alphabetically as ls normally does.
To simplify the printing of dates, you are to use the format
mmm dd yyyy hh:mm
regardless of the date. An example date would look like:
Oct :
The real ls command omits the year if the date is less than a year in the past and
replaces the minutes and seconds with the year if the date is more than a year in the
past.
When performing a long listing l there is no need to print the line that begins with
"total".
You should print the files one per line as ls does, rather than attempting to format
the list of files into multiple columns.
Here are a few other test cases you should try:
ls i ~
ls l
ls i l ~
ls li ~
Then replace ls with "UnixLs". The output should be very similar to the original ls
command; however the order with which you list the entries is allowed to be different.
Also note that you may have an alias for ls that provides some arguments all the time. To
see if you have an alias for ls type alias ls and to make the alias go away for the
duration of the life of your current shell type unalias ls
Hints
Focus on extracting the proper information and just printing it Once you have
that all done work on making the format match the ls command.
Consult the the provided file infodemo.c to see what calls to use to get actual
group and user names.
Consult the provided tutorials in the assignments section of the course webpage
for information on UNIX file system structure.
Don't forget to test your code on directories with symbolic links in them.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
