Resource abstraction Along with resource allocation, resource abstraction is one of the major responsibilities of the operating system. Resource abstraction is the process of hiding the details of how the hardware operates, making computer hardware relatively easy for an application programmer to use. Operating system can implement resource abstraction by providing a single abstract disk interface which will be the same for both the hard disk and floppy disk. Such an abstraction saves the programmer from need to learn the details of both hardware interfaces. Instead, the programmer only needs to learn the disk abstraction provided by the operating system. Operating system provides an abstraction layer over the concrete hardware, use the computer hardware in an efficient manner and hide the complexity of the underlying hardware.
The significance of resource abstraction can be illustrated in this example: Suppose a programmer is writing an application to analyze stock market trends. For this programmer, the effort to design and debug code to read and write information to/from a disk drive would represent a significant fraction of the overall effort. The skill and experience required to write the software to control the disk drive are not the same as that to design the stock analysis portion of the program. While an application programmer must be aware of the general behavior of a disk drive, it is generally preferable to avoid learning the details of methods how disk input/output takes place. Abstraction is the perfect approach, since the application programmer uses a previously implemented abstraction to read and write the disk drive. A disk software package is an example of system software. Programmers can focus their attention on the application programming problem rather than diverting it to tasks not specific to the application domain. In other words, system software is generally transparent to the end user but is of major significance to the programmer. Resource abstraction provides an abstract model of the operation of hardware components and generalizes hardware behavior. It also limits the flexibility in which hardware can be manipulated. It also provides a more convenient working environment for applications, by hiding some of the details of the hardware, and allowing the applications to operate at a higher level of abstraction. For example, the operating system provides the abstraction of a file system, and applications don’t need to handle raw disk interfaces directly. Resource abstraction also provides isolation means that many applications can co-exist at the same time, using the same hardware devices, without falling over each other’s feet. One can view Operating Systems from two points of views: resource manager and extended machines. Form resource manager point of view operating systems manage the different parts of the system efficiently and from extended machines point of view operating systems provide a virtual machine to users that is more convenient to use. Modern operating systems generally have following three major goals. Operating systems generally accomplish these goals by running processes in low privilege and providing service calls that invoke the operating system kernel in highprivilege state.
4.1 To hide details of hardware by creating abstraction
An abstraction is software that hides lower level details and provides a set of higher-level functions. An operating system transforms the physical world of devices, instructions, memory, and time into virtual world that is the result of abstractions built by the operating system. There are several reasons for abstraction. First, the code needed to control peripheral devices is not standardized. Operating systems provide subroutines called device drivers that perform operations on behalf of programs, for example, input/output operations. Second, the operating system introduces new functions as it abstracts the hardware. For instance, operating system introduces the file abstraction so that programs do not have to deal with disks. Third, the operating system transforms the computer hardware into multiple virtual computers, each belonging to a different program. Each program that is running is called a process. Each process views the hardware through the lens of abstraction. Fourth, the operating system can enforce security through abstraction. 4.2 To allocate resources to processes (Manage resources)
An operating system controls how processes (the active agents) may access resources (passive entities).
4.3 Provide a pleasant and effective user interface The user interacts with the operating systems through the user interface and usually interested in the “look and feel” of the operating system. The most important components of the user interface are the command interpreter, the file system, online help, and application integration. The recent trend has been toward increasingly integrated graphical user interfaces that encompass the activities of multiple processes on networks of computers. 5. Limitations Resource abstraction has few limitations also. While making the hardware easier to use, resource abstraction also limits the specific level of control over the hardware by hiding some functionality behind the abstraction. Since most application programmers do not need such a high level of control, the abstraction provided by the operating system is generally very useful.
Abstractions also fail because they prevent programmer from controlling machine at desired level. Example: database systems often want to control movement of information between disk and physical memory, and the paging system can get in the way. More recently, existing OS schedulers fail to adequately support multimedia and parallel processing needs, causing poor performance. Abstractions often work well - for example, timesharing, virtual memory and hierarchical and networked file systems. But, may break down if stressed. Timesharing gives poor performance if too many users run compute-intensive jobs. Virtual memory breaks down if working set is too large (thrashing), or if there are too many large processes (machine runs out of swap space). Abstractions often fail for performance reasons.
The significance of resource abstraction can be illustrated in this example: Suppose a programmer is writing an application to analyze stock market trends. For this programmer, the effort to design and debug code to read and write information to/from a disk drive would represent a significant fraction of the overall effort. The skill and experience required to write the software to control the disk drive are not the same as that to design the stock analysis portion of the program. While an application programmer must be aware of the general behavior of a disk drive, it is generally preferable to avoid learning the details of methods how disk input/output takes place. Abstraction is the perfect approach, since the application programmer uses a previously implemented abstraction to read and write the disk drive. A disk software package is an example of system software. Programmers can focus their attention on the application programming problem rather than diverting it to tasks not specific to the application domain. In other words, system software is generally transparent to the end user but is of major significance to the programmer. Resource abstraction provides an abstract model of the operation of hardware components and generalizes hardware behavior. It also limits the flexibility in which hardware can be manipulated. It also provides a more convenient working environment for applications, by hiding some of the details of the hardware, and allowing the applications to operate at a higher level of abstraction. For example, the operating system provides the abstraction of a file system, and applications don’t need to handle raw disk interfaces directly. Resource abstraction also provides isolation means that many applications can co-exist at the same time, using the same hardware devices, without falling over each other’s feet. One can view Operating Systems from two points of views: resource manager and extended machines. Form resource manager point of view operating systems manage the different parts of the system efficiently and from extended machines point of view operating systems provide a virtual machine to users that is more convenient to use. Modern operating systems generally have following three major goals. Operating systems generally accomplish these goals by running processes in low privilege and providing service calls that invoke the operating system kernel in highprivilege state.
4.1 To hide details of hardware by creating abstraction
An abstraction is software that hides lower level details and provides a set of higher-level functions. An operating system transforms the physical world of devices, instructions, memory, and time into virtual world that is the result of abstractions built by the operating system. There are several reasons for abstraction. First, the code needed to control peripheral devices is not standardized. Operating systems provide subroutines called device drivers that perform operations on behalf of programs, for example, input/output operations. Second, the operating system introduces new functions as it abstracts the hardware. For instance, operating system introduces the file abstraction so that programs do not have to deal with disks. Third, the operating system transforms the computer hardware into multiple virtual computers, each belonging to a different program. Each program that is running is called a process. Each process views the hardware through the lens of abstraction. Fourth, the operating system can enforce security through abstraction. 4.2 To allocate resources to processes (Manage resources)
An operating system controls how processes (the active agents) may access resources (passive entities).
4.3 Provide a pleasant and effective user interface The user interacts with the operating systems through the user interface and usually interested in the “look and feel” of the operating system. The most important components of the user interface are the command interpreter, the file system, online help, and application integration. The recent trend has been toward increasingly integrated graphical user interfaces that encompass the activities of multiple processes on networks of computers. 5. Limitations Resource abstraction has few limitations also. While making the hardware easier to use, resource abstraction also limits the specific level of control over the hardware by hiding some functionality behind the abstraction. Since most application programmers do not need such a high level of control, the abstraction provided by the operating system is generally very useful.
Abstractions also fail because they prevent programmer from controlling machine at desired level. Example: database systems often want to control movement of information between disk and physical memory, and the paging system can get in the way. More recently, existing OS schedulers fail to adequately support multimedia and parallel processing needs, causing poor performance. Abstractions often work well - for example, timesharing, virtual memory and hierarchical and networked file systems. But, may break down if stressed. Timesharing gives poor performance if too many users run compute-intensive jobs. Virtual memory breaks down if working set is too large (thrashing), or if there are too many large processes (machine runs out of swap space). Abstractions often fail for performance reasons.
No comments:
Post a Comment