130

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 from the mid-1960s, he would be able to comprehend most of it. That a supercomputer can be reduced to something that fits in your pocket? Check. That you can have ...


81

You mention on how if the code is specific to a CPU, why must it be specific also to an OS. This is actually more of an interesting question that many of the answers here have assumed. CPU Security Model The first program run on most CPU architectures runs inside what is called the inner ring or ring 0. How a specific CPU arch implements rings varies, but ...


62

Today, most database management systems (e.g. PostGreSQL, MongoDB, etc...) internally keep their data inside OS files (in the past, some DBMSs used raw disk partitions directly). On recent computers still using spinning hard disks, the disk is so slow - relative to the CPU or the RAM - that adding a few software layers is not relevant. SSD technology might ...


51

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" project - e.g. init wanting to stop a process at system shutdown, a shell wanting to notify a subprocess of something. They were never really the primary ...


49

As you can see, APIs are not indicated as a part of the operating system. I think you are reading too much into the diagram. Yes, an OS will specify a binary interface for how operating system functions are called, and it will also define a file format for executables, but it will also provide an API, in the sense of providing a catalog of functions that ...


42

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; lblBottom.back Color = Color.Red; } else { lblTop.BackColor = Color.Red; lblBottom.BackColor = Color.Black; } toggle = !toggle;


41

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 stopping you from having an array of characters that doesn't end in a null. However you will have to use some other method to avoid running off the end of a string....


32

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 happened. When a process reacts to a signal, that signals usually either means “go away” (the primary intent of signals, which is why the system call to send a ...


28

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 software while competitors relied on hardware. As Bill Fernandez, then an electronic technician at Apple, remembers it, "the key advantage of [Wozniak's] ...


25

Http.sys is not so much a web server as a proxy-forwarder. Its designed to allow many web servers co-exist on a Windows box, so you can have IIS running a web site, but also several WCF services running with http/REST or SOAP interfaces, all on standard port 80. (this is why you can't run Apache on Windows without a bit of jiggling, Apache hasn't been ...


25

Although this is opinion-based, I think it's just another historical artifact. Early OSes used a simple file system design for performance that was reasonably strongly tied to the characteristics of the hardware available at the time, and it's been the same way ever since. It's difficult to change the old file read/write APIs for more transactional query/...


22

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 convention of NUL termination goes back to pre-standard C, and in 30+ years, I can't say I've run into an environment that does anything else. This behavior ...


21

I'd say that Fortran, even of pre-C times, abstracts the programmer from hardware details too much. No pointer support. If you want to pass large amounts of data between subroutines, you use a COMMON block, and you don't control its allocation. Pointer arithmetic and structure allocation control are hard to non-existent. Data types are numeric-oriented. ...


17

Is the compiler doing anything OS specific when compiling this? Probably. At some point during the compiling and linking process, your code is turned into an OS-specific binary and linked with any required libraries. Your program has to be saved in a format that the operating system expects so that the OS can load the program and start executing it. ...


16

At least for free software on Linux, you usually use some builder like make. You could use some other builder program, like scons or omake For some (mostly historical) reasons, the Makefile may be generated by utilities like autoconf or cmake; these generators also deal with configuration issues (e.g. they disable some features of the software if a ...


16

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 defined in the ABI. Details are of course processor specific (so let's focus on x86-64). (I am not exactly sure of all the details here, you need to check; I've ...


16

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 assumption is that it comes from either or both of these 2 options: We used to say sometimes that the code "fell" into a different mode instead of &...


15

I'm rather stunned that in all the time since this question was posted that nobody has mentioned the origins of segmented memory architectures and the true power that they can afford. The original system which either invented, or refined into useful form, all the features surrounding the design and use of segmented paged virtual memory systems (along with ...


15

Since you're not talking about booting, your answer is actually that the concept of "executable," or even "files" is rather irrelevant. The concept of files is an OS concept. Without an OS, all you have is a harddrive, with some bits on it. It is the OS that gives structure to that information that makes it meaningful to think of the data as a file. For ...


15

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 unit of physical I/O). The physical block size depends on the hardware (old IDE disks had a block size of 512 bytes, new large SATA disks have a block size of ...


14

Http.sys is not the only kernel-mode web server available: under Linux there is also tux. As you have correctly identified, security is a concern with these kinds of servers, which has lead to tux not being included in the mainline linux kernel (and I believe not updated for more recent kernel versions). A better solution would be the use of an operating ...


14

The book you are reading was published in 2007. The C++ API for managing threads wasn't standardised until 2011. At the time, on different systems you had to use entirely different platform-specific libraries (pthreads, win32 threads, etc). Now, this is no longer true. Your book is out of date.


14

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 you can do inside the handler is rather limited: you can't allocate memory (the signal might have just interrupted the allocation function), you can't lock ...


13

Given that most file systems store the contents of files in individual blocks that are not necessarily contiguous on the physical disk, but linked via pointer structures, it seems that such a mode - "inserting" rather than "appending" or "overwriting" - ought to be possible, and could certainly be made more efficient than what we have to do now: read the ...


13

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 data. You have the CDN to store all of the content. You have some database to store all of the data. You have backup servers where the data goes. You have ...


12

Theoretically, you could implement a file that would allow this sort of thing. For maximum flexibility, though, you'd need to store a pointer to the next byte along with every byte in the file. Assuming a 64-bit pointer, that would mean that 8 of every 9 bytes of your file would be composed of internal pointers. So it would take 9000 bytes of space to ...


12

There are a number of reasons, but one very important reason is that the Operating System has to know how to read the series of bytes that make up your program into memory, find the libraries that go with that program and load them into memory, and then start executing your program code. In order to do this, the creators of the OS create a particular format ...


12

Internet age distribution logistics disincentivizes fat binaries in two ways: The point of sale does not involve physical goods and therefore favor fewer SKU's as is the case when products compete for retail shelf space and customers have limited opportunities to make a purchase. The costs of bandwidth favors delivering just the minimum necessary bits for a ...


12

Microcontroller programs consist of a number of tasks. Let's say you wanted to make a computer-controlled telescope mount. The tasks would be: Retrieve a new byte of input from the USB serial buffer. Check if we've received a complete command. If so, execute that command. Read the sensors for the current telescope position. Set the proper output to ...


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