We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [operating-systems]

Questions about the principles of software that interfaces between hardware and applications.

Filter by
Sorted by
Tagged with
0
votes
1answer
47 views

Cache and Main Memory

As we know that average access time is given by t=p*(tc)+(1-p)*(tc+tm) where t represent the average time, p is the hit ratio , tc is the time to access the data from the cache and tm is time to ...
2
votes
0answers
91 views

Deadlock vs “Progress” requirement of the solution to the critical section problem

I came across following problem: Consider following code: ...
1
vote
1answer
160 views

Mutual Exclusion by disabling interrupt

I am reading William Stallings operating system book which gives this pseudo-Code for disabling interrupt to achieve Mutual Exclusion ...
1
vote
0answers
50 views

How can I implement locking a range of values in a sorted sequence?

I am trying to write a general purpose locking algorithm which allows me to lock a range of contiguous values in a sorted array. To start with, these could be exclusive locks - so two concurrent locks ...
0
votes
0answers
19 views

Number of memory cycles stolen for transferring one word

The storage area of a disk has the innermost diameter of 10 cm and outermost diameter of 20 cm. The maximum storage density of the disk is 1400 bits/cm. The disk rotates at a speed of 4200 RPM. The ...
1
vote
1answer
113 views

In a kernel, what are “global constructors”?

