Αρχική ΑΕΠΠ - Δομές Δεδομένων Λειτουργικά Συστήματα Δίκτυα Υπολογιστών ΙΙ Βάσεις Δεδομένων Παιδαγωγικά - Διδακτική

Εισαγωγικά

Εισαγωγή στα Λ.Σ. Βασικές Δομές Η/Υ Βασικές Δομές Λ.Σ

Διεργασίες

Διεργασίες Χρονοπρογραμματισμός Συγχρονισμός

Αδιέξοδα

Μνήμη

Μονοπρογραμματισμός Εναλλαγή Εικονική Μνήμη Κατάτμηση

Είσοδος / Έξοδος

Σύστημα Αρχείων

Διεπαφή Υλοποίηση

 Ιστορικό Πρόσφατες αλλαγές Εκτύπωση Αναζήτηση

Ιστορικό: OS.Implementation

Απόκρυψη μικρών αλλαγών - Αλλαγές περιεχομένου

19-08-2008 (12:56) από Άρης -
Πρόσθεση σειρών 176-200:

! Συστήματα Αρχείων

!!! Άσκηση

Σε ένα σύστημα UNIX, πόσες αναγνώσεις από το δίσκο πρέπει να γίνουν για να διαβαστεί ο κόμβος-i για το αρχείο @@/usr/ast/courses/os/handout.t@@;. Υποθέστε ότι ο κόμβος-i για τον κατάλογο της ρίζας βρίσκεται στη μνήμη. Κανένας από τους άλλους κόμβους-i καταλόγων της διαδρομής δεν βρίσκεται στην μνήμη.

>>answer<<

!!! Απάντηση

Έχουμε τις παρακάτω αναγνώσεις:
# κατάλογος για @@/@@ (ο κόμβος-i δεν χρειάζεται να διαβαστεί για τη ρίζα, αφού σύμφωνα με την εκφώνηση είναι στη μνήμη ήδη).
# κόμβος-i για @@/usr@@
# κατάλογος για @@/usr@@
# κόμβος-i για @@/usr/ast@@
# κατάλογος για @@/usr/ast@@
# κόμβος-i για @@/usr/ast/courses@@
# κατάλογος για @@/usr/ast/courses@@
# κόμβος-i για @@/usr/ast/courses/os@@
# κατάλογος για @@/usr/ast/courses/os@@
# κόμβος-i για @@/usr/ast/courses/os/handout.t@@

Συνολικά χρειάζονται 10 αναγνώσεις από το δίσκο.
>><<
17-08-2008 (18:31) από Άρης -
Αλλαγή σειρών 32-33 από:
---
σε:
----
17-08-2008 (18:14) από Άρης -
Πρόσθεση σειρών 22-45:
!!! Άσκηση

Ένας σκληρός δίσκος έχει 64 κεφαλές, 621 κυλίνδρους και 63 τομείς ανά κύλινδρο, ενώ το μέγεθος κάθε τομέα είναι 512 bytes. Ποια η συνολική χωρητικότητά του;

----

!!! Άσκηση

Ένας σκληρός δίσκος Α έχει 128 κεφαλές, 621 κυλίνδρους και 63 τομείς ανά κύλινδρο, ενώ το μέγεθος κάθε τομέα είναι 512bytes. Ένας δεύτερος σκληρός δίσκος Β έχει 32 κεφαλές, 1242 κυλίνδρους και 63 τομείς ανά κύλινδρο. Το μέγεθος κάθε τομέα είναι 512bytes και στις δύο περιπτώσεις. Τι σχέση έχουν ως προς τη χωρητικότητά τους;

---

!!! Άσκηση

Έστω ένας σκληρός δίσκος με 32 κεφαλές, 1242 κυλίνδρους και 252 τομείς ανά κύλινδρο. Ο δίσκος έχει χωρητικότητα 5GB περίπου. Ποιο είναι το μέγεθος κάθε τομέα;

----

!!! Άσκηση

