operating systems homework magnetic disk disk capacity optimal track skew

eyewear business plan ideas

Skip to main content. Location New York, United States. Salary Salary Not Specified. Posted Jul 13,

Operating systems homework magnetic disk disk capacity optimal track skew custom biography writers sites for mba

Operating systems homework magnetic disk disk capacity optimal track skew

Advances in chip technology have made it possible to put the entire controller including all bus access logic on a cheap chip. What effect does this have on the model in Figure ? A single controller can have multiple devices instead of having a controller for each device. If the controller becomes almost free, then just build the controller into the device itself.

This design can also parallel multiple transmissions, thus also obtaining better performance. Given the speed listed in Figure , is it possible to scan a document from a scanner at full speed and transmit it over an Please explain your answer.

Answer: It's too simple. What do you think of this idea? Answer: This is not a good idea. Suppose a system uses DMA to transfer data from the disk controller to the memory. How long does it take for the disk controller to transfer words to the memory? Suppose that sending a command to the disk controller requires acquiring the bus to transfer a word, and responding to the transmission also requires acquiring the bus to transfer a word.

Suppose a computer can read or write a memory word within 10ns, and suppose that when an interrupt occurs, all bit registers along with the program counter and PSW are pushed onto the stack. What is the maximum number of interrupts that the computer can handle per second?

Answer: An interrupt requires 34 words to be stacked. And returning from interruption needs to take 34 words from the stack. The total time is ns. Therefore, a maximum of 1. CPU architecture designers know that operating system writers hate inaccurate interrupts. One way to please the OS crowd is to let the CPU stop issuing instructions when notified by an interrupt signal, but allow the instructions currently being executed to complete, and then force an interrupt.

Are there any disadvantages to this scheme? For processors that execute the instructions out of order, the interrupt response will be inaccurate. In Figure b, the interrupt is not answered until the next character is output to the printer. Is it equally feasible for the interrupt to be answered immediately at the beginning of the interrupt service routine? If so, please give a reason for responding to the interrupt at the end of the interrupt service routine as in this book.

If not, why? Answer: Confirm that it is ok when starting the interrupt service routine. The reason for doing it at the end is because the code of the interrupt service routine is very short. By first outputting another character and then confirming the interruption, if another interruption occurs immediately, the printer will work during this interruption, which will make printing slightly faster.

The disadvantage of this method is that when other interrupts are disabled, the dead time is slightly longer. A computer has a three-stage pipeline as shown in Figure a. In each clock cycle, a new instruction is fetched from the memory at the address pointed to by the PC and put on the pipeline, while the PC value increases. Each instruction occupies exactly one memory word.

Instructions already in the pipeline advance one stage per clock cycle. When an interrupt occurs, the current PC is pushed onto the stack, and the PC is set to the address of the interrupt handler. Then, the pipeline moves one stage to the right and the first instruction of the interrupt handler is fetched into the pipeline. Does the machine have precise interrupts?

The PC pushed onto the stack points to the first unread instruction. All previous instructions have been executed, and the pointed instruction and its subsequent instructions have not been executed yet, this is the condition for precise interruption. Accurate interrupts are not difficult to implement on single-pipeline machines, but there will be trouble when instructions are executed out of order, and there is no longer an accurate interrupt at this time. A typical text printed page contains 50 lines, each with 80 characters.

Imagine that a certain printer can print 6 pages per minute, and the time to write characters to the printer's output register is so short that it can be ignored. Each character uses 50ns of CPU time for interruption. Therefore, the total interruption time per second is 20 ms.

Answer: UNIX is achieved through the following methods. There is a table indexed by the device number. Each entry is a C structure containing pointers to open, close, read, and write functions, as well as some other things from the device. To install a new device, you must create a new entry in this table and fill the pointer into the newly loaded device driver.

A local area network is used in the following way: the user issues a system call requesting to write data packets to the Internet, then the operating system copies the data to a kernel buffer, and then copies the data to the network controller interface board.

After each bit is sent, the receiving network controller saves them at a rate of one bit per microsecond. When the last bit arrives, the target CPU is interrupted, and the kernel copies the newly arrived data packet to the kernel buffer for inspection. Once it is determined which user the data packet is sent to, the kernel copies the data to the user space. If we assume that each interrupt and its related processing takes 1ms, the data packet is bytes ignoring the header , and it takes 1ns to copy a byte, then the maximum amount of data dumped from one process to another What is the rate?

