Questions tagged [operating-systems]
Questions about the principles of software that interfaces between hardware and applications.
46
questions
34
votes
2
answers
45k
views
What is the difference between user-level threads and kernel-level threads?
After reading several sources I'm still confused about user- and kernel-level threads.
In particular:
Threads can exist at both the user level and the kernel level
What is the difference between ...
7
votes
2
answers
1k
views
Why is word-addressable the exception, not the rule?
As stated on Wikipedia:
Most modern computers are byte-addressable
instead of word-addressable. Why is this case? Since the CPU processes words (of predominantly 64 bits or 8 bytes) now, wouldn't ...
2
votes
1
answer
3k
views
what is the need for valid/invalid bit in paged memory technique?
How is the valid/invalid bit in paged memory useful?
I am not able to understand the significance.
Is it also somehow used to share the processes among different users.
0
votes
2
answers
161
views
When are a controller's registers loaded and ready to inform an I/O Operation?
Below, I appended a fragmented paragraph from Operating Systems Concepts on interrupts.
To start an I/O operation, the device driver loads the appropriate registers in the device controller.
The ...
63
votes
2
answers
28k
views
What happens to the cache contents on a context switch?
In a multicore processor, what happens to the contents of a core's cache (say L1) when a context switch occurs on that cache?
Is the behaviour dependent on the architecture or is it a general ...
3
votes
3
answers
96k
views
How to work out physical address corresponding to logical address?
I am looking to calculate the physical address corresponding to a logical address in a paging memory management scheme. I just want to make sure I am getting the calculation right, as I fear I could ...
6
votes
6
answers
6k
views
Does Deadlock imply Starvation
If there is a deadlock between the processes does that mean that there is starvation also?
My Thinking:
deadlock is no process using that resources , but starvation is like not giving chance to only ...
3
votes
1
answer
6k
views
Valid-invalid bit in a process page table
Valid-invalid bit is used to indicate whether a page in a process’s page table is valid or not. Why is it needed?
Does that mean that each page table has a certain minimum size, i.e. it can ...
15
votes
2
answers
12k
views
Performance of microkernel vs monolithic kernel
A microkernel implements all drivers as user-space programs, and implements core features like IPC in the kernel itself. A monolithic kernel, however, implements the drivers as a part of the kernel (e....
1
vote
2
answers
2k
views
Must a deadlock necessarily occur if the four conditions exist?
I understand the four necessary conditions, mutual exclusion, hold and wait, no preemption, and circular wait, for deadlock to occur. However, does there exist a situation where the four conditions ...
13
votes
2
answers
9k
views
Do system calls always means a context switch?
When a system call takes place some kernel code must be executed. If some kernel code is being executed it means it can alter register values. So before this code gets executed the old process state ...
8
votes
2
answers
21k
views
Changing from Kernel mode to User mode (and vice versa)
I am reading Operating Systems book by Galvin. Galvin explains, what are kernel & user modes, instruction privileges given for both modes & also about mode-bit. But I am interested to know how ...
5
votes
3
answers
2k
views
When do deadlocks occur?
I was reading about deadlocks in Operating Systems. Where I came across two examples below.
Circles with label $P_x$ are processes. Squares with label $R_x$ are resources. Each dot in the square ...
7
votes
1
answer
13k
views
Difference between page table and inverted page table
I do not understand the difference between page table and inverted page table.
I know that both are used to translate the logical addresses into physical addresses produced by the processes necessary ...
6
votes
2
answers
4k
views
What mechanisms prevent a process from taking over the processor forever?
Suppose a process keeps running code (e.g. an infinite loop). How can other programs take over? What prevents the process from remaining active forever?
3
votes
1
answer
12k
views
What's the difference between Clock and Second Chance Page-Replacement Algorithm?
I know that they both have reference bit, but I only understand the Second Chance but not the Clock Page-Replacement algorithm.
could anyone help me understand?
9
votes
3
answers
1k
views
Why is the CPU Involved During Keyboard Echo?
I'm currently studying for a computer science exam, and I've come across a concept that has me somewhat stumped.
When one types a key on the keyboard, an ASCII character is transmitted to the CPU. ...
7
votes
2
answers
10k
views
How does the OS determine the CPU burst time of a process?
This question is related to OS. After having solved many problems in CPU scheduling I was wondering how does the CPU know the burst time of all the processes in the main memory before executing them?
...
6
votes
3
answers
5k
views
What is Simultaneous Multithreading
I come from an electronics background. I know that there are three types of implementations of multithreading (see Computer Architecture: A Quantitative Approach, 5th Edition):
Fine-grain ...
4
votes
2
answers
4k
views
Why there must be a relationship between user threads and kernel threads?
The following is an excerpt from OS concepts by galvin.Here is the book.
Multithreading Models
Our discussion so far has treated threads in a generic sense. However,
support for threads may be ...
2
votes
1
answer
839
views
Is bounded waiting satisfied in the 2 Process Solution?
Suppose, There are $2$ processes $P1$ and $P2$.
It is given that Mutual Exclusion and Progress are satisfied by these $2$ processes.
Suppose, Programming protocol is designed such that CPU only ...
1
vote
3
answers
1k
views
How is a program stored before compiling?
When we write code, after compilation the code will be converted to machine language and then stored in the hard disk. But before compiling the code, it is still in the high-level language. How and ...
0
votes
1
answer
1k
views
Segmentation and paging
I am given a system with a segmented paging architecture. Both physical and virtual address spaces contain $2^{16}$ bytes each. The virtual address space is divided in $8$ equal size segments. The ...
17
votes
3
answers
2k
views
What guarantees do "soft" real-time operating systems actually provide
I think I know what a "hard" real-time operating system is. It is an operating system with a scheduler that provides a contract with the application programmer. An application provides a deadline ...
3
votes
1
answer
2k
views
Why doesn't everyone use microkernel-based operating systems?
From what I have read on operating systems, the impression I have been receiving is that, for at least 30 years, "everybody has known" that microkernel-based operating systems are "better" than ...
3
votes
1
answer
2k
views
How does the CPU know to get data from or send data to a peripheral device?
We were talking today, in Intro to Programming, about machine language. I know it's a bunch of 0's and 1's. Let's say I compile the following C++ program on an x86 machine:
...
3
votes
3
answers
2k
views
Confusion about compiler and assembler
I have two questions.
After compilation of any C program result is assembly language code which should depend on processor. So my question is: how do different computers with different processor ...
2
votes
5
answers
3k
views
Operating System - CPU scheduling Decisions
I understand that CPU scheduling takes place on 4 circumstances listed below:
When the process changes state from Running to Ready
Changes state from Running to Waiting
Changes state from Waiting to ...
2
votes
5
answers
12k
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 ...
2
votes
2
answers
54k
views
Size of address spaces (logical and physical)
Suppose a system in which addresses (physical and logical) occupy 32 bits, page size is 1024 bytes
(210), and physical memory is of size 32MB. How many frames are in physical memory? Is the logical
...
2
votes
2
answers
108
views
Mathematical models of computation that capture more advanced OS and CPU design features
The universal Turing machine is the standard theoretical model of a stored-program computer. While in one sense as general as possible (Turing completeness), it doesn't explicitly contain many of the ...
2
votes
3
answers
2k
views
Round Robin Scheduling
I understand that a big advantage of round robin scheduling over non-preemptive schedulers is that it dramatically improves average response times. By limiting each task to a certain amount of time, ...
2
votes
3
answers
6k
views
Hardware protection needed for operating system kernel
I have a question related to the hardware protection needed to implement an operating system kernel:
Identify at least three hardware level mechanisms that are necessary to protect an operating ...
1
vote
0
answers
516
views
Do user level threads take advantage of multi processing?
I asked this question here on stackoverflow, but maybe because of off-topic over there, it didn't received proper response.
Does user level threads take advantage of multiprocessing ? I read one such ...
7
votes
1
answer
137
views
Page management in OS kernels
I looked at some old OS theory books of mine and noticed that one glaring omission in all of these OS books is how to actually keep track of physical pages that are free (i.e. algorithms for actually ...
5
votes
1
answer
1k
views
Mutex implementation on top of a minimalistic preemptive scheduler
In this question, I'm implementing some synchronization primitives in the standard library of an operating system. Specifically, I want to implement mutexes and condition variables. This is on top of ...
4
votes
1
answer
1k
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 ...
3
votes
6
answers
3k
views
How can a CPU access more memory locations than 2^wordsize?
I noticed that CPU's like the 8086 and especially the 8080 have the ability to access more memory than what one would normally assume. The 8080, for example, has an 8-bit word size but can use a 16-...
3
votes
2
answers
1k
views
Is bounded waiting ensured in given version of Dekker's solution for critical section problem?
William Stallings discuss various step by step process in developing Dekker's algorithm in his Operating Systems book. In process, he reaches to following version of algorithm (which is incomplete as ...
3
votes
3
answers
4k
views
How does worst-fit memory allocation react when encountering contiguous empty memory blocks?
So I have a problem understanding how the worst-fit protocol for memory allocation reacts to contiguous blocks of empty memory. None of the examples I have found address this possibility.
For ...
3
votes
1
answer
2k
views
Provide some help regarding the "Dining Philosophers Problem"?
I have an assignment based on operating systems and the question is divided into two sub-questions.
The first is: Prove any seating arrangement of lefties and righties, with at least one of each ...
2
votes
1
answer
518
views
hardware interrupts and context switch
I have recently studied about interrupts and context switch i have read that the hardware interrupts cause the interrupt service subroutine to execute for this i read mixed articles saying that there ...
1
vote
1
answer
2k
views
Confusion in the solution to first readers-writers synchronization
I am studying the solution to “First Readers-Writers Problem” from the book Operating System Concepts (9th edition) and it describes:
First readers–writers problem, requires that no reader be kept ...
1
vote
1
answer
182
views
Starvation is possible or not?
let S and Q to be initialized to 1
...
1
vote
1
answer
64
views
Are there any stochastic models of non determinism in the rate of program execution?
We know that typical operating systems and high level languages (especially those with garbage collection) cannot be used for real time operating systems. Java & jet engines don't mix, and ...
0
votes
1
answer
80
views
Can an operating system without api still work? [closed]
In theory operating system is a special program run by itself without help so that also mean normal program can still run by itself mean that the need for api is not must have so finally can we have ...