18
Introduction: A computer system is a collection of hardware and software components designed to provide an effective tool for computation. (OR) A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. (OR) A computer is a general purpose device that can be programmed to carry out a set of arithmetic or logical operations automatically. Since a sequence of operations can be readily changed, the computer can solve more than one kind of problem. (OR) You probably already know that you can use a computer to type documents, send email, play games, and browse the Web. You can also use it to edit or create spreadsheets, presentations, and even videos. All types of computers consist of two basic parts: Hardware and Software. o Hardware is any part of your computer that has a physical structure (or) Hardware generally refers to the electrical, mechanical and electronic parts that make up the computer. Ex:-Monitor, keyboard. o Software is any set of instructions that tells the hardware what to do. Software refers to the set of programs written to provide services to the system. It gives life and meaning to the hardware and bring it to the operational level, which otherwise is a useless piece of metal. Ex: - browsers, games, word processors. Components of a Computer System

ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

  • Upload
    donga

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Introduction: A computer system is a collection of hardware and software components

designed to provide an effective tool for computation.(OR)

A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data.

(OR) A computer is a general purpose device that can be programmed to carry

out a set of arithmetic or logical operations automatically. Since a sequence of operations can be readily changed, the computer can solve more than one kind of problem.

(OR) You probably already know that you can use a computer to type

documents, send email, play games, and browse the Web. You can also use it to edit or create spreadsheets, presentations, and even videos.

All types of computers consist of two basic parts: Hardware and Software.

o Hardware is any part of your computer that has a physical structure (or) Hardware generally refers to the electrical, mechanical and electronic parts that make up the computer. Ex:-Monitor, keyboard.

o Software is any set of instructions that tells the hardware what to do. Software refers to the set of programs written to provide services to the system. It gives life and meaning to the hardware and bring it to the operational level, which otherwise is a useless piece of metal. Ex: - browsers, games, word processors.

Components of a Computer System

An operating system is an important part of almost every computer system. A computer system can be divided roughly into four components.

Hardware Operating system The application programs Users

Page 2: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

The hardware - the central processing unit (CPU), the memory, and the Input/output (I/O) devices-provides the basic computing resources.

Software is basically of two types: Application Software System Software

Application Software is set of programs written for a specific area of application, the application programs- such as word processors, spreadsheets, compilers, and web browsers- define the ways in which these resources are used to solve the computing problems of the users.

System Software is a set of programs written from the point of view of the machine i.e. for the sake of the system. System Software provides environment for execution of application software. System Software is basically categorized into three, Operating System, Language translators, Programming Utilities

Operating System:

An operating system is similar to a government. The OS simply provides an environment within which other programs can do useful work.

(OR)

Page 3: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

An operating System (OS) is an intermediary between users and computer hardware. It provides users an environment in which a user can execute programs conveniently and efficiently.

(OR)In technical terms, it is software which manages hardware. An operating System controls the allocation of resources and services such as memory, processors, devices and information.

(OR)An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs.

Operating system operations:- Modern OSs is interrupt driven. If there are no processes to execute, no I/O

devices to service, and no users to whom to respond, an OS will sit quietly, waiting for something to happen.

Events are almost always signaled by the occurrence of an interrupt or a trap. A trap (or an exception) is a software-generated interrupt caused either by an error (for example, division by zero or invalid memory access) or by a specific request from a user program that an operating-system service be performed.

With sharing, many processes could be adversely affected by a bug in one program. For example, if a process gets stuck in an infinite loop, this loop could prevent the correct operation of many other processes.

More subtle errors can occur in a multiprogramming system, where one erroneous program might modify another program, the data of another program, or even the OS itself.

Dual-Mode Operation

In order to ensure the proper execution of the OS, we must be able to distinguish between the execution of operating-system code and user-defined

At the very least, we need two separate modes of operation: user mode and kernel mode (also called supervisor mode, system mode, or privileged mode). A bit, called the mode bit is added to the hardware of the computer to indicate the current mode: kernel (0) or user (1).

User mode: a subset of instructions. Limited set of hardware and memory available.