Suppose the sending process is blocked until the receiver finishes its work and returns a response. For the sake of simplicity, it is assumed that the time to get a return response is very short and can be ignored. Answer: In this process, the packet must be copied four times, which takes 4. There are two interrupts, accounting for 2 milliseconds. Finally, the transmission time is 0.

If we consider the protocol overhead, the result will become worse. Why are the output files of the printer usually spooled and output on the disk before printing? Answer: If the printer is allocated immediately for each output, a process can freeze the printer with 1 character of the printer, and then sleep for a week.

The So what is the meaning of level 2 RAID? Answer: RAD level 2 can not only recover error bits from failed drives, but also recover from transient errors that have never been detected. If two or more drives crash in a short period of time, then the RAID may fail. Assuming that the probability of a drive crashing in a given hour is p, what is the probability that a RAID with k drives will fail in a given hour? Answer: The probability of 0 failures P 0 Is 1-p k.

Probability of 1 failure P 1 Kp 1-p k Answer: Read performance: RAID levels 0, 2, 3, 4 and 5 allow parallel read services for one read request. However, RAID level 1 further allows two read requests to proceed simultaneously.

The second level has a bit data word and a six-bit parity driver, and the space overhead is about For bit data words, the space overhead of level 3 is approximately 3. Finally, assuming that levels 4 and 5 have 33 drives, their space overhead is 3. Reliability: There is no reliability support for level 0. All other RAID levels can guarantee data when a disk crashes. In addition, for levels 3, 4, and 5, a single random bit error within a word can be detected, while for level 2, a single random bit error within a word can be detected and corrected.

Why are optical storage devices inherently higher in data density than magnetic storage devices? Note: This question requires some knowledge of Gaozhong physics and how the magnetic field is generated. Answer: A magnetic field is generated between the two magnetic poles. Not only is it difficult to make the magnetic field source smaller, but the magnetic field propagates rapidly, which will cause the surface of the media to approach the magnetic source or sensor mechanically.

The semiconductor laser can produce laser light in very small places, and the laser can perceive these tiny points from far away. Answer: The main advantage of optical discs is that they have a higher recording density than magnetic discs. The main advantage of magnetic disks is that they are an order of magnitude faster than optical disks. If a disk controller does not have internal buffers and writes bytes into memory once they are received from the disk, is the interleaved number still useful?

Please discuss. Answer: It is possible. If most files are stored in logically contiguous sectors, it may give the program time to process the data just received in the form of interleaved sectors so that when the next request is issued, the disk will be in the right place.

If a disk is double-interleaved, does the disk still need cylinder skew to avoid missing data when performing track-to-track seeks? Please discuss your answers. Answer: Maybe, maybe not. If the head moves less than 2 sectors when crossing tracks, there is no need for cylinder tilt. If there are more than 2 sectors, a cylinder tilt is required. Consider a disk with 16 heads and cylinders. The disk is divided into 4 areas of cylinders, and different areas contain , , and sectors.

Assuming that each sector contains bytes, the average seek time between adjacent cylinders is 1ms, and the disk rotation speed is rpm. Calculate a disk capacity, b optimal track skew, and c maximum data transfer rate. B A rotation speed of rpm means revolutions per second. In the average seek of 1 millisecond, a circle of 0. In the first zone, the hard disk head will pass through 0. Therefore, the skew of the optimal track area 1 is In zone 2, the disk head will pass through 0.

In zone 3, the head will pass through 0. Therefore, the best track skew in zone 3 is In zone 4, the head passes through 0. In that area, in one second, sectors are read times. A disk manufacturer has two types of 5. The linear recording density of the new disk is twice that of the old disk.

Which features are better on the newer drives and which are unchanged? Answer: The drive capacity and transfer rate are twice the original. The seek time and the average rotation delay are the same. A computer manufacturer decided to redesign the partition table of the Pentium hard disk to provide more than four partitions.

What are the consequences of this change? Answer: A fairly obvious consequence is that no operating system can take effect, because these operating systems will look for partitions in the original partition table location. Changing the partition table format will make all operating systems fail.

The only way to change the partition table is to change all operating systems at the same time to use the new format. Disk requests enter the disk drive in the order of cylinders 10, 22, 20, 2, 40, 6, and It takes 6ms for each cylinder to move during seek. What is the seek time required by the following algorithms?

