# Recent questions and answers in Operating System

Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is . A file of size 42797 KB is ... is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?
Let s and t be two semaphores initialised to 1 and 0, respectively. Two threads T1 and T2 each execute the code shown below. 1: P(s) 2: V(s) 3: P(t) 4: V(t) (i) Does there exist an interleaving for which at least one of the ... Clearly justify your answer. (ii) What change(s) in the initial values assigned to the semaphores will guarantee that both threads will always progress to completion?
Logical add= segment no.+ Offset my question is offset calculation how does it
How do we categorize a scheduling algorithm as CPU bound or I/O bound?
I have been studying the virtual memory concept in Operating Systems. I understand that : Each process is given its own virtual address space - which might be very larger than the physical address space - to execute. If the processes cannot accommodate its pages in the main memory, we ... with each process is $2^{64}$), but obviously my secondary memory is not $2^{64}$ bytes. What am I missing?
Using a page size of 4 bytes and a physical memory of 32 bytes (8 pages)! we show how the user's view of memory can be mapped into physical memory. Logical address 0 is page O! offset O. Indexing into the page table! we find that page 0 is in frame 5. Thus! logical ... 1 is mapped to frame 6. Thus, logical address 4 maps to physical address 24 (= (6 x 4) + 0). This is from Galvin please xpln
Hi where to study “concurrency in os” from ? cause in galvin i cant find concurrency topic so what chapter concurrency have in galvin. thank you please reply fast as possible i ma stuck in between
WHY SELF Relocating program LESS EFFICIENT THAN RELOCATABLE PROGRAM?
hi this “recovery” topic in chapter 11 is necessary for os in gate or it is compulsory for doing for gate or can we skip this section. thank you
hi where to study I/O scheduling, I follow galvin so which chapter have I/O scheduling. or any other resource where i study I/O Scheduling thank you
what is difference between preemption and inturrupts on process state diagram
operating-system cpu-scheduling . someone please guide me how to approach this problem.
In state transition diagram of scheduling if there is transition from running to ready then it will be preemptive scheduling otherwise not?? My doubt is if process request for io then it will move to blocked state and after completion then it will be pushed to ready state and again can go to running the. It also should be preemptive scheduling na !! Plz clear this doubt.
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes: /* P1 */ while (true) { wants1 = true; while (wants2 == true); /* Critical Section */ wants1 = false; } /* ... IT IS WRITTEN PROGRESS IS THERE? In the case when both wants1 and wants2 are true it will indefinitely be postponed then why progress is there?
If one thread in program calls fork(), does the new process duplicate all threads or single thread
i have one doubt regarding virtual memory. where does virtual address space reside is it in ram or hdd? if it is in ram then how does mapping happen?
Using large file block size in a fixed block file system leads to better disk throughput but poor disk Space utilization. Is this statement true ?? What is the meaning of throughput here ??
When switching the CPU between two processes.. which of the following applies A. The PCB is both, saved and reloaded, only for the interrupted process that is existing the CPU B. The PCB is saved for the process that is scheduled for the CPU C. The PCB is reloaded for the process that is scheduled for the CPU D. No PCB is saved or reloaded E. None of the above
Is context switching time and dispatch latency same?
User level threads are transparent to the kernel. This statement true or false ? Os don't know about the user leval threads because it is treated as process then why this is true ?
1.In case of fixed partition/variable partition, suppose all holes(say 5 holes) are filled and one hole is of size 5kb and there we stored a 4kb process so here it will be of internal fragmentation of 1kb so can we also conclude here that ... fragmentation in memory then external fragmentation must be there but if there is external fragmentation in memory there need not be internal fragmentation??
Q. consider a system with 2k pages ,512 frames ,pa=22 bits. calculate the page table size in bytes?
source: https://www.cs.utexas.edu/~lorenzo/corsi/cs372/06F/hw/3sol.html The question : In a 32-bit machine we subdivide the virtual address into 4 segments as follows: 10-bit 8-bit 6-bit 8 bit We use a 3-level page table, such that the first 10-bit are for ... that using my approach above I should get an answer that is at least close to the given answer. However that is not the case. Please help.
The question : In a 32-bit machine we subdivide the virtual address into 4 segments as follows: 10-bit 8-bit 6-bit 8 bit We use a 3-level page table, such that the first 10-bit are for the first level and so on. What is the size of a page table ... 32. Which is way more than expected. Can someone please point out where I am making the mistake? Also can someone please clarify what does PTE hold?
What happen if page size and frame size are not equal? will it failed to map logical address to physical address.
If the time to failure of a machine component is exponentially distributed, the reliability of the same at Mean Time to Failure (MTTF) is ____
Here I solved this in this way .. Since the virtual address space is 32-bit long and the first 8 bit specifies the first-level index. Next is the Offset of the page which is 12 from the first line. Coincidently, 20 bit are still left here and it turns out ... thought this might be the answer. For reference, the answer to the solution is given . Thanks in advance. Is my approach wrong or correct?
1 vote
I am making a simulator for the test and set variable method of process synchronization, where the user enters the number of processes and their progression is shown. It works by making a thread for each process which progress simultaneously and pass through a critical ... not clear about that concept. I don't understand why it does not progress even though there is no other thread executing.
Does starvation mean that the thread has to keep waiting but it will eventually get executed, or does it mean that it will stop trying to execute after a certain point?
While paging, does frame size give -“d” (offset) or no. of frames give -“d” (offset) in Logical address generated by CPU, of format : p d and also is it applicable in concepts- multilevel paging, segmentation ?
1 vote
Which of the following statement(s) is/are correct in the context of $\text{CPU}$ scheduling? Turnaround time includes waiting time The goal is to only maximize $\text{CPU}$ utilization and minimize throughput Round-robin policy can be used even when the $\text{CPU}$ time required by each of the processes is not known apriori Implementing preemptive scheduling needs hardware support
A data file consisting of $1,50,000$ student-records is stored on a hard disk with block size of $4096$ bytes. The data file is sorted on the primary key $\textrm{RollNo}$. The size of a record pointer for this disk is $7$ bytes. Each student-record has ... disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is ________
1 vote
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes $P_1$ and $P_2$, and each of the processes spawns two threads $T_1$ and $T_2$: int x = 0; // global Lock L1; // global main () { create a thread to execute foo() ... will print the value of $y$ as $2.$ Both $T_1$ and $T_2$, in both the processes, will print the value of $y$ as $1.$
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock $(L)$. The following scheme ... deadlocks will not occur The scheme may lead to live-lock The scheme may lead to starvation The scheme violates the mutual exclusion property
Consider a three-level page table to translate a $39-$bit virtual address to a physical address as shown below: The page size is $\text{4 KB} \;(1\text{KB}=2^{10}$ bytes$)$ and page table entry size at every level is $8$ bytes. A process $P$ is currently ... $2\text{GB}$ of physical memory. The minimum amount of memory required for the page table of $P$ across all levels is _________ $\text{KB}$.
Which of the following standard $C$ library functions will always invoke a system call when executed from a single-threaded process in a $\text{UNIX/Linux}$ operating system? $\textsf{exit}$ $\textsf{malloc}$ $\textsf{sleep}$ $\textsf{strlen}$
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory $\textsf{foo}$. Which of ... file from $\textsf{foo}$ Renaming of an existing file in $\textsf{foo}$ Opening of an existing file in $\textsf{foo}$