59 votes

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 ...
user avatar
40 votes
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 ...
user avatar
33 votes
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 ...
user avatar
29 votes
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 ...
user avatar
  • 141k
27 votes
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 ...
user avatar
22 votes
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-...
user avatar
22 votes
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 ...
user avatar
  • 18.9k
21 votes

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 ...
user avatar
21 votes
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 ...
user avatar
17 votes

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 ...
user avatar
17 votes
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 ...
user avatar
16 votes
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 ...
user avatar
15 votes
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 ...
user avatar
15 votes
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 ...
user avatar
14 votes

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 ...
user avatar
  • 410
14 votes

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 ...
user avatar
  • 1,116
14 votes
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 ...
user avatar
  • 29.1k
13 votes

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 ...
user avatar
13 votes
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 ...
user avatar
13 votes

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 ...
user avatar
13 votes

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 ...
user avatar
12 votes
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 ...
user avatar
12 votes

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.
user avatar
12 votes
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 ...
user avatar
  • 136
11 votes
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 ...
user avatar
11 votes
Accepted

Does Deadlock imply Starvation

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 ...
user avatar
  • 9,209
11 votes
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 ...
user avatar
11 votes
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....
user avatar
  • 25.2k
10 votes

How does the OS know the physical address of a process' first memory page?

The operating system performs a lot of work before executing the first instruction. The OS must set up at least two data structures, the page table and the region map. The region map is called ...
user avatar
10 votes

Why unsafe state not always cause deadlock?

Just to expound on what Wandering Logic was saying. Say I have two threads that both need access to X and Y, and have no synchronization and no mechanism to fix deadlock. This is unsafe, as one could ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible