# Tag Info

### Why do we need full-fledged workstations running massive OSes with massive software?

You are conflating a number of issues here. Why does my software have all these features to begin with? Because other computers' software has those features, and network effects punish any software ...
• 3,413
Accepted

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

No. The operating system does not mess around with the program's code injecting new code into it. That would have a number of disadvantages. It would be time-consuming, as the OS would have to scan ...
• 80.3k
Accepted

### How does an operating system create entropy for random seeds?

The title and the body of your question ask two different questions: how the OS creates entropy (this should really be obtains entropy), and how it generates pseudo-randomness from this entropy. I'll ...
Accepted

### What is a GPU year?

That means, one year of computation time on a single GPU (or half a year on two GPUs, or a quarter of a year on four GPUs, etc.). If you are thinking of using this term in your own writing, I ...
• 141k
Accepted

### Can an interrupt handler be preempted?

This depends on both the processor architecture and the kernel architecture. Generally speaking, interrupt handlers start with interrupts disabled. This is necessary so that the interrupt handler has ...
Accepted

### What guarantees do "soft" real-time operating systems actually provide

You've got it right, and Wikipedia is as informative as can be — soft real-time is not a formal characterization, it's a value judgement. Another way to say “soft real-time” is “I wish it was real-...
Accepted

### Can someone explain this diagram about Slab Allocation?

I can see why you're confused. The diagram is a bit confusing, and may actually be incorrect. First off, let's think about why a kernel needs a memory allocator below the level of pages. This is ...
• 18.9k

### What threads share in general?

In general each thread has its own registers (including its own program counter), its own stack pointer, and its own stack. Everything else is shared between the threads sharing a process. In ...
• 17.3k
Accepted

### A multi-user, multi-processing operating system cannot be implemented on hardware that does not support

None of the above. As you noted, DMA and demand paging can be useful features but are not necessary to support multiple users and multiprocessing. Address translation is not necessary even for ...
• 2,938

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

In their most primitive form, operating systems rely on processes being well-behaved and handing control back to the operating system from time-to-time. If a process is not well-behaved, then indeed ...
Accepted

### Why unsafe state not always cause deadlock?

Deadlock means something specific: there are two (or more) processes that are currently blocked waiting for each other. In an unsafe state you can also be in a situation where there might be a ...
• 17.3k
Accepted

### Writing a multitasking operating system for a processor without MMU

It's actually not that hard to design an operating system that doesn't require an MMU. There are a few conveniences you'll have to do without, but nothing insurmountable. Since different tasks will ...
Accepted

### Why is the OS design able to reduce power consumption?

Common CPUs that go into smartphones, laptops and even desktop PCs have a variable clock rate. When the scheduler detects that it has idle time, it can reduce the clock rate, and increase it again if ...
Accepted

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

Modern CPUs are aware of the OS up to a certain degree. They provide some "power tools" for the first one who claims them. Usually this is the boot loader, which then hands over control to the OS. One ...

### Memory ballooning in the OS

Actually, what you've described confuses ballooning and 'same-page-merging'. I'll try to elaborate on the two to make the distinction apparent. Memory ballooning This is a trick to make sure that ...
• 410

### Do system calls always means a context switch?

A system call does not necessarily require a context switch in general, but rather a privilege switch. This is because the kernel memory is mapped in each process memory. The user process cannot ...
• 1,116
Accepted

### What does "map" mean?

So, there are two distinct uses of the word "map", that I'll unpack here. The first is very generic, where map means "to associate," particularly by way of a function. If we say "$f$ maps each $x$ to ...
• 29.1k

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

While David Richerby's answer is a good one, it does sort of glaze over how modern operating systems halt existing programs. My answer should be accurate for the x86 or x86_64 architecture, which is ...
• 231
Accepted

### How does the processor find kernel code after an interrupt?

On startup, the kernel will initialize an interrupt vector table (called an interrupt descriptor table or IDT on x86) that points to an interrupt handler for each line. Before the 80286, the IDT was ...
• 681

### How does the processor find kernel code after an interrupt?

Yes, there is a predefined place that contains the address of code to jump to: an interrupt vector. Depending on the processor, this can be a specific location in physical memory (8088), a specific ...

### Why do we need full-fledged workstations running massive OSes with massive software?

Since the other answers go pretty well into why companies just buy general purpose computers, I wanted to give an answer about security. In a lot of ways, it's easier to secure a system you know is ...
Accepted

### How are userland programs executed?

Obviously, with the various forms of operating systems out there, this process can vary (and in some cases, be completely different) but this outlines a general overview. Step 1: Load the program ...
• 681

### Since programs are swapped from backing store to main memory why don't they get lost when the computer is suddenly turned off?

Because it isn't moved: it's copied.
• 80.3k
Accepted

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

From what I understand you are asking what are the technical benefits of zircon over linux? First of all zircon is a micro kernel as opposed to the linux monolithic kernel. So lets look at some of ...
• 136
Accepted

### Performance of microkernel vs monolithic kernel

As is always the answer (or at least the preface) to performance-related questions: know your problem domain, run comparative benchmarks, and remember what premature optimization is. First, no ...
• 681
Accepted

You should first state the deadlock freedom property and the starvation freedom property more precisely. I use the definition in the Book: The Art of Multiprocessor Programming; Section 2.2. Freedom ...
• 9,209
Accepted

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

TL;DR: No. It depends on the OS and the keyboard. I'll show you how to determine this yourself on a Linux machine. I'm using Ubuntu 16.04 on an x86 processor. So if you are using a fairly modern ...
• 376
Accepted

### Why is copy speed periodic? (or seems to be)

Here's a possibility: Every transfer copies one megabyte and takes 0.4 seconds. The display is updated every second. The counter for "data transferred" is updated when a transfer is complete....
• 25.2k