o I/O protection, all I/O operations are privileged; so user programs can only access I/O by sending a request to the (controlling) OS.

Page 4: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

o Memory protection, base/limit registers (in early systems), memory management unit, (MMU, in modern systems); so user programs can only access the memory that the OS has allocated.

o CPU control, timer (alarm clock), context switch; so user programs can only read the time of day, and can only have as much CPU time as the OS allocates.

When a user application requests a service from the OS (via a system call), it must transition from user to kernel mode to fulfill the request

Figure 2.25: Transition from user to kernel mode.

The dual mode of operation provides us with the means for protecting the OS from errant users-and errant users from one another.

If an attempt is made to execute a privileged instruction in user mode, the hardware does not execute the instruction but rather treats it as illegal and traps it to the OS.

The life cycle of instruction execution in a computer system. Initial control is within the OS, where instructions are executed in kernel mode. When control is given to a user application, the mode is set to user mode. Eventually, control is switched back to the OS via an interrupt, a trap, or a system call.

System calls provide the means for a user program to ask the OS to perform tasks reserved for the OS on the user program's behalf.

A system call usually takes the form of a trap to a specific location in the interrupt vector.

When a system call is executed, it is treated by the hardware as a software interrupt. Control passes through the interrupt vector to a service routine in the OS, and the mode bit is set to kernel mode.

Distributed Systems:-

Page 5: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

A distributed system is a collection of physically separate, possibly heterogeneous computer systems that are networked to provide the users with access to the various resources that the system maintains. Access to a shared resource increases computation speed, functionality, data availability, and reliability.Some operating systems generalize network access as a form of file access, with the details of networking contained in the network interface's device driver. Others make users specifically invoke network functions. Generally, systems contain a mix of the two modes—for example FTP and NFS. The protocols that create a distributed system can greatly affect that system's utility and popularity.A network, in the simplest terms, is a communication path between two or more systems. Distributed systems depend on networking for their functionality. Networks vary by the protocols used, the distances between nodes, and the transport media. TCP/IP is the most common network protocol, although ATM and other protocols are in widespread use. Likewise, operating system support of protocols varies. Most operating systems support TCP/IP, including the Windows and UNIX operating systems. Some systems support proprietary protocols to suit their needs. To an operating system, a network protocol simply needs an interface device—a network adapter, for example-— with a device driver to manage it, as well as software to handle data. Networks are characterized based on the distances between their nodes. A local-area network (LAN) connects computers within a room, a floor, or a building. A wide-area network (WAN) usually links buildings, cities, or countries. A global company may have a WAN to connect its offices worldwide. These networks may run one protocol or several protocols. The continuing advent of new technologies brings about new forms of networks.For example, a metropolitan-area network (MAN) could link buildings within a city. Bluetooth and 802.11 devices use wireless technology to communicate over a distance of several feet, in essence creating a small-area network such as might be found in a home.The media to carry networks are equally varied. They include copper wires, fiber strands, and wireless transmissions between satellites, microwave dishes, and radios. When computing devices are connected to cellular phones, they create a network. Even very short-range infrared communication can be used for networking. At a rudimentary level, whenever computers communicate, they use or create a network. These networks also vary in their performance and reliability.Some operating systems have taken the concept of networks and distributed systems further than the notion of providing network connectivity. A network operating system is an operating system that provides features such as file sharing across the network and that includes a communication scheme that allows different processes on different computers to exchange messages.

Special-Purpose Systems: - functions are limited and deals with limited computation.

Real Time Embedded Systems

Page 6: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Multimedia Systems Handheld systems