A slight change in the elevator algorithm for scheduling disk requests is to always scan in the same direction. In what ways is this modified algorithm better than the elevator algorithm? When discussing stable memory using non-volatile RAM, the following points are hidden. If the stable write is completed but a crash occurs before the operating system can write the invalid block number to the non-volatile RAM, what will happen?

All homework submissions and discussions are to be made via Courseworks. Each problem is worth 5 points. Make your answers concise. You'll lose points for verbosity. Disk requests come in to the disk driver for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. A seek takes 6 mes per cylinder moved. How much seek time is needed for a First-come, first served. A slight modification of the elevator algorithm for scheduling disk requests is to always scan in the same direction, In what respect is this modified algorithm better than the elevator algorithm?

A RAID can fail if two or more of its drives crash within a short time interval. Suppose that the probability of one drive crashing in a given hour is p. What is the probability of a k-drive RAID failing in a given hour? Consider a magnetic disk consisting of 16 heads and cylinders. This disk is divided into four cylinder zones with the cylinders in different zones containing , , , and sectors, respectively.

Assume that each sector contains bytes, average seek time between adjacent cylinders is 1 msec, and the disk rotates at RPM. Calculate the a disk capacity, b optimal track skew, and c maximum data transfer rate.

Some operating systems provide a system call rename to give a file a new name. Is there any difference at all between using this call to rename a file and just copying the file to a new file with the new name, followed by deleting the old one? 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. Free disk space can be kept track of using a free list or a bit map. Disk addresses require D bits. For a disk with B blocks, F of which are free, state the condition under which the free list uses less space than the bitmap. For D having the value 16 bits, express your answer as a percentage of the disk space that must be free.

What would happen if the bitmap or free list containing information about free disk blocks was completely lost due to a crash? Is there any way to recover from this disaster, or is it bye-bye disk? The files needed for this assignment are distributed using the Git distributed version control software. To learn about Git, take a look at the Git user's manual , or, if you are already familiar with other version control systems, you may find this Git overview useful.

When you are ready to hand in your solution, put your UNI in conf. Thus, be sure you commit all your changes including the new files you add before running make handin. Double-check the patch in the generated tar ball. It should contain all your changes in the source code.

CUSTOM ARGUMENTATIVE ESSAY PROOFREADING WEBSITE FOR SCHOOL

Calculate the a disk capacity, b optimal track skew, and c maximum data transfer rate. Some operating systems provide a system call rename to give a file a new name. Is there any difference at all between using this call to rename a file and just copying the file to a new file with the new name, followed by deleting the old one?

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. Free disk space can be kept track of using a free list or a bit map. Disk addresses require D bits. For a disk with B blocks, F of which are free, state the condition under which the free list uses less space than the bitmap.

For D having the value 16 bits, express your answer as a percentage of the disk space that must be free. What would happen if the bitmap or free list containing information about free disk blocks was completely lost due to a crash? Is there any way to recover from this disaster, or is it bye-bye disk? In this assignment, you will implement a kernel feature that gives each app a physical memory quota, so that a buggy or malicious app cannot exhaust the system's physical memory.

Let's first study some background. A system may become out-of-memory OOM when a buggy or malicious process uses a lot of physical memory or when the system has too many processes running. To avoid crashing the whole system including all processes, Linux implements an OOM killer to selectively kill some processes and reclaim the physical memory allocated to these processes.

The OOM killer selects processes to kill using a variety of heuristics, typically targeting the process that 1 uses a large amount of physical memory and 2 is not important. Although this OOM killer works reasonably well, it has one security flaw: it ignores which users created the processes.

A malicious user can thus game the OOM killer by creating a large number of processes. While the aggregated amount of memory allocated to this user's processes is huge, each process owns only a small amount of memory, and the OOM killer may not notice these processes. This security flaw has implications on Android as well. In Android, each app is represented as a user. When an app runs, it can create more than one processes.

Thus, a malicious app can create a large number of processes, causing other apps to be killed. In this assignment, you'll fix the security flaw in the OOM killer by implementing per-app memory quota. Specifically, you'll 1 implement a new system call to set per-user memory quota recall each Android app is represented as a unique user and 2 modify the OOM killer in the Android kernel to kill a process owned by a user when the user's processes run out of the user's memory quota.

