OS2 LANs, Part One

team lib

OS/2 LANs, Part One

[Editor's note: Though OS/2 is not much of a factor in year-2003 networks, the technology that once made it unique is still important to grasp.]

OS/2, the operating system from IBM, is special for several reasons. The operating system has several features that improve networking significantly. These features are not necessarily uniqueother operating systems such as Unix and VMS also have thembut OS/2 was the first PC operating system to include them. The most relevant features of OS/2 are multitasking and interprocess communications.

With these two features, OS/2 provides a much better platform upon which to build powerful multiuser, distributed applicationsthe kind that run on networksthan DOS. These network-intrinsic applications take advantage of the network to provide services and performance simply unavailable under DOS. For example, a distributed database, which allows a user to pull data from two different machines and combine it into one report, is a network-intrinsic application. It must run on a network. While it is conceivable to build such an application using DOS-based machines, the amount of work necessary is significantly greater and the performance is significantly lower.

OS/2 provides a better platform upon which to build these applications because of its Application Programming Interfaces (APIs), particularly for multitasking and interprocess communications. These APIs provide services to applications that other PC operating systems can't match. Crucially, they provide the basic mechanisms by which geographically separate programs can exchange commands and information. That is, OS/2 APIs have networking in mind. This becomes even more the case when OS/2 is combined with an OS/2-based network operating system such as Microsoft's LAN Manager or IBM's LAN Server.

Virtual OS/2

Before delving into the intricacies of OS/2's multitasking and interprocess communication, we need to lay the foundations upon which they are built. The two most important pillars are OS/2's memory model and virtual device support.

OS/2 is a protected-mode operating system, which means it requires a microprocessor that uses protected mode, such as an 286, 386 or 486 chip, or one of IBM's new RISC-processor based PCs. Protected mode is best understood by comparing it to real mode. The 8086 and 8088 run in real mode. Under real mode, programs have direct access to a PC's hardware devices, including memory, disk drives , serial ports, keyboard, and screen. That means programs can bypass the operating system, in this case DOS, and do what they like with the hardware. For example, a word processing program may decide to send something to a printer port. It can take over that port and DOS can't stop it, even if the program is going to interfere with another program that is already using the port.

Multitasking is impossible under real mode because there is no way to keep programs from interfering with each other as they use the PC's various components . The most acute form of this occurs when programs overwrite each other in memory. For example, a database program may use extra memory for sorting a database. In real mode, there is nothing to prevent another program, say, a spreadsheet, using this memory for a recalculation. When both programs try to put data in the same place, whichever program gets there first loses, since the second program writes over the data of the first. If the second program writes over some of the executing code of the first program, then not only is data corrupted, but the computer may hang since it can't continue with the first program.

Under protected mode, programs generally do not have direct access to the PC's hardware devices. The devices are protected from application programs, which is where the name "protected" comes from. But because they don't have direct access to devices, programs need some method to use them. That's where OS/2 comes in. OS/2 sits between the programs and the hardware, regulating access to the latter. OS/2's intermediary position between programs and hardware forms the basis of multitasking, which is the ability to run several programs at the same time.

How does OS/2 give programs access to hardware while keeping them from colliding with each other? The answer is twofold: virtual memory and virtual devices. Actually, virtual memory is a special case of a virtual device, but memory is so crucial to the workings of a computer it deserves special attention.

Virtual memory works as follows : Virtual memory introduces an additional step in a program's access to memory. Instead of simply asking for a physical memory address, as it does under DOS, programs ask for a virtual memory address. OS/2 then converts that virtual address into a physical address. This process is called mapping. In this way, OS/2 keeps track of where everything is, preventing one program from taking the memory of another by preventing it from directly accessing memory in the first place.

In addition, because OS/2 is handling their placement, program data and code need not always reside in memory. OS/2 may map a virtual address to a hard disk. It may decide it is better to put a piece of program code or data onto the hard disk rather than in memory. The program using the code or data still asks for the same virtual address. OS/2 just fills the request from another place. This process is called segment swapping.

OS/2 uses segment swapping when not enough RAM is available. OS/2 divides memory into 64KB chunks called segments. If there isn't room for a program to load completely, segments of program already in memory may be swapped to disk to make room for the new program. When the swapped-out data is needed, OS/2 swaps it back in and swaps another program out. The result is the amount of memory available is no longer equivalent to the amount of physical memory. Original versions of OS/2 use up to 48MB of memory, either on disk or in RAM, which is about 50 times the limit of DOS.

OS/2 handles devices similarly. Instead of directly accessing physical devices like parallel ports and video screens, programs are presented with virtual ports and screens. Applications write to or read from these virtual devices and OS/2 takes or sends the data. Each device has the appearance of its own keyboard, screen, and printer, but OS/2 is really just presenting each program with a virtual device, which it then maps to the real device as necessary.

OS/2's virtual memory and device management make it possible to run many programs at the same time. Key roadblocks of DOS are eliminated. Programs can use more memory, and they can no longer interfere with each other. But not only are virtual memory and device management the basis for multitasking, they are the basis for multiuser operation.

OS/2 Multitasking

No PC can actually do two things simultaneously , because a single processor can only perform one operation at a time. Processors can, however, do things so quickly the user thinks the processor is doing many things at once. And since they are doing things so quickly, processors often sit around and do nothing. Multitasking takes advantage of this idle time.

Suppose you are typing a letter using a word processing program like WordPerfect. The computer captures the letters you type and puts them on the screen. The time it takes to do this is a fraction of the time it takes for you to type the letter. Therefore, the computer is spending most of its time waiting for your next keystroke. But suppose it could do something else while waiting?

This is exactly what a PC running OS/2 does. The computer's idle time can be used by other tasks . While you are typing, the computer may download a file from another computer, recalculate a spreadsheet, sort a database, or draw a graph. To accomplish all these things at once, OS/2 divides the computer's time up into pieces called time slices. These last no longer than a fraction of a second. For one time slice, the computer works on the letter you are typing. During the next time slice, it stops working on your word processing and starts downloading a file that you requested . Then this task is suspended while the spreadsheet recalculation takes place. Thus it goes, around and around from one task to the next. Of course, the time slices are so small that you don't notice the machine is working on other things while you are typing.

The results are manifold . The ability to allocate a computer's time increases its efficiency, which in turn increases the user's productivity because time is not wasted moving among applications. Multitasking can also make multiuser operation possible. Because the operating system is automatically multitasking, less work is needed to make it do many things at once for many people. It is better able to handle many simultaneous requests from many users.

Multiuser OS/2

Multiuser operation does not, strictly speaking, require multitasking, however. A computer could work for many people one at a time. When one is finished working, the next could start, and so on. Obviously, this process is not what users expect of a computer system.

True multiuser operation requires the ability to accept input from numerous sources and redirect various output to multiple devices. Neither DOS nor OS/2 can do this alone. (DOS is single-user and single-tasking; OS/2 is multitasking but single-user; Unix is both multitasking and multiuser.) However, with the help of a network operating system, any of the three can provide services for multiple users. The difference is in the types of service they provide.

On a DOS-based PC network, the network operating system handles the multiple users for DOS. As the requests come in from the users, the network operating system feeds them to DOS one at a time. DOS then fulfills the requests. Then the network operating system ensures that the answers are returned to the users. There are limitations, however, to the type of requests DOS can fulfill. DOS can only do the simple input/output tasks for multiple people, such as reads and writes to a hard disk. It can't handle multiple programs in memory.

OS/2, on the other hand, allows users also to share processors, which is the basis for network-intrinsic applications. This is accomplished through multitasking, redirection, and interprocess communication.

OS/2 is multitasking. A way to assign different tasks to different users is needed to make it multiuser. This way is virtual devices and network redirection. Network redirection, as provided by a network operating system, tricks OS/2 into thinking it is mapping a virtual device to a local physical device, when in reality it is mapping that device to a remote physical device. For example, during one of its time slices, OS/2 can draw a graph for a remote user. The network operating system redirects the output from the OS/2 virtual screen over the network to the remote user's physical screen. In another time slice, OS/2 can accept keystrokes from another user, mapping them to a virtual keyboard. In this way, virtual devices and multitasking help OS/2 provide the basis for multiuser operation. But the network operating system is necessary to complete the multiuser picture.

The result is that OS/2 allows multiuser operation. It allows multiple users to share a processor whereas DOS only allows multiple users to share peripheral devices. This is extremely important for networking. It is OS/2's multitasking abilities and its support for virtual devices that make it such a good foundation for network-intrinsic applications.

This tutorial, number 14, by Aaron Brenner, was originally published in the September 1989 issue of LAN Magazine/Network Magazine.

 
team lib


Network Tutorial
Lan Tutorial With Glossary of Terms: A Complete Introduction to Local Area Networks (Lan Networking Library)
ISBN: 0879303794
EAN: 2147483647
Year: 2003
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net