Real Time Embedded Systems: - Embedded computer devices are found everywhere from car engines and manufacturing robots to VCRs and microwave oven. These are designed for specific task, usually, they have little or no user interface, preferring to spend their time monitoring and managing hardware devices, such as automobile engines and robotic arms. Even now, entire houses can be computerized, so that a central computer—either a general-purpose computer or an embedded system—can control heating and lighting, alarm systems, and even coffee makers.Multimedia Systems:- Most operating systems are designed to handle conventional data such as text files, programs, word-processing documents, and spreadsheets. However, a recent trend in technology is the incorporation of multimedia data into computer systems. Multimedia data consist of audio and video files as well as conventional files. These data differ from conventional data in that multimedia data—such as frames of video—must be delivered (streamed) according to certain time restrictions (for example, 30 frames per second).Multimedia describes a wide range of applications that are in popular use today. These include audio files such as MP3 DVD movies, video conferencing, and short video clips of movie previews or news stories downloaded over the Internet. Multimedia applications may also include live webcasts (broadcasting over the World Wide Web) of speeches or sporting events and even live webcams that allow a viewer in Manhattan to observe customers at a café in Paris. Multimedia applications need not be either audio or video; rather, a multimedia application often includes a combination of both. For example, a movie may consist of separate audio and video tracks. Nor must multimedia applications be delivered only to desktop personal computers. Increasingly, they are being directed toward smaller devices, including PDAs and cellular telephones. For example, a stock trader may have stock quotes delivered wirelessly and in real time to his PDA.Handheld SystemsHandheld systems:-Handheld systems include personal digital assistants (PDAs), such as Palm and Pocket-PCs, and cellular telephones, many of which use special-purpose embedded operating systems. Developers of handheld systems and applications face many challenges, most of which are due to the limited size of such devices. For example, a PDA is typically about 5 inches in height and 3 inches in width, and it weighs less than one-half pound. Because of their size, most handheld devices have a small amount of memory, slow processors, and small display screens. The amount of physical memory in a handheld depends upon the device, but typically is somewhere between 512 KB and 128 MB. As a result, the operating system and applications must manage memory efficiently. This includes returning all allocated memory back to the memory manager when the memory is not being used.

Page 7: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

A second issue of concern to developers of handheld devices is the speed of the processor used in the devices. The last issue confronting program designers for handheld devices is I/O.

Operating-System Services

Figure- A view of operating system services

OS’s provide environments in which programs run, and services for the users of the system, including:

User Interfaces - Means by which users can issue commands to the system. Depending on the system these may be a command-line interface ( e.g. sh, csh, ksh, tcsh, etc. ), a GUI interface ( e.g. Windows, X-Windows, KDE, Gnome, etc. ), or a batch command systems. The latter are generally older systems using punch cards of job-control language, JCL, but may still be used today for specialty systems designed for a single purpose.

Program Execution - The OS must be able to load a program into RAM, run the program, and terminate the program, either normally or abnormally.

I/O Operations - The OS is responsible for transferring data to and from I/O devices, including keyboards, terminals, printers, and storage devices.

File-System Manipulation - In addition to raw data storage, the OS is also responsible for maintaining directory and subdirectory structures, mapping file names to specific blocks of data storage, and providing tools for navigating and utilizing the file system.

Communications - Inter-process communications, IPC, either between processes running on the same processor, or between processes running on

Page 8: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

separate processors or separate machines. May be implemented as either shared memory or message passing, ( or some systems may offer both. )

Error Detection - Both hardware and software errors must be detected and handled appropriately, with a minimum of harmful repercussions. Some systems may include complex error avoidance or recovery systems, including backups, RAID drives, and other redundant systems. Debugging and diagnostic tools aid users and administrators in tracing down the cause of problems.

Other systems aid in the efficient operation of the OS itself:

Resource Allocation - E.g. CPU cycles, main memory, storage space, and peripheral devices. Some resources are managed with generic systems and others with very carefully designed and specially tuned systems, customized for a particular resource and operating environment.

Accounting - Keeping track of system activity and resource usage, either for billing purposes or for statistical record keeping that can be used to optimize future performance.

Protection and Security - Preventing harm to the system and to resources, either through wayward internal processes or malicious outsiders. Authentication, ownership, and restricted access are obvious parts of this system. Highly secure systems may log all process activity down to excruciating detail, and security regulation dictate the storage of those records on permanent non-erasable medium for extended times in secure ( off-site ) facilities.

System Calls

System calls provide a means for user or application programs to call upon the services of the operating system.

Generally written in C or C++, although some are written in assembly for optimal performance.