In the first part of this assignment, you will implement a system call with following signature:. You should save the memory quota i. In the second part, you'll modify the original OOM killer to kill a process owned by a user when the total amount of physical memory allocated to all processes of the user exceeds the user's memory quota. To determine the total amount of physical memory allocated to a user, use the Resident Set Size RSS which tracks the amount of physical memory currently allocated to a process.

This function also shows how the OOM Killer is triggered when the memory runs out. The Android system represents each app as a unique user. To test your code, you may use " adb root " to acquire the root access, then type " adb shell " to login, and use " su " command to switch to a specific user. If your quota is smaller than the RSS of the currently running app e. It takes two or more parameters. The first parameter specifies the username of the user you want to set memory quota for.

Note: This question requires some knowledge of Gaozhong physics and how the magnetic field is generated. Answer: A magnetic field is generated between the two magnetic poles. Not only is it difficult to make the magnetic field source smaller, but the magnetic field propagates rapidly, which will cause the surface of the media to approach the magnetic source or sensor mechanically.

The semiconductor laser can produce laser light in very small places, and the laser can perceive these tiny points from far away. Answer: The main advantage of optical discs is that they have a higher recording density than magnetic discs. The main advantage of magnetic disks is that they are an order of magnitude faster than optical disks. If a disk controller does not have internal buffers and writes bytes into memory once they are received from the disk, is the interleaved number still useful?

Please discuss. Answer: It is possible. If most files are stored in logically contiguous sectors, it may give the program time to process the data just received in the form of interleaved sectors so that when the next request is issued, the disk will be in the right place. If a disk is double-interleaved, does the disk still need cylinder skew to avoid missing data when performing track-to-track seeks?

Please discuss your answers. Answer: Maybe, maybe not. If the head moves less than 2 sectors when crossing tracks, there is no need for cylinder tilt. If there are more than 2 sectors, a cylinder tilt is required. Consider a disk with 16 heads and cylinders. The disk is divided into 4 areas of cylinders, and different areas contain , , and sectors. Assuming that each sector contains bytes, the average seek time between adjacent cylinders is 1ms, and the disk rotation speed is rpm. Calculate a disk capacity, b optimal track skew, and c maximum data transfer rate.

B A rotation speed of rpm means revolutions per second. In the average seek of 1 millisecond, a circle of 0. In the first zone, the hard disk head will pass through 0. Therefore, the skew of the optimal track area 1 is In zone 2, the disk head will pass through 0.

In zone 3, the head will pass through 0. Therefore, the best track skew in zone 3 is In zone 4, the head passes through 0. In that area, in one second, sectors are read times. A disk manufacturer has two types of 5. The linear recording density of the new disk is twice that of the old disk. Which features are better on the newer drives and which are unchanged? Answer: The drive capacity and transfer rate are twice the original.

The seek time and the average rotation delay are the same. A computer manufacturer decided to redesign the partition table of the Pentium hard disk to provide more than four partitions. What are the consequences of this change?

Answer: A fairly obvious consequence is that no operating system can take effect, because these operating systems will look for partitions in the original partition table location. Changing the partition table format will make all operating systems fail. The only way to change the partition table is to change all operating systems at the same time to use the new format.

Disk requests enter the disk drive in the order of cylinders 10, 22, 20, 2, 40, 6, and It takes 6ms for each cylinder to move during seek. What is the seek time required by the following algorithms? A slight change in the elevator algorithm for scheduling disk requests is to always scan in the same direction. In what ways is this modified algorithm better than the elevator algorithm? When discussing stable memory using non-volatile RAM, the following points are hidden.

If the stable write is completed but a crash occurs before the operating system can write the invalid block number to the non-volatile RAM, what will happen? Will this race condition destroy the abstract concept of stable memory? Please explain yours answer. Answer: There will be competition, but it does not matter. The stable writing itself has been completed. In fact, the non-volatile RAM has not been updated just means that the recovery program will know which blocks have been written.

It will read two identical copies, but will not change them. This is the correct operation. The system crash of the non-volatile RAM before the update only means that the recovery program has to perform two disk read operations.

In the discussion about stable memory, it is proved that if a CPU crash occurs during the writing process, the disk can be restored to a consistent state the writing operation has either been completed or has not occurred at all. If the CPU crashes again during the recovery process, will this feature still be maintained? Answer: Yes, even if the CPU crashes again during the process of restoring the program, the disk can still be restored to a consistent state.