Έστω σκληρός δίσκος με 32 κεφαλές, 310 κυλίνδρους και 63 τομείς ανά κύλινδρο. Το μέγεθος κάθε τομέα είναι 1ΚΒ. Ο δίσκος, διαμορφώνεται από το λειτουργικό σύστημα, ώστε να έχει συνολικά 156.240 συστοιχίες. Πόσοι τομείς ανήκουν σε κάθε συστοιχία;

----
17-08-2008 (17:30) από Άρης -
Πρόσθεση σειρών 147-150:
Υπάρχουν λάθη στα μπλοκ 1, 5 και 6. Τα μπλοκ 1 και 6 δεν εμφανίζονται ούτε στη λίστα των μπλοκ σε χρήση ούτε στη λίστα των ελεύθερων. Αυτό το πρόβλημα δεν είναι σοβαρό, διότι μπορεί απλά να λυθεί τοποθετώντας τα μπλοκ στη λίστα των ελεύθερων, δηλαδή, κάνοντας τα αντίστοιχα bit 1.

Το πρόβλημα με το μπλοκ 5 είναι πιο σοβαρό διότι το μπλοκ εμφανίζεται και στις δύο λίστες.
Διαγραφή σειρών 151-152:

17-08-2008 (13:33) από 194.63.237.22 -
Αλλαγή σειρών 135-138 από:
@@ Αριθμός Μπλοκ: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14@@
@@ Σε Χρήση: 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0@@
@@ Ελεύθεροι: 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1@@
σε:
[@
Αριθμός Μπλοκ: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Σε Χρήση: 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0
Ελεύθεροι: 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1
@]
17-08-2008 (13:16) από 194.63.237.23 -
Διαγραφή σειρών 47-48:
----
Αλλαγή σειρών 129-131 από:
----

σε:
! Αξιοπιστία των Συστημάτων Αρχείων

!!! Άσκηση

Ένας ελεγκτής του συστήματος αρχείων έχει δημιουργήσει τους μετρητές του όπως φαίνονται παρακάτω.

@@ Αριθμός Μπλοκ: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14@@
@@ Σε Χρήση: 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0@@
@@ Ελεύθεροι: 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1@@

Υπάρχουν λάθη; Αν ναι, είναι σοβαρά; Γιατί;

>>answer<<

!!! Απάντηση

>><<

17-08-2008 (13:00) από Άρης -
17-08-2008 (13:00) από Άρης -
Αλλαγή σειρών 4-7 από:
! Διαχείριση του Χώρου του Δίσκου

!! Άσκηση
σε:
! Μέγεθος του Δίσκου

!!! Άσκηση
Αλλαγή σειρών 12-13 από:
!! Απάντηση
σε:
!!! Απάντηση
Αλλαγή σειρών 22-25 από:
!! Exercise

Consider a disk with 131,072 bytes per track, a rotation time of 8.33 msec, and an average seek time of 10 msec. Which is the time in milliseconds to read a block of 2K bytes?
σε:
!!! Exercise

A floppy disk has 40 cylinders. A seek takes 6 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e., follow one another in the file) will be about 13 cylinders apart, on the average. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders (for example). How long does it take to read a 100-block file in both cases, if the rotational latency is 100 msec and the transfer time is 25 msec per block?
Αλλαγή σειρών 28-33 από:
!! Answer

The time is the sum of the seek, rotational delay, and transfer times: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay@@

So, we have: @@10 + 8.33/2 + (2*1024/131072) x 8.33 = 10 + 4.165 + 0,13015625 = 0,13015625 msec@@
σε:
!!! Answer

The time per block is built up of three components: seek time, rotational latency, and transfer time. In all cases the rotational latency plus transfer time is the same, 125 msec. Only the seek time differs. For 13 cylinders it is 78 msec; for 2 cylinders it is 12 msec. Thus for randomly placed files the total is 203 msec, and for clustered files it is 137 msec.
Αλλαγή σειρών 34-39 από:
----

!! Exercise

Consider a disk with a mean seek time of 8 msec, a rotational rate of 15,000 rpm, and 262,144 bytes per track. What are the data rates for block sizes of 1KB, 2KB, and 4KB, respectively?
σε:
! Κατανομή Αρχείων

