Operating Systems (Theory)
An operating system is, simply speaking, the software that operates the hardware on behalf of the user(s). It is that software which makes the hardware usable to the humans. Among the important functions of an operating system are that it:
- defines the user interface;
- allows sharing of resources among users, while preserving privacy;
- schedules resources;
- facilitates I/O functions;
- provides routines for applications to use peripherals.
One of the oldest views of the operating system is to consider it as a resource manager that doles out rations of scarce resources to competing processes. Although many resources, such as memory sizes and CPU speeds, have grown exponentially since this view was first developed, it remains current because the demands on these resources have more than kept pace with their growth.
It is common practice to speak of an operating system kernel, which is the smallest core of the operating system. Typically, the kernel of an operating system does not include fancy features for memory management, plug-and-play for peripherals, or so on. It really is the most basic amount of software required to define the immediate working environment of the CPU. Further features of an operating system are acquired by adding artifacts to the kernel. The kernel itself takes only a miniscule amount of resources compared with the add-ons; for example, the original Unix kernel from about 1970 could run on a machine with just 4 KB of RAM! More advanced kernels exist today, of course, but it is still typical for kernels, especially for Unix variants, to be quite small in their demands.
An operating system must exercise control in order to allocate input-output access to contending requests. This is typically done using a method called I/O interlock, wherein it is ensured that mutual exclusion is maintained among various processes that need to use an I/O resource. Operating systems also have to allocate I/O to processes keeping in mind the limited bandwidth of the channels used; the code used for this can be as complex as the code that is used to schedule CPU time among processes.
The secondary memory is the most important resource that is overseen by the operating system, at least from the perspective of the user. In the traditional shell environment such as on Unix or DOS, the operating system is seen as little more than a command-line interface that is used to launch programs and execute specific commands for printing or accessing secondary storage. In a more advanced sense, the function of an operating system is the allocation of space on disk drives and such media among competing files. Since the physical structure of memory units on disk drives is very different from that in main memory, the algorithms used tend to be very different. Another problem in this context is that read and write times to secondary memory tend to be much slower (by several orders of magnitude) that those to main memory. For example, a hard drive can be read from or written to at about 10 MB a second, while a floppy drive can be read or written at just about 30 KB a second. These numbers compare very poorly with the speeds for main memory, which are of the order of 1 GB a second.
Security and reliability are two other functions provided by operating systems. Security is the feature of the operating system that makes it impervious to malicious attack. On small systems, security is not bothered with to any great degree, and anyone with physical access to the computer has access to all its workings. On larger systems which nowadays are constantly connected to the Internet and are used by many users, security is a serious issue. Reliability is similarly the feature of the system to be protected against accidental damage. In general, though the relationship between security and reliability is often debated and the terminology is not fixed, it is accepted that whatever a malicious user can do on purpose, a careless user can do by accident. Since there are more careless people in the world than malicious ones, the risks from carelessness and malice are both equally significant, even granting that a catastrophe is more likely to result from malice than from carelessness.
Sharing of resources and information is a challenging issue in operating systems. Sharing is trivial when there is no protection or privacy, and protection is trivial when there is no sharing. In practice, a balance must be struck between these incompatible extremes. Operating systems use features such as access control lists (ACLs) that provide safe sharing, whether on disk or on main memory. Every user has some regions of memory that are private, and some that are shared with others, but not with all. On Unix and other operating systems, the "superuser," also called root, has access to all user resources. A process has the priority associated with the user who created it; thus a user process cannot mess up the system because the system files are not write-accessible to users. A user process cannot interfere with another user process, but the root can kill any user process, a useful feature for system administration in case of a careless or malicious user.
This is the complete article, containing 857 words
(approx. 3 pages at 300 words per page).