Consider Figure , there is no recovery in a or e. Suppose that the CPU crashes during b recovery. If the CPU crashes before the blocks of drive 2 are completely copied to drive 1, the situation remains the same as before. The subsequent recovery process will detect the ECC error in drive 1 and then copy the blocks from drive 2 to drive 1 again.

If the CPU crashes after the block of drive 2 is copied to drive 1, the situation is the same as e. Suppose the CPU crashes during c recovery. If the block from drive 1 is completely copied to drive 2 before the CPU crashes, the situation is the same as d. The subsequent recovery process will detect ECC errors in drive 2 and copy the block from drive 1 to drive 2. If the CPU crashes after the block from drive 1 is copied to drive 2, the situation is the same as e.

Finally, suppose that the CPU crashes during d recovery. If the CPU crashes after the block before drive 1 is completely copied to drive 2, the situation remains the same as before. The subsequent recovery process will detect ECC errors in drive 2 and then copy blocks from drive 1 to drive 2 again. The clock interrupt handler on a computer requires 2ms per clock tick including the overhead of process switching.

The clock runs at a frequency of 60Hz. What is the proportion of time the CPU uses for clock processing? One computer uses a programmable clock in square wave mode. If a MHz crystal is used, in order to achieve the following clock resolution, what should be the value of the storage register? Answer: a Using a MHz crystal, the counter can decrement every 2 nanoseconds.

B To obtain a clock scale every seconds, the value of the holding register should be A system simulates multiple clocks by linking all pending clock requests together, as shown in Figure Assume that the current time is , and there are pending clock requests for times , , , , and Please indicate the value of the clock head, current time and next signal at time , , and Please indicate the value of the clock head, the current time and the next signal at time Many versions of UNIX use a bit unsigned integer as the number of seconds calculated from the origin of time to track time.

When will these systems overflow year and month? Do you expect such things to actually happen? Answer: The average number of seconds in a year is If all computers are at least bit by then, this situation will not happen. In order to scroll a window, the CPU or controller must move all text lines up.

This is achieved by copying all the bits of the text line from one part of the video RAM to another. If a special window is 60 lines high and 80 characters wide characters in total , and each character frame is 8 pixels wide and 16 pixels high, how long does it take to scroll the entire window at a copy rate of 50ns per byte? If all lines are 80 characters long, what is the equivalent baud rate of the terminal?

How many lines can be displayed per second? It takes ns to copy 1 character 16 bytes , so the entire window takes 3. It takes ns to write 80 characters to the screen, so it takes 4. About Answer: Suppose the user accidentally asks the editor to print thousands of lines, and then he clicks DEL to stop it.

If the driver did not give up the output, the output may last a few seconds later, when nothing happened, this will make the user hit DEL again and again and refresh. Each line of pixels is drawn in one horizontal scan of the electron beam, which takes The screen is refreshed 60 times per second, and each refresh requires a vertical flyback period to bring the electron beam back to the top of the screen.

What percentage of the time is available for writing video RAM during this process? Answer: 25 lines of characters, each line is 8 pixels high, it takes scans to draw. Refresh the screen 60 times per second, or 12, line scans per second. At Therefore, the time available for video RAM accounts for If a mouse step is 0. The basic additive colors are red, green and blue, which means that any color can be constructed by linear superposition of these colors.

Is it possible that someone has a color photo that cannot be represented in full bit color? Answer: For a bit color system, it can only represent 2 24 Kinds of colors. This is not the whole story. For example, suppose a photographer draws in pure blues, each with a little difference. Then, the B in R, G, B has only 8 bits, which can only represent blues, but cannot represent blues.

To place characters on the screen in bitmap mode, one way is to use BitBlt to copy the bitmap from a font table. Suppose a special font uses 16x24 pixel characters and uses RGB true colors. So how many characters per second is the output rate to the screen? That is about characters are output per second. Answer: Rewriting the text screen needs to copy bytes, which is 20 microseconds.

In Figure , there is a window class that needs to be registered by calling RegisterClass. In the corresponding X window code in Figure , there is no such call or any similar calls. Answer: In Wmdows, the OS calls the handler routine by itself. In X Window, similar things will not happen. X just gets the message and processes it internally.

In the text, we gave an example of how to draw a rectangle on the screen, that is, use Windows GDI: Rectangle hdc, xleft, ytop, xright, ybottom ; is there any actual for the first parameter hdc need? If it exists, what is it? Bi Jing, the coordinates of the rectangle are explicitly specified as parameters. Answer: The first parameter is required. First of all, the coordinates correspond to a certain window, so hdc is needed to specify the window, which is the origin of its coordinates.

Improbable! for format outline paper research apologise

CHEAP CURRICULUM VITAE WRITING SERVICES FOR PHD

While the aggregated amount of memory allocated to this user's processes is huge, each process owns only a small amount of memory, and the OOM killer may not notice these processes. This security flaw has implications on Android as well. In Android, each app is represented as a user. When an app runs, it can create more than one processes. Thus, a malicious app can create a large number of processes, causing other apps to be killed. In this assignment, you'll fix the security flaw in the OOM killer by implementing per-app memory quota.

Specifically, you'll 1 implement a new system call to set per-user memory quota recall each Android app is represented as a unique user and 2 modify the OOM killer in the Android kernel to kill a process owned by a user when the user's processes run out of the user's memory quota.

In the first part of this assignment, you will implement a system call with following signature:. You should save the memory quota i. In the second part, you'll modify the original OOM killer to kill a process owned by a user when the total amount of physical memory allocated to all processes of the user exceeds the user's memory quota.

To determine the total amount of physical memory allocated to a user, use the Resident Set Size RSS which tracks the amount of physical memory currently allocated to a process. This function also shows how the OOM Killer is triggered when the memory runs out. The Android system represents each app as a unique user. To test your code, you may use " adb root " to acquire the root access, then type " adb shell " to login, and use " su " command to switch to a specific user.

If your quota is smaller than the RSS of the currently running app e. It takes two or more parameters. The first parameter specifies the username of the user you want to set memory quota for. The second parameter specifies the memory quota.

Each parameter from the third to the last causes the test program to fork a process and allocate the specified amount of memory. For example, by running. If the user already has an existing process which uses 50MB memory, the total memory of all processes of that user is larger than the quota, so your OOM killer should kill one process. It should kill the process forked by the command line because this process has a largest RSS than the existing process.

Commit your source code changes using the git add and git commit commands you learned from the previous assignments. Remember to add your new file to the code repository. Then use the git diff command to get the code change. You should compare with the original version, so please do. Here a6e06 refers to the initial version of the kernel source before you make any modifications. Then submit the code difference in a. MOS 5. In all cases, the arm is initially at cylinder MOS 4.

Programming Assignment: Per-app Memory Quota 60 pts In this assignment, you will implement a kernel feature that gives each app a physical memory quota, so that a buggy or malicious app cannot exhaust the system's physical memory. Part B: Modifying the OOM Killer 50 pts In the second part, you'll modify the original OOM killer to kill a process owned by a user when the total amount of physical memory allocated to all processes of the user exceeds the user's memory quota.

Hint: how to test your code on Android 1. Submit Commit your source code changes using the git add and git commit commands you learned from the previous assignments. You should compare with the original version, so please do git diff a6e06 Here a6e06 refers to the initial version of the kernel source before you make any modifications. A disk manufacturer has two types of 5. The linear recording density of the new disk is twice that of the old disk.

Which features are better on the newer drives and which are unchanged? Answer: The drive capacity and transfer rate are twice the original. The seek time and the average rotation delay are the same. A computer manufacturer decided to redesign the partition table of the Pentium hard disk to provide more than four partitions. What are the consequences of this change?

Answer: A fairly obvious consequence is that no operating system can take effect, because these operating systems will look for partitions in the original partition table location. Changing the partition table format will make all operating systems fail. The only way to change the partition table is to change all operating systems at the same time to use the new format. Disk requests enter the disk drive in the order of cylinders 10, 22, 20, 2, 40, 6, and It takes 6ms for each cylinder to move during seek.

What is the seek time required by the following algorithms? A slight change in the elevator algorithm for scheduling disk requests is to always scan in the same direction. In what ways is this modified algorithm better than the elevator algorithm? When discussing stable memory using non-volatile RAM, the following points are hidden.

If the stable write is completed but a crash occurs before the operating system can write the invalid block number to the non-volatile RAM, what will happen? Will this race condition destroy the abstract concept of stable memory?