!!! Exercise

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. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it hack to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?
Αλλαγή σειρών 42-57 από:
!! Answer

A rotatinal rate of 15,000rpm gives 60sec/150000rmp = 4msec to go around once. The average access time (in msec) to read k bytes is then: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay = 8 + 2 + (k / 262144) × 4@@.

* Block size 1KB
** Read time: @@8 + 2 + (1024 / 262144) × 4 = 10,015625 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 1 / 10,015625x10'^-3^' = 99.84KB/sec@@

* Block size 2KB
** Read time: @@8 + 2 + (2048 / 262144) × 4 = 10,03125 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 2 / 10,03125x10'^-3^' = 199.38KB/sec@@

* Block size 4KB
** Read time: @@8 + 2 + (4096 / 262144) × 4 = 10,062088013 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 4 / 10,062088013x10'^-3^' = 397.53KB/sec@@
σε:
!!! Answer

It takes 9 msec to start the transfer. To read 2'^13^' bytes at a transfer rate of 2'^23^' bytes/sec requires 2'^−10^' sec (977 msec), for a total of 9.977 msec. Writing it back takes another 9.977 msec. Thus copying a file takes 19.954 msec. To compact half of a 16-GB disk would involve copying 8 GB of storage, which is 2'^20^' files. At 19.954 msec per file, this takes 20,923 sec, which is 5.8 hours. Clearly, compacting the disk after every file removal is not a great idea.
Αλλαγή σειρών 50-53 από:
!! Exercise

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. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it hack to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?
σε:
! Διαχείριση του Χώρου του Δίσκου

!! Μέγεθος του Μπλόκ

!!! Exercise

Consider a disk with 131,072 bytes per track, a rotation time of 8.33 msec, and an average seek time of 10 msec. Which is the time in milliseconds to read a block of 2K bytes?
Αλλαγή σειρών 60-63 από:
!! Answer

It takes 9 msec to start the transfer. To read 2'^13^' bytes at a transfer rate of 2'^23^' bytes/sec requires 2'^−10^' sec (977 msec), for a total of 9.977 msec. Writing it back takes another 9.977 msec. Thus copying a file takes 19.954 msec. To compact half of a 16-GB disk would involve copying 8 GB of storage, which is 2'^20^' files. At 19.954 msec per file, this takes 20,923 sec, which is 5.8 hours. Clearly, compacting the disk after every file removal is not a great idea.
σε:
!!! Answer

The time is the sum of the seek, rotational delay, and transfer times: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay@@

So, we have: @@10 + 8.33/2 + (2*1024/131072) x 8.33 = 10 + 4.165 + 0,13015625 = 0,13015625 msec@@
Αλλαγή σειρών 70-73 από:
!! Exercise

Free disk space can be kept track of using a free list or a bitmap. 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.
σε:
!!! Exercise

Consider a disk with a mean seek time of 8 msec, a rotational rate of 15,000 rpm, and 262,144 bytes per track. What are the data rates for block sizes of 1KB, 2KB, and 4KB, respectively?
Αλλαγή σειρών 76-79 από:
!! Answer

The bitmap requires B bits. The free list requires DF bits. The free list requires fewer bits if DF < B. Alternatively, the free list is shorter if F/B < 1/D, where F/B is the fraction of blocks free. For 16-bit disk addresses, the free list is shorter if 6 percent or less of the disk is free.
σε:
!!! Answer

A rotational rate of 15,000rpm gives 60sec/150000rmp = 4msec to go around once. The average access time (in msec) to read k bytes is then: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay = 8 + 2 + (k / 262144) × 4@@.

* Block size 1KB
** Read time: @@8 + 2 + (1024 / 262144) × 4 = 10,015625 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 1 / 10,015625x10'^-3^' = 99.84KB/sec@@

* Block size 2KB
** Read time: @@8 + 2 + (2048 / 262144) × 4 = 10,03125 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 2 / 10,03125x10'^-3^' = 199.38KB/sec@@

* Block size 4KB
** Read time: @@8 + 2 + (4096 / 262144) × 4 = 10,062088013 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 4 / 10,062088013x10'^-3^' = 397.53KB/sec@@
Αλλαγή σειρών 94-99 από:
----

