Questions tagged [operating-systems]

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

Filter by
Sorted by
Tagged with
33
votes
2answers
44k 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 ...
50
votes
2answers
21k 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 ...
2
votes
3answers
63k 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 ...
3
votes
1answer
5k 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 ...
4
votes
6answers
3k 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 ...
2
votes
2answers
1k 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 ...
1
vote
2answers
4k 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 ...
4
votes
2answers
657 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
2answers
230 views

Characterize an OS as multiprogrammed OS

Which of the following features will characterize an OS as multiprogrammed OS? More than one program may be loaded into main memory at the same time. If a program waits for certain event another ...
1
vote
1answer
2k 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.
8
votes
2answers
18k 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
3answers
1k 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 ...
9
votes
3answers
912 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. ...
6
votes
3answers
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 ...
5
votes
2answers
4k 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 ...
3
votes
2answers
3k 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?
2
votes
1answer
9k 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?
0
votes
1answer
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
3answers
1k 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 ...
4
votes
1answer
7k 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? ...
3
votes
1answer
934 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
2answers
2k 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 ...
2
votes
3answers
1k 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, ...
1
vote
0answers
351 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 ...
1
vote
1answer
568 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
2answers
27k 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 ...
14
votes
2answers
8k 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....
7
votes
1answer
119 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
1answer
905 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
3answers
973 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 ...
3
votes
2answers
909 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
1answer
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 ...
3
votes
3answers
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 ...
2
votes
6answers
2k 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-...
2
votes
1answer
116 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
1answer
1k 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
1answer
57 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 ...
1
vote
1answer
138 views

Starvation is possible or not?

let S and Q to be initialized to 1 ...
0
votes
1answer
63 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 ...