Skip to main content
130 votes

What is meant by the phrase “Software can replace hardware”?

I am surprised nobody mentioned yet one of the most glaring examples: software-defined radio. If you took a present-day smartphone back in time some 50 years and showed it to a competent engineer ...
Viktor Toth's user avatar
  • 1,000
51 votes
Accepted

Where did usage of OS signals go?

it seems like signals were the primary way to communicate between processes I'd disagree with this. Signals are/were the primary way for a "supervisor" process to control a "supervised&...
Philip Kendall's user avatar
43 votes
Accepted

Are C strings always null terminated, or does it depend on the platform?

The things that are called "C strings" will be null-terminated on any platform. That's how the standard C library functions determine the end of a string. Within the C language, there's nothing ...
Simon B's user avatar
  • 9,643
42 votes

What is meant by the phrase “Software can replace hardware”?

Consider this circuit: It is a Flip Flop, aka a Bistable Multivibrator. It can be replaced with this code: static bool toggle; if (toggle == true) { lblTop.BackColor = Color.Black; ...
Robert Harvey's user avatar
32 votes

Where did usage of OS signals go?

Signals haven't gone anywhere. They do about as much now as they did in the 1970s. (A little more, but not much more.) Signals were, and are, a crude way of letting a process know that something ...
Gilles 'SO- stop being evil''s user avatar
28 votes

What is meant by the phrase “Software can replace hardware”?

It means exactly what it sounds like. A particularly famous example is the Disk II Drive designed by Steve Wozniak for the Apple II: The chief innovation was making the controller compact by using ...
8bittree's user avatar
  • 5,656
26 votes

Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?

As you may have noticed, there's a category of application that tries really hard to avoid input lag and only occasionally fails at doing so: games. Even then it's not uncommon for players to notice ...
pjc50's user avatar
  • 13.7k
25 votes

Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?

I would like to answer this question from more of a high-level, marketing perspective than a more low-level, technical one. All of the current mainstream Operating Systems are so-called general ...
Jörg W Mittag's user avatar
22 votes

Are C strings always null terminated, or does it depend on the platform?

Determination of the terminating character is up to the compiler for literals and the implementation of the standard library for strings in general. It isn't determined by the operating system. The ...
Blrfl's user avatar
  • 20.4k
20 votes

Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?

Why can't (or why don't) operating systems absolutely prioritise user input (and repainting thereof) in threading and process scheduling? Even if the operating system tells the application about the ...
Caleth's user avatar
  • 11.5k
17 votes
Accepted

Why system calls are limited to C language as far as I see?

On Windows, OS X and Linux, we can only use C Language to post system calls. Actually, this is wrong, at least for Linux. The real system call does not use the same calling convention than C, as ...
Basile Starynkevitch's user avatar
16 votes

Why is it called a "trap" instruction?

It's what we call kernel or system "trap", which triggers a kernel mode switch to execute the system call. As to why that word was used, I haven't found definitive proof yet, so my current ...
haylem's user avatar
  • 29k
15 votes

Does a file system "see" the storage device as a (very large) byte array?

On Linux (and 1980s era Unixes), a storage device (quite often a disk partition on some hard disk, or on some SSD) is a block device (see this) so is a [sub-]sequence of blocks (which is the basic ...
Basile Starynkevitch's user avatar
15 votes

Where did usage of OS signals go?

Signals were always a rather quirky. The mechanism is very simple, which is why it was created in the first place, but because the signal handler can interrupt the process in literally any point, what ...
Jan Hudec's user avatar
  • 18.3k
13 votes
Accepted

Why are computer systems still insecure?

At its core, the problem is that software is complex. For any site, you have all of the JavaScript to make the site run. You have the server to handle requests. You have the cache to handle in flight ...
Telastyn's user avatar
  • 109k
12 votes

Would we need Docker if applications were better behaved?

A major benefit of virtual machines and containers is the way you can isolate an application from any other applications, and reason about it as being a separate entity with clear interfaces that you ...
Arseni Mourzenko's user avatar
11 votes

What is meant by the phrase “Software can replace hardware”?

Another field in which this is true is synthesisers. Early synthesizers were 100% analog hardware that generated waveforms directly then modified them via circuitry (filters, amplifiers, etc.). It ...
Joe McMahon's user avatar
11 votes

Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?

In my experience, on most computers I have ever used, this is usually caused by inappropriate swapping to disk. Every other cause (such as operating system locks) is significantly less common. When ...
Stack Exchange Supports Israel's user avatar
10 votes

What is the relationship between a program and processes in the Operating System?

Although there is no single source of truth about these terms, I think we can agree about the fundamental difference between a program and a process: a program is a set of instructions intended to ...
Christophe's user avatar
  • 78.7k
9 votes
Accepted

Relationship between the C standard libraries and Java standard libraries

Which is the relationship between the standard libraries of C language and the standard libraries of other software platforms, e.g. Java, .NET, Python? There is no relationship. Some library ...
Jörg W Mittag's user avatar
9 votes

How is a software able to read a network file faster than it appears to be possible?

A network of 100 Mbps (mega bits per seconds) conveys 12,5 MB per seconds, including payload and protocol overhead. A file of 165 MB needs at least 13,5 seconds (In fact, it would require slightly ...
Christophe's user avatar
  • 78.7k
9 votes

How does an OS limit a program capabilities, if it's working directly with the cpu?

Modern CPUs have privilege modes that are used by the operating system lock out certain instructions.  For example in user mode the instructions that modify (raise) the privilege mode or access system ...
Erik Eidt's user avatar
  • 34.2k
9 votes

Why is it called a "trap" instruction?

While we can all say that the concept of "trap on overflow", or "trap on divide by zero" makes intuitive sense – stop the program from proceeding — what I would do is look to the ...
Erik Eidt's user avatar
  • 34.2k
8 votes

how is stack and heap are assigned to each processes?

What you're fundamentally missing is that P1 and P2 each get their own stack. So the resulting pictures are much cleaner than you are imagining. You have two stacks, one for P1 and one for P2. They ...
Erik Eidt's user avatar
  • 34.2k
8 votes

Two C program sharing same addresses

This is the result of virtual memory. Roughly, virtual memory provides each running program with the illusion that all of the system's memory is at its disposal. It presents each program with an ...
Charles E. Grant's user avatar
8 votes

Would it be possible to abstract multi-threading ability for programs not originaly designed for such?

For programs written in an imperative/procedural style, this is next to impossible because the separate threads may access shared data, and correct semantics for larger-grained parallelism can't be ...
Hans-Martin Mosner's user avatar
7 votes

Is there a way to see how many operations a function, block of code or a statement costs?

You can kind-of put a bound on the number of CPU cycles a certain instruction takes by looking at the manual for the specific CPU you are interested in. E.g. Intel publishes instruction manuals for ...
Jörg W Mittag's user avatar
7 votes
Accepted

Building a program that truly deletes everything

You can very difficultly obtain a true irrecoverable deletion of data. This is not related to algorithms but to physical properties of storage media. You can only hope to reduce the risk (or ...
Christophe's user avatar
  • 78.7k

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