!! Exercise

The beginning of a free space bitmap looks like this alter the disk partition is first formatted: @@1000 0000 0000 0000@@ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses 6 blocks, the bitmap looks like this: @@1111 1110 0000 0000@@. Show the bitmap after each of the following additional actions:
σε:
!! Διαχείριση των Ελεύθερων Μπλοκ

!!! Exercise

The beginning of a free space bitmap looks like this after the disk partition is first formatted: @@1000 0000 0000 0000@@ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses 6 blocks, the bitmap looks like this: @@1111 1110 0000 0000@@. Show the bitmap after each of the following additional actions:
Αλλαγή σειρών 107-108 από:
!! Answer
σε:
!!! Answer
Πρόσθεση σειράς 118:
Αλλαγή σειρών 121-122 από:
A floppy disk has 40 cylinders. A seek takes 6 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e., follow one another in the file) will be about 13 cylinders apart, on the average. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders (for example). How long does it take to read a 100-block file in both cases, if the rotational latency is 100 msec and the transfer time is 25 msec per block?
σε:
Free disk space can be kept track of using a free list or a bitmap. 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.
Αλλαγή σειρών 127-128 από:
The time per block is built up of three components: seek time, rotational latency, and transfer time. In all cases the rotational latency plus transfer time is the same, 125 msec. Only the seek time differs. For 13 cylinders it is 78 msec; for 2 cylinders it is 12 msec. Thus for randomly placed files the total is 203 msec, and for clustered files it is 137 msec.
σε:
The bitmap requires B bits. The free list requires DF bits. The free list requires fewer bits if DF < B. Alternatively, the free list is shorter if F/B < 1/D, where F/B is the fraction of blocks free. For 16-bit disk addresses, the free list is shorter if 6 percent or less of the disk is free.
Πρόσθεση σειρών 132-133:

17-08-2008 (12:46) από Άρης -
Αλλαγή σειρών 2-5 από:
σε:
! Υλοποίηση Συστήματος Αρχείων

! Διαχείριση του Χώρου του Δίσκου
Αλλαγή σειρών 24-25 από:
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. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it hack to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?
σε:
Consider a disk with 131,072 bytes per track, a rotation time of 8.33 msec, and an average seek time of 10 msec. Which is the time in milliseconds to read a block of 2K bytes?
Αλλαγή σειρών 30-31 από:
It takes 9 msec to start the transfer. To read 2'^13^' bytes at a transfer rate of 2'^23^' bytes/sec requires 2'^−10^' sec (977 msec), for a total of 9.977 msec. Writing it back takes another 9.977 msec. Thus copying a file takes 19.954 msec. To compact half of a 16-GB disk would involve copying 8 GB of storage, which is 2'^20^' files. At 19.954 msec per file, this takes 20,923 sec, which is 5.8 hours. Clearly, compacting the disk after every file removal is not a great idea.
σε:
The time is the sum of the seek, rotational delay, and transfer times: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay@@

So, we have: @@10 + 8.33/2 + (2*1024/131072) x 8.33 = 10 + 4.165 + 0,13015625 = 0,13015625 msec@@
Αλλαγή σειρών 40-41 από:
Free disk space can be kept track of using a free list or a bitmap. 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.
σε:
Consider a disk with a mean seek time of 8 msec, a rotational rate of 15,000 rpm, and 262,144 bytes per track. What are the data rates for block sizes of 1KB, 2KB, and 4KB, respectively?
Αλλαγή σειρών 46-47 από:
The bitmap requires B bits. The free list requires DF bits. The free list requires fewer bits if DF < B. Alternatively, the free list is shorter if F/B < 1/D, where F/B is the fraction of blocks free. For 16-bit disk addresses, the free list is shorter if 6 percent or less of the disk is free.
σε:
A rotatinal rate of 15,000rpm gives 60sec/150000rmp = 4msec to go around once. The average access time (in msec) to read k bytes is then: @@seek time + rotation delay/2 + (block size in bytes/bytes per track) x rotation delay = 8 + 2 + (k / 262144) × 4@@.

* Block size 1KB
** Read time: @@8 + 2 + (1024 / 262144) × 4 = 10,015625 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 1 / 10,015625x10'^-3^' = 99.84KB/sec@@

* Block size 2KB
** Read time: @@8 + 2 + (2048 / 262144) × 4 = 10,03125 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 2 / 10,03125x10'^-3^' = 199.38KB/sec@@

* Block size 4KB
** Read time: @@8 + 2 + (4096 / 262144) × 4 = 10,062088013 msec@@
** Data rate: @@k (in KB) / read time (in seconds) = 4 / 10,062088013x10'^-3^' = 397.53KB/sec@@
Αλλαγή σειρών 66-72 από:
The beginning of a free space bitmap looks like this alter the disk partition is first formatted: @@1000 0000 0000 0000@@ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses 6 blocks, the bitmap looks like this: @@1111 1110 0000 0000@@. Show the bitmap after each of the following additional actions:

#%alpha% File B is written, using 5 blocks
# File A is deleted
# File C is written, using 8 blocks
# File B is deleted
σε:
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. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it hack to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?
Αλλαγή σειρών 72-76 από:
#%alpha% After writing file B: @@1111 1111 1111 0000@@
# After deleting file A: @@1000 0001 1111 0000@@
# After writing file C: @@1111 1111 1111 1100@@
# After deleting file B: @@1111 1110 0000 1100@@
σε:
It takes 9 msec to start the transfer. To read 2'^13^' bytes at a transfer rate of 2'^23^' bytes/sec requires 2'^−10^' sec (977 msec), for a total of 9.977 msec. Writing it back takes another 9.977 msec. Thus copying a file takes 19.954 msec. To compact half of a 16-GB disk would involve copying 8 GB of storage, which is 2'^20^' files. At 19.954 msec per file, this takes 20,923 sec, which is 5.8 hours. Clearly, compacting the disk after every file removal is not a great idea.
Αλλαγή σειρών 80-81 από:
A floppy disk has 40 cylinders. A seek takes 6 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e., follow one another in the file) will be about 13 cylinders apart, on the average. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders (for example). How long does it take to read a 100-block file in both cases, if the rotational latency is 100 msec and the transfer time is 25 msec per block?
σε:
Free disk space can be kept track of using a free list or a bitmap. 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.
Αλλαγή σειρών 86-87 από:
The time per block is built up of three components: seek time, rotational latency, and transfer time. In all cases the rotational latency plus transfer time is the same, 125 msec. Only the seek time differs. For 13 cylinders it is 78 msec; for 2 cylinders it is 12 msec. Thus for randomly placed files the total is 203 msec, and for clustered files it is 137 msec.
σε:
The bitmap requires B bits. The free list requires DF bits. The free list requires fewer bits if DF < B. Alternatively, the free list is shorter if F/B < 1/D, where F/B is the fraction of blocks free. For 16-bit disk addresses, the free list is shorter if 6 percent or less of the disk is free.
Πρόσθεση σειρών 91-126:

!! Exercise

The beginning of a free space bitmap looks like this alter the disk partition is first formatted: @@1000 0000 0000 0000@@ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses 6 blocks, the bitmap looks like this: @@1111 1110 0000 0000@@. Show the bitmap after each of the following additional actions:

#%alpha% File B is written, using 5 blocks
# File A is deleted
# File C is written, using 8 blocks
# File B is deleted

>>answer<<

!! Answer

#%alpha% After writing file B: @@1111 1111 1111 0000@@
# After deleting file A: @@1000 0001 1111 0000@@
# After writing file C: @@1111 1111 1111 1100@@
# After deleting file B: @@1111 1110 0000 1100@@

>><<

----

!! Exercise

A floppy disk has 40 cylinders. A seek takes 6 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e., follow one another in the file) will be about 13 cylinders apart, on the average. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders (for example). How long does it take to read a 100-block file in both cases, if the rotational latency is 100 msec and the transfer time is 25 msec per block?

>>answer<<

!! Answer