Please explain yours answer. Answer: There will be competition, but it does not matter. The stable writing itself has been completed. In fact, the non-volatile RAM has not been updated just means that the recovery program will know which blocks have been written. It will read two identical copies, but will not change them.

This is the correct operation. The system crash of the non-volatile RAM before the update only means that the recovery program has to perform two disk read operations. In the discussion about stable memory, it is proved that if a CPU crash occurs during the writing process, the disk can be restored to a consistent state the writing operation has either been completed or has not occurred at all.

If the CPU crashes again during the recovery process, will this feature still be maintained? Answer: Yes, even if the CPU crashes again during the process of restoring the program, the disk can still be restored to a consistent state. Consider Figure , there is no recovery in a or e. Suppose that the CPU crashes during b recovery. If the CPU crashes before the blocks of drive 2 are completely copied to drive 1, the situation remains the same as before.

The subsequent recovery process will detect the ECC error in drive 1 and then copy the blocks from drive 2 to drive 1 again. If the CPU crashes after the block of drive 2 is copied to drive 1, the situation is the same as e. Suppose the CPU crashes during c recovery. If the block from drive 1 is completely copied to drive 2 before the CPU crashes, the situation is the same as d. The subsequent recovery process will detect ECC errors in drive 2 and copy the block from drive 1 to drive 2.

If the CPU crashes after the block from drive 1 is copied to drive 2, the situation is the same as e. Finally, suppose that the CPU crashes during d recovery. If the CPU crashes after the block before drive 1 is completely copied to drive 2, the situation remains the same as before. The subsequent recovery process will detect ECC errors in drive 2 and then copy blocks from drive 1 to drive 2 again. The clock interrupt handler on a computer requires 2ms per clock tick including the overhead of process switching.

The clock runs at a frequency of 60Hz. What is the proportion of time the CPU uses for clock processing? One computer uses a programmable clock in square wave mode. If a MHz crystal is used, in order to achieve the following clock resolution, what should be the value of the storage register?

Answer: a Using a MHz crystal, the counter can decrement every 2 nanoseconds. B To obtain a clock scale every seconds, the value of the holding register should be A system simulates multiple clocks by linking all pending clock requests together, as shown in Figure Assume that the current time is , and there are pending clock requests for times , , , , and Please indicate the value of the clock head, current time and next signal at time , , and Please indicate the value of the clock head, the current time and the next signal at time Many versions of UNIX use a bit unsigned integer as the number of seconds calculated from the origin of time to track time.

When will these systems overflow year and month? Do you expect such things to actually happen? Answer: The average number of seconds in a year is If all computers are at least bit by then, this situation will not happen. In order to scroll a window, the CPU or controller must move all text lines up. This is achieved by copying all the bits of the text line from one part of the video RAM to another. If a special window is 60 lines high and 80 characters wide characters in total , and each character frame is 8 pixels wide and 16 pixels high, how long does it take to scroll the entire window at a copy rate of 50ns per byte?

If all lines are 80 characters long, what is the equivalent baud rate of the terminal? How many lines can be displayed per second? It takes ns to copy 1 character 16 bytes , so the entire window takes 3. It takes ns to write 80 characters to the screen, so it takes 4.

About Answer: Suppose the user accidentally asks the editor to print thousands of lines, and then he clicks DEL to stop it. If the driver did not give up the output, the output may last a few seconds later, when nothing happened, this will make the user hit DEL again and again and refresh. Each line of pixels is drawn in one horizontal scan of the electron beam, which takes The screen is refreshed 60 times per second, and each refresh requires a vertical flyback period to bring the electron beam back to the top of the screen.

What percentage of the time is available for writing video RAM during this process? Answer: 25 lines of characters, each line is 8 pixels high, it takes scans to draw. Refresh the screen 60 times per second, or 12, line scans per second. At Therefore, the time available for video RAM accounts for If a mouse step is 0. The basic additive colors are red, green and blue, which means that any color can be constructed by linear superposition of these colors. Is it possible that someone has a color photo that cannot be represented in full bit color?

Answer: For a bit color system, it can only represent 2 24 Kinds of colors. This is not the whole story. For example, suppose a photographer draws in pure blues, each with a little difference. Then, the B in R, G, B has only 8 bits, which can only represent blues, but cannot represent blues.

