Friday, May 26, 2006

What is an OS, anyway?

Most average Windows users probably have very little idea what an operating system is, let alone how much the operating system influences what they can and can't do with their computers. An (admittedly oversimplified) introduction, then, might be helpful.

Imagine, for the moment, that you're in a restaurant. Your server arrives and presents you with a menu of all of the restaurant's offerings. You look through the menu, decide what you would like to have, and inform the server -- who scurries off to the kitchen to place your order. After a short delay, your food arrives -- hopefully what you ordered, but not necessarily.

Without knowing it, you have used a form of operating system, although it had little to do with computers. Let's look at the steps involved:
  1. You, the user, chose what you wanted from a menu of options.
  2. The server ensured that your selections were legitimate and complete, and corrected you when necessary.
  3. The server communicated your selections to the kitchen.
  4. In the kitchen, the chef matched your selections with pre-built recipes.
  5. After selecting the recipes, the chef carried out the instructions in the recipes -- finding ingredients, mixing them in proper ratios, cooking or chilling them, etc.
  6. Once the instructions were complete, the chef gave the results to the server.
  7. The server brought the results to you, the user.
The operating system (OS) of your computer performs the same functions. When you sit down at the computer, the operating system presents you with a series of options -- you can run programs, copy or delete files, etc. Whether the operating system uses icons that you can drag back and forth or commands that you type in, the OS still translates your requests into a series of instructions that can be carried out by the computer.

Most operating systems (including Windows and Linux) consist of several "layers", or components. In Linux, these components consist of:
  • The "kernel" -- the basic rules the computer follows to interact with all of the hardware on your computer. In our restaurant example, the recipe book is the restaurant's "kernel".
  • The "shell" -- the fundamental means of interacting with the kernel and the computer's components. In our restaurant, the menu is the restaurant's "shell"
  • The "desktop" -- the interface that allows the user to interact with the operating system's shell. The restaurant's server performs the function of the OS desktop, helping you to navigate the options presented in the menu. Of course, you don't need a desktop on a computer any more than you need a server in a restaurant -- if you're willing to read your menu items directly to the kitchen, you might also be willing to use the shell to enter commands directly.
Windows has a similar architecture, although the components are integrated far more than in Linux, so you may not recognize them individually.

Replacing the operating system on your computer is like a restaurant changing its offerings. It will need a whole new set of recipes (kernel) and a new menu (shell). Once you've changed all of this, you will probably need all new waitstaff (desktop). You can, of course, make the new waitstaff look and operate very much the same way the former staff worked.

When you change from Windows to Linux, you will need to install a new kernel, a new shell, and a new desktop. Most of the time, these all come together in one package. Once you're done, you'll still be able to perform the same general functions you did before, but things will look and work a little differently. And, just as your favorite meal might disappear from a restaurant that changes its menu, you probably won't be able to run your favorite Windows applications once you switch to Linux (there are, however, some nice conversion utilities that we'll discuss in the coming days to help with this).

So why do we have operating systems at all? Unless you want to go into the kitchen and cook the food yourself, the operating system is going to save you a lot of time and effort. The OS confers two principal benefits:
  1. It makes your job easier as a user. You can configure your operating system once, and then every program you run within the operating system will (probably) conform to your configuration. Otherwise, you'd have to configure every program you run to know what kind of printer you have, what time zone you live in, and what colors you like to use on the screen.
  2. It makes the programmer's job easier. The programmer doesn't have to know what kind of monitor or printer or disk drive you have to write your word processor. All the programmer has to know is that you have these things. The job of the operating system is to find out what kind of components you have, and then provide a link from the software to those components. Otherwise, the programmer would have to write software for every possible component into every program. With an operating system, this software is written once, and every program "borrows" it.
The next time you order food online, consider that you've just used two operating systems. And bon appetit.

Regards.


0 Comments:

Post a Comment

<< Home