The time per block is built up of three components: seek time, rotational latency, and transfer time. In all cases the rotational latency plus transfer time is the same, 125 msec. Only the seek time differs. For 13 cylinders it is 78 msec; for 2 cylinders it is 12 msec. Thus for randomly placed files the total is 203 msec, and for clustered files it is 137 msec.

>><<

----
16-08-2008 (18:54) από Άρης -
Αλλαγή σειρών 67-81 από:
----
σε:
----

!! Exercise

A floppy disk has 40 cylinders. A seek takes 6 msec per cylinder moved. If no attempt is made to put the blocks of a file close to each other, two blocks that are logically consecutive (i.e., follow one another in the file) will be about 13 cylinders apart, on the average. If, however, the operating system makes an attempt to cluster related blocks, the mean interblock distance can be reduced to 2 cylinders (for example). How long does it take to read a 100-block file in both cases, if the rotational latency is 100 msec and the transfer time is 25 msec per block?

>>answer<<

!! Answer

The time per block is built up of three components: seek time, rotational latency, and transfer time. In all cases the rotational latency plus transfer time is the same, 125 msec. Only the seek time differs. For 13 cylinders it is 78 msec; for 2 cylinders it is 12 msec. Thus for randomly placed files the total is 203 msec, and for clustered files it is 137 msec.

>><<

----
16-08-2008 (18:46) από Άρης -
Πρόσθεση σειρών 1-67:
%define=answer block bgcolor=#c4d4e7 border='1px dashed #31659c' padding-left='10px' padding-right='10px'%

!! Άσκηση

Ένας δίσκος έχει 8 κεφαλές, 256 κυλίνδρους και 128 τομείς ανά κύλινδρο. Αν κάθε τομές έχει 512 bytes, ποια είναι η χωρητικότητα του δίσκου;

>>answer<<

!! Απάντηση

Κάνουμε αντικατάσταση στον τύπο: @@σύνολο κεφαλών × αριθμός κυλίνδρων × αριθμός τομέων/κύλινδρο × ΚB/τομέα@@

Έχουμε: @@8 x 256 x 128 x 512 = 134217728 bytes ή 128MB@@

>><<

----

!! Exercise

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. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it hack to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?

>>answer<<

!! Answer

It takes 9 msec to start the transfer. To read 2'^13^' bytes at a transfer rate of 2'^23^' bytes/sec requires 2'^−10^' sec (977 msec), for a total of 9.977 msec. Writing it back takes another 9.977 msec. Thus copying a file takes 19.954 msec. To compact half of a 16-GB disk would involve copying 8 GB of storage, which is 2'^20^' files. At 19.954 msec per file, this takes 20,923 sec, which is 5.8 hours. Clearly, compacting the disk after every file removal is not a great idea.

>><<

----

!! Exercise

Free disk space can be kept track of using a free list or a bitmap. 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.

>>answer<<

!! Answer

The bitmap requires B bits. The free list requires DF bits. The free list requires fewer bits if DF < B. Alternatively, the free list is shorter if F/B < 1/D, where F/B is the fraction of blocks free. For 16-bit disk addresses, the free list is shorter if 6 percent or less of the disk is free.

>><<

----

!! Exercise

The beginning of a free space bitmap looks like this alter the disk partition is first formatted: @@1000 0000 0000 0000@@ (the first block is used by the root directory). The system always searches for free blocks starting at the lowest numbered block, so after writing file A, which uses 6 blocks, the bitmap looks like this: @@1111 1110 0000 0000@@. Show the bitmap after each of the following additional actions:

#%alpha% File B is written, using 5 blocks
# File A is deleted
# File C is written, using 8 blocks
# File B is deleted

>>answer<<

!! Answer

#%alpha% After writing file B: @@1111 1111 1111 0000@@
# After deleting file A: @@1000 0001 1111 0000@@
# After writing file C: @@1111 1111 1111 1100@@
# After deleting file B: @@1111 1110 0000 1100@@

>><<

----

Τελευταία ενημέρωση: 19-08-2008 (12:56)

Copyright 2008 - Άρης Φεργάδης