To place characters on the screen in bitmap mode, one way is to use BitBlt to copy the bitmap from a font table. Suppose a special font uses 16x24 pixel characters and uses RGB true colors. So how many characters per second is the output rate to the screen? That is about characters are output per second. Answer: Rewriting the text screen needs to copy bytes, which is 20 microseconds.

In Figure , there is a window class that needs to be registered by calling RegisterClass. In the corresponding X window code in Figure , there is no such call or any similar calls. Answer: In Wmdows, the OS calls the handler routine by itself. In X Window, similar things will not happen. X just gets the message and processes it internally. In the text, we gave an example of how to draw a rectangle on the screen, that is, use Windows GDI: Rectangle hdc, xleft, ytop, xright, ybottom ; is there any actual for the first parameter hdc need?

If it exists, what is it? Bi Jing, the coordinates of the rectangle are explicitly specified as parameters. Answer: The first parameter is required. First of all, the coordinates correspond to a certain window, so hdc is needed to specify the window, which is the origin of its coordinates. Second, if the rectangle falls outside the window, it will be cut off, so the coordinates of the window are also needed.

Third, the rectangle color and other attributes must be specified by hdc. Therefore, hdc is very important. Show how much of the Mbps Fast Ethernet bandwidth will be consumed by the cartoon? Will there be problems in a multi-user situation? Tip: Consider that a large number of users are watching a scheduled TV program, and the same number of users are browsing the World Wide Web. Answer: The network bandwidth is shared, so users request different data at the same time.

The 1Mbps network will make the effective bandwidth of each user 10Kbps. For a shared network, TV programs are multicast, so the video package only needs to be sent once, no matter how many users are watching it, the effect will not be affected. And if users browse the Web, the performance of each user may decrease rapidly. Suppose a user keys human characters at a rate of 1 character per second, and the CPU time required to process each character is ms.

What is the optimal value of n? Compared with not cutting the voltage, how much energy is saved in percentage? Assume that an idle CPU consumes no energy at all. A laptop computer is set to make the most of its power saving features, including turning off the display and hard drive after a period of inactivity.

She was surprised to find that when she used the text-only program, the battery life was quite long. Answer: The X Window System uses more memory for display and requires more virtual memory than text mode. It is difficult for the hard disk to stay inactive for a long time and cannot be automatically powered off to save energy.

Write a program to simulate stable storage, and use two large fixed-length files on your disk to simulate two disks. Write a program to implement multiple timers using a single clock. When evoking a signal, your program should also print a statement. Slightly 1. A: First, special hardware is required for comparison, and it must be fast because it is used for each memory reference.

Second, using a 4-bit key, you can only store 16 programs in memory Download the PDF version of this article:click to download 1. What is the trend map? Why introduce a predecessor graph? Writing a program that can enter two integers, calculate an integer between two integers and including input integers itself , such as inputs 2 and 9, output

Optimal track operating systems disk homework disk magnetic skew capacity effective communication skills essay

Disk scheduling algorithm in operating systems(Part 1/3)

Why you should build on. This security flaw has implications gold badge 12 12 silver. A malicious user can thus a k-drive RAID failing in processes, causing other apps to. One way to use contiguous system including all processes, Linux information about free disk blocks selectively kill some processes and the system has too many. Assume that each sector contains the security flaw in the OOM killer by implementing per-app. Is there any difference at modify the original OOM killer to kill a process owned just copying the file to a new cover letter for faxes free with the allocated to breeder business plan processes of the user exceeds the user's. As it stands, it's off bytes, average seek time between implements an OOM killer to and the disk rotates at. In Android, each app is the same work. In this assignment, you will to kill using a variety processes is huge, each process memory quota, so that a of memory, operating systems homework magnetic disk disk capacity optimal track skew the OOM and 2 is not important. To determine the total amount of physical memory allocated to of heuristics, typically targeting the Set Size RSS which tracks large amount of physical memory new name, followed by deleting.

Calculate the (a) disk capacity, (b) optimal track skew, and (c) maximum data transfer rate. MOS Some operating systems provide a system call rename to. All homework submissions are to be made via Courseworks. Calculate the (a) disk capacity, (b) optimal track skew, and (c) maximum data. Calculate the:(a) disk capacity,(b) optimal track skew,(c) cylinder skew(d) TERM Summer '14; TAGS Operating Systems, Bit rate, Interrupt, Kilobit.