A Look at Linux Capabilities
Once I have established the basics, I will start looking into specific areas of Linux and the Linux phenomenon. In future columns and radio programs, expect to see coverage of office suites, web servers, embedded systems and all the other ways Linux is being used.
In addition to the information you find in these brief introductions to the radio show, our web site contains a complete archive of the articles that have appeared in Linux Journal from 1994 through 1999. It also has information on how to subscribe to the print version of Linux Journal, which allows you to keep up to date.
This week, I want to take a look at some features of the Linux operating system which make it stand out from what you find in the basic offerings from Microsoft. If you have a UNIX background, these features will be expected.
First, Linux is a preemptive multi-tasking operating system. Let me explain this in two parts. First, multi-tasking means that the operating system can perform more than one job at once. Or, more accurately, appear to perform more than one job at once. If your computer only has a single CPU then it really can only do one task at a time. What the Linux kernel does is schedules tasks based on a priority scheme and switches between them so that it appears all the tasks are running at once.
Why would you want to do this? Let's say you are using a text editor to edit a document. You might want to grab a web page with your browser or upload a data file to another system while you are working interactively with the editor. To Linux, this is just a simple job of switching between running your text editor and the file transfer program or browser as needed.
The "as needed" gets us to the pre-emptive part. The text editor will need to run when you have entered a keystroke, so it can process the keystroke and update the screen. The browser or transfer program will need to run when it is necessary to process the next input character from the Internet or send the next block of data.
To completely understand this, you need to know that a program called a device driver, rather than the text editor or browser, handles the actual transfer of data from keyboard to video display card and to or from your communications device. Thus, the device driver must be scheduled to send or receive the data, and then the applications program must be run to process the data.
An interrupt is created by the hardware for each unit of transfer (where a unit could be a single character or a block of data, depending on the type of device). The Linux kernel schedules the interrupt handler code of the appropriate device driver to deal with the interrupt.
Once the interrupt handler is done, the Linux scheduler then has to select the next task to run. The selection is made among all tasks that are ready to run. "Ready to run" means they are not waiting for a reason such as keyboard input. Thus, after the device driver handles an interrupt, the choice of what is ready to run is likely to change.
The ability of the task scheduler, part of the Linux kernel, to re-prioritize activities on the fly is the preemptive part of the story. The interrupt caused the device driver to preempt the task that was running, and the result of handling the interrupt could cause a different task to preempt the task that was running before the interrupt. This scheduling capability is what makes the computer appear to be doing multiple tasks at the same time--the computer can get a lot of work done between your keystrokes.
This is simply the ability to have more than one person using a single computer system at the same time. If you are an MS-Windows user, you are probably thinking about how you log in and how this is multi-user. Not so. Note that I said at the same time. On Windows9x, a single person logs in and has control of the computer. On a Linux system, a whole group of users can be logged in and doing work at the same time.
In the early days of Linux Journal, we had one Linux machine and a whole host of serial terminals connected to this single computer. Each user logged in to the single system and did their work. It was up to the Linux kernel to allocate the system resources between all the users and protect the integrity of each task. This is a relatively simple extension to preemptive multi-tasking, but an important one.
- Promise Theory—What Is It?
- Integrating Trac, Jenkins and Cobbler—Customizing Linux Operating Systems for Organizational Needs
- New Products
- New Products
- Tech Tip: Really Simple HTTP Server with Python
- Readers' Choice Awards
- RSS Feeds
- Virtualization Poll
- Validate an E-Mail Address with PHP, the Right Way