Operating_System 2024_240304_003915
Operating_System 2024_240304_003915
in a system with four page frames assigned to a process, suppose that the page table in
the following table displays the last time a page was loaded in each page frame (from 0 process
start time to event, not the number of ticks since event), the last time each page was accessed,
the virtual page number of each page frame, and the reference (R) and modification (M) bits for
each page. Write which page frames are replaced for each of the following memory
management policies when a page fault occurs for virtual page 4. However, the numbers in the
PTE below are all decimal, and all numbers are numbered starting with 0, and the page
reference strings are 4, 0, 0, 0, 2, 4, 2, 1, 0, 3, and 2.
A1)
a. Optimal: 3
Pages 4,0,2 and 1 are referred before page 3, so the optimal choice is to put page 4 into the
frame of virtual page 3. (Note that it happens that page 3 is in frame 3, so the answer is three,
even though the question asks for the frame number.)
b. FIFO: 3
The first frame loaded was frame 3, loaded at time 20.
c. LRU: 2
The least recently referred frame is frame 0, referred at time 162. (Note that the question asked
for the page frame, not the virtual page number. For part (a), the page frame number and virtual
page number happened to be the same, but for this part, we have virtual page number 0 in page
frame 2.)
d. CLOCK: 2
The only frame with a zero Referenced bit is frame number 2. The algorithm would run through
frames 3, 0, and 1, setting their Referenced bits to zero, before detecting the zero-referenced bit
on frame 2.
Q.3. (1)Write how many reads are required each to find a block containing the 67,000th byte of
the file in the EXT2 file system, starting with the inode of the file and (2) the first FAT entry of the
file in the FAT16 file system. However, it is assumed that the block size (cluster, addressable
unit) of both file systems is 1,000 bytes.
Q.4. Unix file systems use several types of indirect blocks (eg, single indirect, double indirect,
etc.) to store metadata information for large files, access to large files requires access to several
additional indirect blocks. Therefore, Soongsil University's operating system lab developed
SSUFS, an Extent-based file system, to reduce metadata storage and access overhead. Extent
consists of a series of sequential sectors on disk, and the file system represents the i-node in
the following way.
extent_size is a 32-bit unsigned int indicating the size of each extent, expressed as the number
of consecutive 512-byte sectors. All extents in a file are the same size. The extents[] array holds
the starting disk sector number of each extent. The file is created with an initial extent_size of 1.
That is, each extent becomes a single 512-byte sector. Assuming that the extent size doubles
every time a file grows larger than the maximum file size currently supported by extent_size, (1)
what is the maximum file size supported by SSUFS? Write it in the form of 2^m. (2) Also, write
how many disk accesses are required to read the byte at offset 1,000,000 from the file if the
i-node is already in memory.
Q.5. In Unix-like file systems, if you maintain a unique index node for each file, and each index
node has six direct pointers, one single indirect pointer, and one double indirect pointer, the file
system block size is B bytes, and the block pointer is P bytes
(1) Write an expression as a function of B and P for the maximum file size that this index node
can support. (2) If the process reads data from the Nth block of a file, write the number of disk
operations required. However, suppose that a file is already open, the buffer cache is empty,
and each disk operation reads a block of files, the answer must be presented as a function of N,
B, and P, and the answer can contain several expressions corresponding to multiple values of
N.
Q.6. In a file system using index allocation in which a maximum of one index node (structure) is
allocated per file, the block size is 4096 Bytes. The pointer pointing to each data block is 4
Bytes, and the index node contains metadata containing all information related to the file. If the
size of the index node is 128 Bytes, it takes a block to completely access all files in a 1GB file
system. Write how big the lock should be (in bytes).
https://www.chegg.com/homework-help/questions-and-answers/file-system-using-index-allocatio
n-maximum-one-index-node-structure-allocated-per-file-siz-q118483754
Q.7. SSU2FS has an inode structure of 12 direct pointers, 1 single indirect pointer, 1 double
indirect pointer, and 1 triple indirect pointer.
, the access or modification times on the inode are not tracked by the file system, and the file
system does not perform any journaling;
each
The pointer is 32 bits and the file system block size is 4KB. SSU2FS has seek time = 4ms,
rotation latency = 4ms, block transfer time =
Assuming it is saved to disk in 0.1ms (Note: 1KB = 1024 bytes, 1MB = 1024KB, 1GB =
1024MB), a new file is created in the root directory of SSUFS.
Calculate how many blocks of each type shown below are created or updated when a new 4GB
file is created. However, the files are continuous on the disk.
Assume that it is stored permanently. You can answer in simple form or in a power of 2 formula.
Q.9. In a demand paging system, processes P1 and P2 each have logical memory addresses
from 0 to 99 and a page size of 5, as follows:
ruler. The hash table used in the data structure uses a hash function to simply obtain the index
by adding the process ID and logical page number.
all. (Not a good hash function). The hash table and reverse page table are as follows, and the
arrow in the hash table points to the chain when hashes collide.
It is said that each entry in the reverse page table points to an unallocated physical page frame.
Calculate the physical address of the following logical address where the number after the colon
is the logical address (not the logical page). The ID of the first page of the process is 0: P1:92.
P1:111; When, write the number of table lookups.
https://www.chegg.com/homework-help/questions-and-answers/request-paging-system-let-proc
esses-pl-p2-logical-memory-address-ranging-0-99-page-size-5--q55572879