Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Security-focused operating system wikipedia , lookup
Plan 9 from Bell Labs wikipedia , lookup
Copland (operating system) wikipedia , lookup
Spring (operating system) wikipedia , lookup
Burroughs MCP wikipedia , lookup
Distributed operating system wikipedia , lookup
Unix security wikipedia , lookup
V1.0 (16/11/2005) System Software The Free On-Line Dictionary of Computing (FOLDOC) has the following description about system software: System software typically includes an operating system to control the execution of other programs; user environment software such as a command-line interpreter, window system, desktop; development tools for building other programs such as assemblers, compilers, linkers, libraries, interpreters, cross-reference generators, version control, make; debugging, profiling and monitoring tools; utility programs, e.g. for sorting, printing, and editing. Remark: Readers are assumed to be familiar with the computer terms mentioned in the above quotation. For those who forget the meaning of some of the above terms, please use online computer dictionary like FOLDOC or online encyclopedia like Wikipedia to search for their meaning. As one can see from the above description, unlike application programs, e.g., a word processing system, an e-banking system, and a library system, which are developed for meeting specific needs of its users, system software exists to support the development and execution of application programs. System software enables application programs to interact with the computer hardware and helps the computer manage its internal and external resources. Specifically the heart of the operating system, commonly known as the kernel, typically sits between the application programs and computer hardware as depicted in Figure 1. Figure 1. Interactions among application programs, kernel and hardware Figure 2 gives the interactions among user, application programs, operating system kernel and other types of system software. Strictly speaking, the basic I/O system is a part of the system software of the IBM PC and compatibles, however, we use the term to represent the 1 sort of software that provides the lowest level interface to peripheral devices (e.g., mouse, keyboard and basic video display). Figure 2. Interactions among user, application programs, system software and hardware As shown in Figure 2, users do not interact with computer hardware directly. Instead, a user issues instructions through the user interface (usually in a command mode or a window environment). Those instructions may activate execution of application or utility program, or command the operating system kernel to finish the user task. Device drivers and basic input/output system may be called for accessing their associated hardware by the kernel. It is important to note that application programs rarely access computer hardware directly in general. If software instructs how computers work, why is there a need to introduce an operating system kernel as an intermediate layer between application programs and computer hardware? Readers will be able to find out the answer upon completion of this topic. Our discussion on operating systems is generally divided into two areas, namely functions of operating systems and types of operating systems. It aims to help readers understand what system software and an operating system are, as well as the characteristics of different types of operating systems. Why System Software 2 Earlier on, it is said that system software (1) enables application programs to interact with the computer hardware, and (2) helps the computer manage its internal and external resources. How can the functions be achieved? Regarding the first issue, we have mentioned that the kernel sits between applications programs and computer hardware to facilitate their interactions. The reason for having the middle layer is manifold: 1. Applications (e.g., word processing system and spreadsheet program) may contend for the use of non-sharable or limited computer resources (e.g., a printer) at the same time. It is important to introduce a mechanism to control and coordinate the access of those resources. 2. A system kernel can shield the low-level details of hardware by providing high-level functions for applications programs to use. Some of the reasons are as follows: Code to control computer resources such as peripheral devices may not be standardized. A kernel provides device drivers that perform operations on behalf of application programs such as an input/output operation. As a result, applications programmers can focus to solve the application related problems without bothering the issues of managing computer hardware. A kernel can enforce security through abstraction as important system resources that are critical to the functioning of a computer system will not be directly tampered by application programs. This ensures that in most cases, the malfunction of an application program will not cause a halt to the entire computer system. Such an idea is particularly important as modern computers are powerful enough to execute many programs virtually at the same time. Although application programs typically interact with computer hardware via the kernel, there are exceptions. The major reason of allowing an application program to bypass the kernel is for the sake of efficiency because kernel overheads for resource control and coordination can then be eliminated. A major source of kernel overheads is on context switching which is required to support multitasking (which will be further elaborated later on). Although a modern computer is able to slice its CPU time to run several programs virtually at the same time, a CPU can only attend to a single executing program (more commonly known as a process) at any time. In order to support CPU time slicing, programs are normally unable to be executed from beginning to end in a single shot. A process will be stopped when its time slice used up, releasing the CPU to run another process. However, it is important for the CPU to record 3 the current status, i.e., the contents of the CPU registers, of the suspended process (in a structure called a process control block) in the memory so that the suspended process can resume execution seamlessly when it is allocated with more CPU time at a later stage. The storing of the status of a process that is just suspended from execution and the restoring of process status of another ready-to-run process is referred to as context switching. For certain applications which demand extremely efficient execution, it is possible to bypass the kernel control so as to speed up the application execution speed. An example of bypassing kernel control so as to save the context switch overhead can be found here. As to the second issue, i.e., helping the computer manage its internal and external resources, various types of system software offer their contribution in different ways. Many applications need printer-access and it would not be sensibly to ask application developers to include codes in each of their programs to deal with printing. Instead an operating system (and its details will be discussed in the next section) can offer high-level functions for the application program to call upon. Such an idea of “reuse” is extended to application program development and system maintenance. For example, development tools for support program development such as compilers, linkers, libraries, and debugger are often bundled with the operating system whereas utility programs perform routine tasks like disk de-fragmentation and disk backup. As to the management of a computer’s internal resources, the kernel performs most of the task. Functions of Operating Systems In brief, an operating system (OS) is composed of a set of programs, typically a combination of kernel and library services, that manage the control and use of hardware. A kernel provides important functions to the working of almost all other application software, e.g., file management (how files are created, deleted, and maintained), process management (how states of running programs are recorded as the programs are invoked, executed and terminated), memory management (how main memory is allocated/deallocated with respect to the creation and termination of running programs), input/output (I/O) management (how I/O activities are coordinated), CPU management (how CPU time is allocated to perform a number of processes), etc. It is a control program that reacts to interrupts from external devices and services requests and traps from processes. Since kernel services are frequently required whenever the computer is turned on, the kernel is permanently resided in the computer memory for efficiency sake. In a nutshell, a kernel is a resource manager such that the resources can be computer hardware and data to ensure that those resources can be shared safely without jeopardizing the proper functioning of computers. 4 In this module, the following OS functions will be briefly covered: file management process management memory management I/O management CPU management File Management File management is concerned with how files are organized in secondary storage. In most modern operating systems like Unix, Linux and Microsoft Windows, files are normally organized into directories (in form of a hierarchical tree) to ease their access and use. A file manager needs to offer the following functions. creation and deletion of files creation and deletion of directories support of primitives for file and directory manipulation, e.g., move a file, copy a file, change access rights mapping of files onto secondary storage Process Management A process is an instance of a program in execution which may spawn child processes. Process management deals with many kinds of activities ranging from user programs to system programs like printer spooler, name servers, file server, etc. Its major activities are creation and deletion of user and system processes suspension and resumption of processes a mechanism for process synchronization a mechanism for process communication a mechanism for deadlock handling Deadlock occurs when a number of processes are waiting for an event or a resource which is held up by another waiting process. Deadlock only occurs when the following three conditions are met at the same time. circular waiting among processes non-sharable resources are held by processes no preemption of resources, i.e., processes can not be forced to give up the resources they are holding 5 Memory Management The main activities of memory management are as follows: Keep track of which part of memory are currently being used and by which processes Decide which process are loaded into memory when memory space becomes available Allocate and de-allocate memory space as needed, e.g., when a process is killed I/O Management The I/O manager hides users from the details of underlying hardware for the I/O. A knowledge of those details are only required for device driver development. Thus, application programmers can focus their effort in high-level program development without bothering the low-level system details. CPU Management CPU management (also known as processor management) concerns how CPU can be efficiently utilized to handle multiple processes. The relevant page in the howstuffworks web site states that the heart of managing the CPU comes down to two related issues: Ensuring that each process and application receives enough of the CPU time to function properly. Using as many processor cycles for real work as is possible. Some factors that affect the aforesaid issues are as follows: The CPU slice size – a large slice can cause a long delay to the waiting processes before they are given a share of the CPU time but a small slice can cause significant CPU overheads in context switching. The CPU scheduling strategies which concerns in the short term, which process is selected to run; in medium term, whether some process control blocks are to be stored on disk instead of memory if too many processes are running; in the long term, whether to admit more process to run. A more detailed introduction on processor scheduling (in PowerPoint) can be found here. Types of Operating Systems In this section, the following types of operating systems are introduced. Single-user and multi-user systems 6 Batch processing systems Online interactive systems Real-time systems Multitasking and multiprogramming systems Network systems Note that the above classification of operating systems is not exhaustive. Furthermore, it is possible to classify an operating system to multiple types. A brief description of how operating systems have evolved since 1940’s can be found here. Single-user and Multi-user Systems Single-user systems are designed for single users only. Operating systems for personal computing typically offer a computing environment for single users. Multi-user operating systems allow multiple users to run programs on a computer at the same time. Batch Processing Systems The General Motors Research Laboratories implemented the first operating systems in early 1950’s for their IBM 701 which generally ran one job, i.e., a predefined sequence of commands, at a time. Those systems were called single-stream batch processing systems because programs and data were submitted in groups or batches. A batch processing system takes a “batch” of jobs, executes them and returns the results, all without human intervention. Those jobs are typically taken from a disk file (or a deck of punched cards or magnetic tape in the old days) and the results are usually stored in a file or printed. The queue of jobs is usually described in file written in a preliminary form of scripting language known as job control language (JCL). Note that job batches were usually defined in an off-line manner. The design of batch processing systems is rather simple but it does not allow any interaction between users and the computer once a batch starts to run. Thus all the input is prepared before the program runs and so cannot depend on the program’s output. This contrasts with an interactive system where the user's commands and the computer's responses are interleaved during program execution, allowing the user's input to depend on earlier output from the same run. Another criticism against batch processing systems is that a job that demands intensive computational time may monopolize the use of CPU once the CPU is assigned for its execution. It is also impossible to implement any priority-based job scheduling mechanism unless all jobs are ready to run on the system before the job queue is defined. 7 Online Interactive Systems As mentioned earlier, an interactive system interleaves user commands and computer's responses during program execution and thus allows the user input to depend on earlier output from the same run. The interaction with the user is usually conducted through either a text-based command interpreter or a graphical user interface. Obviously interactive systems must be on-line or user input cannot be made in response to earlier system output. Thus, both user defined and system activities have to be coordinated and this increases the complexity of the OS design. Real-time Systems A real-time operating system is an operating system that has been developed for real-time applications. A real-time application demands the combined reaction and operation time of a job is shorter than the maximum delay that is allowed. If the maximum delay is exceeded, correctness, accuracy or effectiveness of the associated operation will be jeopardized. For example, the collision avoidance control system used by a train network is a real-time application. Failing to brake a train in time renders the control system worthless. As shown in this example, real-time operating systems are typically used for embedded applications, such as air traffic control and industrial robots. A real-time operating system does not necessarily have high throughput. What it needs to assure is that interrupts be handled within a certain specified maximum time. As stated in Wikipedia, real-time operating systems are valued more for how quickly they can respond to input than for the total amount of work they can do. Examples of real-time operating systems can be found here. Multitasking and Multiprogramming Systems Multitasking is a feature of operating systems that allows sharing a single processor between several independent jobs. Multitasking systems were first developed in early 1960s. The motivation of having a multitasking system is to make the best use of the CPU resource. For traditional batch processing systems, a job will not be started unless all other jobs ahead of it in the batch run to completion. In such a case, a CPU will become idle when a job needs to wait for some event, e.g., an I/O operation, to finish. However, in a multitasking system, a running job that waits for the completion of an event relinquishes CPU voluntarily so that the CPU can pick a waiting job to run. Thus the CPU will be busy all the time unless no jobs in the memory are ready to run. 8 In order to avoid a CPU being monopolized by any job, virtually all multitasking systems suspend the currently running job after it has run for a fixed period known as a time slice. The size of the time slice of various processes can be the same or different, and be fixed or varied over time. These depend on the choice of processor scheduling strategy. The scheduling strategy also decides the next job to run and (re)starting it. The cost of multitasking is mainly on job selection and context switching. As stated in FOLDOC, a multitasking operating system should provide some degree of protection of one job from another to prevent jobs from interacting in unexpected ways such as accidentally modifying the contents of each other’s memory areas. The jobs in a multitasking system may belong to one or many users. When a multitasking system supports a multi-user environment, i.e., jobs from different users are virtual running at the same time, it is referred to as a multiprogramming system. When the idea of time-slicing is applied to a multiprogramming system, such a kind of system is known as a timesharing system. The relationship between multitasking, multiprogramming, and timesharing systems is shown in Figure 3. Figure 3. Relationship between multitasking, multiprogramming, and timesharing systems Network Systems A network operating system (NOS) is an operating system that has been specifically designed to keep networks of computers running at optimal performance. It allows resources such as files, application programs, and printers to be shared between the networked computers. A NOS is not the same as the networking tools provided by some existing operating systems such as Windows XP. According to Wikipedia, NOS controls a network and its message (e.g. packet) traffic and queues controls access by multiple users to network resources such as files, and provides for certain administrative functions, including security. Some well-known examples of NOS’s are Unix, Windows NT, Windows 2000 Server, Windows 2003 Server, Red Hat Linux, and Novell NetWare. 9