Questions tagged [operating-systems]

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

Filter by
Sorted by
Tagged with
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 ...
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 ...
32
votes
7answers
7k views

Does an Operating System inject its own machine code when you open a program?

I'm studying CPU's and I know how it reads a program from the memory and execute its instructions. I also understand that an OS separates programs in processes, and then alternate between each one so ...
23
votes
1answer
3k views

Can an interrupt handler be preempted?

Can a running interrupt handler be pre-empted by another interrupt handler? If this is possible, in which scenarios is this safe, and in which scenarios is it not? If this is not possible, why?
20
votes
7answers
2k views

What are examples of inconsistency and incompleteness in Unix/C?

In Richard Gabriel's famous essay The Rise of Worse is Better, he contrasts caricatured versions of the MIT/Stanford (Lisp) and New Jersey (C/Unix) design philosophies along the axes of simplicity, ...
19
votes
2answers
5k views

How does an operating system create entropy for random seeds?

On Linux, the files /dev/random and /dev/urandom files are the blocking and non-blocking (respectively) sources of pseudo-random ...
19
votes
4answers
1k views

Does cooperative scheduling suspend processes when they perform an I/O operation?

Many operating systems references say that with cooperative (as opposed to preemptive) multitasking, a process keeps the CPU until it explicitly voluntarily suspends itself. If a running process ...
19
votes
4answers
40k views

What threads share in general?

Well this is general question. And if anyone want to make it implementation specific then I will prefer Unix related stuff. But first need to know following problems in generality: I read single ...
18
votes
3answers
1k views

Clever memory management with constant time operations?

Let's consider a memory segment (whose size can grow or shrink, like a file, when needed) on which you can perform two basic memory allocation operations involving fixed size blocks: allocation of ...
17
votes
4answers
1k views

How can the Operating System run on the same chip it is supposed to be managing?

From my readings about Operating Systems (reading the basic material on Wikipedia, tech sites, etc) I've learned that the Operating System is a program that allows programs and applications to ...
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 ...
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....
14
votes
2answers
123 views

What are potential pitfalls with having a minimal kernel that runs managed code?

Suppose I want to build an operating system based on a very small native lower kernel that acts as a managed code interpreter/runtime and a larger upper kernel compiled to a non-native machine ...
13
votes
3answers
1k views

How does the processor find kernel code after an interrupt?

When an interrupt occurs, the processor preempts the current process and calls kernel code to handle the interrupt. How does the processor know where to enter the kernel? I understand that there are ...
13
votes
1answer
3k views

Are all system calls blocking?

I was reading an article that describes the switch between user-space and kernel-space that happens upon a system call. The article says An application expects the completion of the system call ...
13
votes
1answer
515 views

Memory ballooning in the OS

Some hypervisors optimize memory usage using a method that is called ballooning (at least that's what KVM calls it), this method deduplicates memory between VMs and sets common pages to read-only with ...
12
votes
2answers
6k views

What is a GPU year?

I am reading papers in machine learning and they say things like, "This computation took $x$ number of GPU years". What is a GPU year? How long is that?
12
votes
1answer
3k views

What is the purpose of M:N (Hybrid) threading?

In other words, what advantages does Hybrid threading have over 1:1 (kernel only) and N:1 (user only) threading? This is a follow-up to What is the difference between user-level threads and kernel-...
11
votes
5answers
566 views

Why is the OS design able to reduce power consumption?

I have read that OSes like Android and iOS are somehow optimised to improve battery life. My understanding is that a CPU executes a certain number of operations in a certain time, so I would think ...
11
votes
1answer
5k views

Swap space management during pure demand paging

The following is a doubt that I came across while doing a OS home assignment - however, it seems more concept-based than a straightforward coding question, so IMHO I don't think the homework tag is ...
11
votes
4answers
213 views

Why store self and parent links (. and ..) in a directory entry?

Consider an filesystem targeted at some embedded devices that does little more than store files in a hierarchical directory structure. This filesystem lacks many of the operations you may be used to ...
10
votes
3answers
2k views

What does “map” mean?

I have encountered the term many times, in various CS education materials: L2 CS162 (UC Berkeley): Memory-mapped I/O L4 CS162 (UC Berkeley): Memory mapped files L24 CS61 (UC Berkeley): “...
10
votes
5answers
12k views

Why unsafe state not always cause deadlock?

I was reading Operating Systems by Galvin and came across the below line, Not all unsafe states are deadlock, however. An unsafe state may lead to deadlock Can someone please explain how ...
10
votes
2answers
8k views

Can someone explain this diagram about Slab Allocation?

I'm trying to understand how Slab Allocation works and why it is different or better than ordinary paging. I found this diagram which I believe would be helpful if it had more explanation. Some ...
10
votes
1answer
1k views

Are two-level schedulers only useful to manage swapping?

Two-level scheduling is useful when a system is running more processes than fit in RAM: a lower-level scheduler switches between resident processes, and a higher-level scheduler swaps groups of ...
10
votes
1answer
237 views

Can the end-to-end principle be formalized?

In the late 1990s, when I was in graduate school, the paper JH Saltzer; DP Reed; DD Clark: End-to-end arguments in system design. ACM Trans. Comput. Syst. 2(4):277-288, 1984. DOI=10.1145/357401....
9
votes
4answers
13k views

What is meant by interrupts in the context of operating systems?

I've decided to read Operating Systems Concepts by Silberschatz, Galvin Gagne (8th edition) over the summer. I've gotten to a topic that's confusing me - interrupts and their role as it relates to ...
9
votes
1answer
1k views

Writing a multitasking operating system for a processor without MMU

I've been thinking of writing a hobby operating system for some of the ARM processors. There are many popular single-board computers with ARM MPU, so I simply wanted to purchase one of those (choosing ...
9
votes
3answers
906 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. ...
9
votes
2answers
690 views

What is a file?

I'm looking for a formal definition of file that does not only include storage but also abstractions like procfs or /dev/null (or any fuse-based file) that do not relate to storage. So far I know ...
9
votes
2answers
1k views

Round-robin scheduling: allow listing a process multiple times?

In a round-robin scheduler, adding a process multiple times to the process list is a cheap way to give it higher priority. I wonder how practical an approach this might be. What benefit does it have ...
8
votes
2answers
17k 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 ...
7
votes
4answers
25k views

The convoy effect in process scheduling

As I understand the convoy effect, in the context of vehicular traffic in a road system. A slow moving group of vehicles passes through the system, slowing traffic even in areas which were not ...
7
votes
4answers
7k views

Is the 2nd parity bit in RAID 6 a simple calculation?

I'm trying to understand how the 2nd parity bit or byte is set in RAID 6. I'm reading a paper by H. Peter Anvin, and it goes into Galois field algebra, which is somewhat new to me. Anyway, a rep from ...
7
votes
2answers
3k views

Microsoft Singularity : why closed [closed]

I'm talking about this one research project: but MS closed it in 2008. I've read many articles about it, about high perfomance (30+% faster against tradinional monolithic kernels), much more secure ...
7
votes
1answer
2k views

Difference between hypervisor and exokernel

An hypervisor (1st type) is a software that creates and run virtual machines, managing guest's operative systems's requests to the hardware. An exokernel is an operative system kernel, that let's ...
7
votes
1answer
118 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 ...
7
votes
1answer
242 views

What techniques exist for energy-efficient computing and networking?

I am currently reviewing the potentials of cloud computing regarding energy efficiency and green IT. In connection with this review I am having a look on techniques for increasing energy-efficiency in ...
7
votes
1answer
2k views

How are threads implemented in different OSs?

I was reading Linux Kernel Development by Robert Love, where I came across this Linux takes an interesting approach to thread support: It does not differentiate between threads and normal ...
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 ...
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 ...
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,...
6
votes
3answers
3k views

Solutions to synchronization problem need to be executed in critical section

I was reading about synchronization problems for cooperating processes and i learned that only hardware solutions like test_and_wait() and ...
6
votes
4answers
92k views

What is the average turnaround time?

For the following jobs: The average wait time would be using a FCFS algorithm: (6-6)+(7-2)+(11-5)+(17-5)+(14-1) -> 0+5+6+10+13 -> 34/5 = 7 (6.8) What would the average turnaround time be?
6
votes
1answer
3k views

What is the real advantage of Google's new Fuchsia operating system kernel?

Google's new in-production OS which it desires to replace not only Android but many other devices utilizes a completely new kernel: The code differs from Android and Chrome OS due to its being ...
6
votes
1answer
2k views

How to interpret “Windows - Virtual Memory minimum too low” from a CS student point of view?

On my old 256MB RAM, pc I get this message. (I guess it is quite common) Windows - Virtual Memory minimum too low Your system is low on virtual memory. Windows is increasing the size of your ...
6
votes
1answer
183 views

Is there any mechanism where the kernel portion of an OS in memory may also be swapped?

I'm recently learning the part of I/O buffering of operating system and according to the book I use, When a user process issues an I/O request, the OS assigns a buffer in the system portion of ...
6
votes
1answer
578 views

Bounded waiting and starvation free in critical section problem

i have 4 question regarding relation between starvation and bounded waiting. 1.Does starvation-freedom imply deadlock-freedom? My Answer-: From here, definition of starvation free is Freedom ...
6
votes
1answer
623 views

Variation of the dining philosophers: is the standard solution still valid?

I have a problem that is almost equal to the standard one of the dining philosophers, but has a quirk: while a philosopher thinks, he still holds the fork on his left. If after the period of thinking ...
5
votes
4answers
4k views

How does an operating system implement the C library?

I have an idea of how a C program is turned into machine code by the compiler. I also know how the processor processes the instructions (https://www.youtube.com/watch?v=cNN_tTXABUA this video has a ...