I am a beginner developing kernels (though I have developed several Hello World programs in C and C++). I frequently see reference being made to global constructors (e.g., osdev https://wiki.osdev.org/...
0
votes
2answers
86 views

Why are threads called the unit of dispatch?

Threads called the "unit of dispatch" but what does that mean? I was looking over the web and two operating systems books but I can't find the answer. It seems that processes are defined by two ...
2
votes
1answer
369 views

How does hashed inverted page table work?

I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB ...
0
votes
0answers
27 views

Why is it difficult to differentiate between system and user CPU time?

In the book, Computer Organization and Design, Fifth Edition, by D. Paterson, it is stated that Differentiating between system and user CPU time is difficult to do accurately, because it is often ...
0
votes
0answers
15 views

If the number of pages exceeds the number of frames, how can the process finish using Virtual Memory?

Mapping is not for paging, is it? For instance if we have 12 pages and 8 frames. If 7 out of these 12 pages are loaded into the main memory, how can the process terminate?
0
votes
1answer
97 views

Page Replacement optimal verses MRU

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. ...
1
vote
0answers
51 views

How is switching among user-level threads realised in the user space?

This is with respect to user-level threads where the kernel only knows about the process as a whole, and threads are created and maintained in the user space. Each thread has its PC, registers, stack ...
1
vote
3answers
7k views

Deadlock and cycle in a resource allocation graph

Here is a resource allocation graph asked in my Operating Systems Theory midterm. The question is, "Is there a deadlock here? Explain your answer in detail" Ra and Rb are resource sets and every dot ...
1
vote
0answers
204 views

pool of free page frames OS

I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to ...
1
vote
1answer
28 views

How can we compute how many processes should be in memory at a time to make CPU utilization max?

From the given formula, we can compute the CPU utilization: CPU Utilization = 1 - P^n Where p is the probability of I/O and n is the total number of processes. E.g, If we were to find CPU ...
1
vote
1answer
45 views

Can a process run if there's not enough space for minimum pages?

I'm studying OS and I came up with this scenario where the OS works with a paging scheme and virtual memory, and a process wants to start running, but in memory, there's not enough space to allocate ...
6
votes
2answers
29k views

How does increasing the page size affect the number of page faults?

If we let the physical memory size remain constant, What effect does the size of the page have on the number of frames? What effect does the number of frames have on the number of page faults? Also,...
0
votes
1answer
198 views

Determining the linear address

So I am working on a question that requires me to find the linear address. Here's some information: Main memory size is 8GB, which translates to $2^{3} * 2^{30} = 2^{33}$. Block size is 16KB each, ...
-1
votes
1answer
4k views

Difference between system bus, address bus and data bus?

What is the difference between system bus, address bus and data bus? Are they different wires or they are using same wires but logically different?
1
vote
0answers
27 views

What's the official name of “New” page replacement algorithm?

I am studying some page replacement algorithms. I found an interesting algorithm called "New" algorithm. From page 17 of this slide (https://web.stanford.edu/class/cs346/2015/notes/Lecture_One.pdf) ...
0
votes
1answer
130 views

How can a user process even try to access a memory location its not allowed to when it doesn't have access to page table?

So is it even possible for a user process to even try to access a physical memory location that does not belong to it and therefore getting an error by operating system? because for example with a 32 ...
6
votes
2answers
11k views

Minimum number of processes for the deadlock?

A system has 6 identical resources and $N$ processes competing for them. Each process can request at most two requests. Which one of the following values of $N$ could lead to a deadlock? 1 ...
5
votes
1answer
6k views

Understanding N process Peterson's algorithm

The intuitive informal description of two process Peterson's algorithm for process 0 can be given as follows: ...
0
votes
1answer
804 views

Why can't OSes swap out processes that are waiting for I/O?

In the book, Operating System Concepts, 9th Edition, there is this paragraph that I don't quite wrap my head around. Swapping is constrained by other factors as well. If we want to swap a process,...
2
votes
2answers
56 views

Why does the operating system switch an active process to different cores?

When running a single-threaded application that is 'always busy', on a multi-core computer, modern operating systems will typically switch the process from one core to another from time to time. Even ...
1
vote
1answer
336 views

Which Peterson’s Solution is right?

I have seen two different Peterson’s Solution to mutual exclusion, one is from Modern Operating Systems: ...
1
vote
1answer
31 views

Are space allocated to C/C++ variables in secondary storage also in Compiled file?

Are data segments,heap,stack etc also present in secondary memory with compiled code then later mapped by OS to RAM when I open it?
2
votes
4answers
9k views

Calculation of effective average instruction execution time in a 2-level paging system

System has a two level paging scheme Average CPU time for a instruction = 100ns Average number of memory accesses per instruction = 2 Regular memory access = 150 ns Page fault service time = ...
1
vote
1answer
3k views

Bounded waiting and progress requirements of critical section problem solution based on exchange instruction

Atomic exchange instruction is given as follows: void exchange (int *a, int *b) { int temp; temp = *b; *b = *a; *a = temp; } Now consider the ...
1
vote
1answer
343 views

How pictures and videos are usually loaded in Memory? [closed]

Lets assume I'm talking about Jpeg and Mp4 and a general video player(not sure if different ones load it differently, if they do please tell) So do video players (process) usually load the entire ...
1
vote
1answer
363 views

Can a safe state in Banker's Algorithm cause deadlock eventually?

I know that unsafe state does not always mean deadlock. That is a situation that banker's algorithm does not detect deadlock accurately. I am just wondering if there is any example of a safe state ...
1
vote
1answer
39 views

Fork() execution and number of processes

If a process executes the following code fork(); fork(); fork(); The total number of child processes created is given as 7 by a text book. But how does that ...
0
votes
3answers
9k views

Exponential averaging for SJF CPU scheduling

Calculate the exponential averaging with $T_1 = 10$, $\alpha=0.5$ and the algorithm is SJF with previous runs as $8,7,4,16$. 9 8 7.5 None I am getting 4. None as the answer. But ...
5
votes
2answers
8k views

Which queue does the long-term scheduler maintain?

There are different queues of processes (in an operating system): Job Queue: Each new process goes into the job queue. Processes in the job queue reside on mass storage and await the allocation of ...
0
votes
1answer
564 views

Processor pipelining question: number of instructions per second

A question from the textbook Modern Operating Systems by A. S. Tanenbaum reads as follows: A computer has a pipeline with four stages. Each stage takes the same time to do its work, namely, 1 nsec. ...
5
votes
1answer
222 views

Are multiple interrupts generated when I hold down a key on my keyboard?

When I hold down a key on my keyboard, a continuous stream of characters is generated and is displayed on the text editor, Now since pressing a key is a hardware interrupt, so does holding down a key ...
1
vote
0answers
32 views

Software and hardware communications [closed]

When you install an OS on a piece of hardware such as a Macbook, what is happening logically? In other words, how does the software "talk" to the hardware? Is it the same logical process with every OS ...
1
vote
2answers
2k views

Algorithm for wait-for graph

During the process of deadlock detection, the wait-for graph can be obtained from the resource-allocation graph. To detect whether there is a deadlock using the wait-for graph, can topological sort be ...
1
vote
1answer
39 views

What is the mathematical principle of buddy algorithm?

The buddy algorithm is: The buddy for any block of size $2^k$ is another block of the same size, and with the same page frame number except that the kth bit is ...
3
votes
3answers
3k views

Virtual Address and Physical Address Space

A machine has 48-bit virtual addresses and 32-bit physical addresses. Pages are 8K. How many entries are needed for a conventional page table ? The answer is 2^35 entries Why not (2^32) / (2^13) = ...
5
votes
1answer
784 views

What's the difference between user registers and kernel registers?

I am reading Operating Systems: Three Easy Pieces, but I can't fully understand the following paragraph. It's from the 6th chapter of the book. I think it's self-contained, so I quote here. Note ...
1
vote
0answers
151 views

How is context switching disabled in a process?

By what provision is context switching disabled in a process ? Or is it the case that if a process is in in kernel mode , context switching is disabled by default ?
-2
votes
1answer
41 views

OS process management

Assume a process execution interrupted at the middle and CPU started executing a different process.How does the OS handle this situation?
2
votes
1answer
88 views

What are the recents topics of research that combine both systems research and theoretical computer science?

I am an undergraduate majoring in Computer Science and Mathematics. For my undergraduate research, I would like to work on something that lies in the overlap between systems research and theoretical ...
-1
votes
1answer
72 views

why do we run out of heap space even if we have virtual memory?

Whenever we try to get space in heap(using malloc or new) we can get out of heap space error if it exceeds the limit. But, we have virtual memory so why can't OS allocate that much space and then do ...
1
vote
1answer
783 views

Peterson Algorithm for process synchronisation

Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below. repeat ...
0
votes
1answer
676 views

What is hardware trap?

Since it's called a trap I consider it caused by software, so why it's called a hardware trap? And how does it work?
1
vote
0answers
20 views

Operating System: Redundancy of implement a monitor using semaphores in my textbook?

Why the part highlighted the following picture is need? I've been trying to follow to logic flow of it as follow: Imaging a Situation: Two processes enter/call F, first A, second B: Process A: <...
2
votes
0answers
217 views

Operating System: Busy waiting is not eliminated with semaphore?

Why the busy waiting is not eliminated even after we put the current process into the process list and "block()"ed it? So even if the process is in waiting state we still call it "busy waiting"? I'm ...
3
votes
1answer
184 views

Operating System: About user thread and kernel thread?

Is that a "thread" consists of both "user thread" and "kernel thread" as two parts? And when I create a "thread", is that I create a "user thread" and another "kernel thread" is created "in the ...