Figure 2.4 illustrates the sequence of system calls required to copy a file:

Page 9: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Figure - Example of how system calls are used.

The use of APIs instead of direct system calls provides for greater program portability between different systems. The API then makes the appropriate system calls through the system call interface, using a table lookup to access specific numbered system calls, as shown in Figure 2.6:

Page 10: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Figure - The handling of a user application invoking the open( ) system call

Parameters are generally passed to system calls via registers, or less commonly, by values pushed onto the stack. Large blocks of data are generally accessed indirectly, through a memory address passed in a register or on the stack, as shown in Figure 2.7:

Figure - Passing of parameters as a table

Types of System Calls

Six major categories, as outlined in Figure 2.8 and the following six subsections:

Page 11: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,
Page 12: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Operating-System Structure:

For efficient performance and implementation an OS should be partitioned into separate subsystems, each with carefully defined tasks, inputs, outputs, and performance characteristics. These subsystems can then be arranged in various architectural configurations:

Simple Structure

When DOS was originally written its developers had no idea how big and important it would eventually become. It was written by a few programmers in a relatively short amount of time, without the benefit of modern software engineering techniques, and then gradually grew over time to exceed its original expectations. It does not break the system into subsystems, and has no distinction between user and kernel modes, allowing all programs direct access to the underlying hardware. ( Note that user versus kernel mode was not supported by the 8088 chip set anyway, so that really wasn't an option back then. )

Figure - MS-DOS layer structure

The original UNIX OS used a simple layered approach, but almost all the OS was in one big layer, not really breaking the OS down into layered subsystems:

Page 13: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Figure - Traditional UNIX system structure

Layered Approach

Another approach is to break the OS into a number of smaller layers, each of which rests on the layer below it, and relies solely on the services provided by the next lower layer.

This approach allows each layer to be developed and debugged independently, with the assumption that all lower layers have already been debugged and are trusted to deliver proper services.

The problem is deciding what order in which to place the layers, as no layer can call upon the services of any higher layer, and so many chicken-and-egg situations may arise.

Layered approaches can also be less efficient, as a request for service from a higher layer has to filter through all lower layers before it reaches the HW, possibly with significant processing at each step.

Figure - A layered operating system

Microkernel’s

Page 14: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

The basic idea behind micro kernels is to remove all non-essential services from the kernel, and implement them as system applications instead, thereby making the kernel as small and efficient as possible.

Most microkernel’s provide basic process and memory management, and message passing between other services, and not much more.

Security and protection can be enhanced, as most services are performed in user mode, not kernel mode.

System expansion can also be easier, because it only involves adding more system applications, not rebuilding a new kernel.

Mach was the first and most widely known microkernel, and now forms a major component of Mac OSX.

Windows NT was originally microkernel, but suffered from performance problems relative to Windows 95. NT 4.0 improved performance by moving more services into the kernel, and now XP is back to being more monolithic.

Another microkernel example is QNX, a real-time OS for embedded systems.

Figure - Architecture of a typical microkernel

Modules

Modern OS development is object-oriented, with a relatively small core kernel and a set of modules which can be linked in dynamically. See for example the Solaris structure, as shown in Figure 2.13 below.

Modules are similar to layers in that each subsystem has clearly defined tasks and interfaces, but any module is free to contact any other module, eliminating the problems of going through multiple intermediary layers, as well as the chicken-and-egg problems.

The kernel is relatively small in this architecture, similar to microkernels, but the kernel does not have to implement message passing since modules are free to contact each other directly.

Page 15: ramprakasharava.files.wordpress.com€¦  · Web viewApplication Software is set of programs written for a specific area of application, the application programs- such as word processors,

Figure - Solaris loadable modules

Hybrid Systems

Most OSes today do not strictly adhere to one architecture, but are hybrids of several.

Mac OS X:-The Max OSX architecture relies on the Mach microkernel for basic system management services, and the BSD kernel for additional services. Application services and dynamically loadable modules ( kernel extensions ) provide the rest of the OS functionality:

Figure - The Mac OS X structure