OS/2 is a very complex advanced operating system. Many of the original ideasdeveloped in the early versions of OS/2 are still being used bymore popular operatingsystems today. This paper presents an overview of some of the common techniques usedby the operating system and a brief history of the operating system.

OS/2 Command Language (Shell Script)

Using OS/2 without the Workplace Shell

To use OS/2 without loading the Workplace Shell, replace the following line in yourCONFIG.SYS

SET RUNWORKPLACE=<drive>:\OS2\PMSHELL.EXE

with

SET RUNWORKPLACE=<drive>:\OS2\CMD.EXE

where <drive> is the letter of the drive on which OS/2 is located.

Notethat you can always invoke the Workplace Shell by typing PMSHELL at an OS/2command line. It can consequently be removed by closing it from the Window List.

Booting OS/2 in full-screen mode

You can boot OS/2 in full-screen mode, and still retain Presentation Manager support formultiple sessions:

1.

Change:

SET RUNWORKPLACE=<drive>:\OS2\PMSHELL.EXE

in your CONFIG.SYS file to:

SET RUNWORKPLACE=<drive>:\OS2\CMD.EXE /FS

where <drive> is the drive on which OS/2 resides.

2.

Create the file STARTUP.CMD in your OS/2 boot drive's root directory.STARTUP.CMD should contain the following lines:

@ECHO OFF

START /FS

EXIT

Viewing *.inf files more conveniently

There are two tips to make viewing OS/2*.inf

files more convenient:

1.

Put several INF files together using a plus sign. On the command line (or'Parameters' field of the settings notebook), enter something such as:

The pathnames aren't necessary if the file is in a directory specified by the HELPenvironmental variable.

2.

You can assign the book names to an environmental variable:

e.g., SET FILE=<drive>:\BOOKS\FILE1.INF+<drive>:\BOOKS\FILE2.INF+<drive>:\BOOKS\FILE3.INF

and execute VIEW.EXE using the variable name (e.g., VIEW FILE).

Disabling use of the floppy drives

To prevent users from using the floppy drives under OS/2, such as in a workstationsituation:

Remove the following line from your CONFIG.SYS:

BASEDEV=IBMxFLPY.ADD

Where x is 1 for ISA and EISA, or 2

for Microchannel.

Rebooting from the command line

To reboot OS/2 down from the command line, type

SETBOOT /B

Note: the above only works with Boot Manager installed.

or

SETBOOT /IBD:<drive>

where <drive> is the letter of the drive or partition to which you wish to boot

Graphical User Interface

OS/2was originally written for the 286. The 286 had introduced what Intel called"protected" memory and the ability to write programs beyond the 640K barriers, but itdid so in a way that sometimes made itincompatible with existing 8088/8086 basedsoftware. IBM realized the problems inherent in the real-mode DOS architecture andworked on solutions throughout early and mid-80's. The first version of OS/2 wasreleased in late 1987. From some angles OS/2 strongly resembled DOS and from othersit didn't look like DOS at all. The command line interface of OS/2 1.0 looked a lot likeDOS. OS/2 1.0 was indeed a radical departure from DOS and had a number of importantfeatures that DOS could never have-

OS/2 Warp 4.0 (codename "Merlin") was released in August, 1996. Its new featuresincluded a "beautified" GUI; an ex-Apple programmer designed the new graphical iconsand “widgets”. The beauty was much more than skin deep, however. Also included wereOpenGL support, OpenDoc support, and a full Java Development Kit, which included aJava Virtual Machine, which allows Java applications to be run independent of a browser.For high-end systems, the included VoiceType Dictation system allowed users tonavigate their computer and dictate text to their computer without ever touching akeyboard or mouse. OS/2 Warp 4 is fully Object Oriented via SOM and the base conceptof Object Orientness is that everything is built on the same code. This means that all ofthe objects resemble the way the other objects function too. In OS/2 this also translatesinto drag and drop. OS/2 Warp 4 is faster than WinNT, more stable than Win95, easier touse than both WinNT and Win95, it is safeproven

technology, it runs practically all ofyour DOS and Windows 3.1 programs, including most games, and it is based on the bestopen (i.e.: non-proprietary) standards and some not found out-of-the-box in any otherOperating Systems yet (VoiceType, Java Virtual Machine, OpenDOC, OpenGL, MPEG,QuickTime and SOM). OS/2 also pre-emptively multitasks all sessions (includingDOS/Win), and is also one of the best multitasker in general. It can take quite a high loadwithout slowing down.

Detailed structure of Process Control Block



Portability: run not just on Intel machines but on a variety

of hardware platforms



Layered approach:

o

HAL: maps between generic hardware commands andresponses and thoseunique to a specific platform. It isolates the OS from platform specifichardware differences.

o

Microkernel: consists of the most used and most fundamental componentsof the OS. The kernel manages thread scheduling, process switching,exception and interrupt handling, and multiprocessor synchronization.

Client/server model: the Executive, the subsystems and the applications arestructured using this model.

o

Each environment subsystem and executive servicesubsystem isimplemented as one or more processes.

o

Each process waits for a request from a client for one of its services.Clients, which can be an application program or another OS module,request a service by sending a message.

o

The message is routed through the Executive to the appropriate server.The server performs the requested operation and returns the results orstatus information by means of another message, which is routed back tothe client.



Threads and SMP:

o

OS routines can run on any available processor, and different routines canexecute simultaneously on different processors.

o

W2k supports the use of multiple threads execution within a singleprocess. Multiple threads within the same process may execute ondifferent processors simultaneously.

o

Server processes may use multiple threads to process requests from morethan one client simultaneously.

o

Mechanisms for sharing data and resources between processes.



Object-oriented design: facilitates the sharing of resources and data amongprocesses and the protection of resources from unauthorized access.

Hardware Platform

OS/2 is a hybrid system containing internal components that run in both 16-bit and 32-bitmodes. Applications can run in either mode. Requests are translated between 16 and 32bit forms as needed.

A native OS/2 program runs without privileges in its own address space. It requestsservices by calling routines supplied in DLL modules. System and I/O requests arepassed to the kernel and device drivers,while database and communication requests areoften passed through a "pipe" to other programs running in the background.

A program written to run in the 32-bit mode of OS/2 will be portable to the PowerPC,where the operating system will supply a set of DLL's that duplicate OS/2 services. Evenso, there are relatively few programs written as native OS/2 applications. A DOS orWindows program runs under OS/2 in a virtual machine. It requests services by makingstandard DOS or BIOS calls or by directly manipulating virtual devices. Loading VDDmodules during OS/2 initialization can extend the set of virtual devices. Some OS/2VDDs mediate between many users and a shared display, sound card, or print spool.

7

Some acquire exclusive use of a device and pass through all the DOS operations to thereal hardware. Some VDDs emulate no real hardware, but provide a conduit for DOSprogram requests to more complex database, communication, or file services supplied bythe external OS/2 system.

Synchronization Mechanisms

A semaphore is a flag variable that displays whether a resource is being used or not. Ifthe resource is being used by another process the semaphore alerts other processes thatthe resource is currently occupied. The two settings the semaphore has are wait andsignal. However, sometimes processes must wait for long periods of time. This occurswhen another process is in its critical section and cannot give control to another process.Another name for this phenomena is called spinlock.

In OS/2, thisproblem is fixed by having processes that are waiting block themselves.This allows the CPU scheduler to select another process instead of waiting whichincreases the overall efficiency of the computer system. After being blocked, a process iseventually

changed to the ready state and placed back in the CPU queue for anotherattempt at execution.

In OS/2 There are three main types of semaphores. Each type of semaphore has the samegeneral type of commands. These commands include creation, addition, deletion, open,release, reset and query. The three types of semaphores are called event, mutex, andmuxwait semaphores respectively. Event semaphores only contain links to a singlethread. Mutex semaphores are linked to multiple threads. Using mutex, several threadscan be given an order of execution. For example, a piece of code can be written to notallow a second thread to execute until the first thread is done executing. Muxwaitsemaphores are linked to several threads and are only releasedwhen the mutexsemaphores are no longer connected to threads. This is an attempt to preventdeadlocking by not allowing new semaphores to connect to threads until the originalthreads are done processing.

Scheduling

Scheduling on OS/2 allows for the seamless completion of multiple tasks. This is doneby switching the CPU to different processes when the current process is idle or waitingfor I/O or hardware. Whenever a process becomes idle, a new process is selected forexecution by the short term CPUscheduler. It is very interesting to note that OS/2 wasthe first operating system to provide any support for multitasking at all. The originaloperating system of OS/2 was 16 bit and a more recent version of OS/2 was the firstoperating system to support 32 bit.

OS/2 uses preemptive scheduling that is priority based to provide run time to the mostcritical thread. The threads are stored in a queue while waiting to be processed. If no

8

threads are ready in the queue, the idle process executes. The idle process typically runsanywhere from 80-99% of the time on most machines running the OS/2 operating system.

Threads have their priority changed based on the length of their wait and what they arewaiting for. An I/O wait would get a large priority boost while a CPU wait would get alower priority boost. Threads and processes involved in the current window selected bythe user also would receive a priority boost.

Deadlock

The potential for deadlock is directly related to the complexity of theoperating system.As more and more threads and semaphores are created, the possibility of deadlockincreases exponentially. Deadlock occurs in OS/2 whenever a thread is operating in itscritical section related to a kernel process. Because the thread is

in its critical process,resources are kept to keep the process running and since the thread is located in thekernel, the resource cannot be shared. This is because multiple copies of the kernelcannot be created since the kernel runs the operating system. Because of theseidiosyncrasies OS/2, like most other operating systems does nothing about deadlock.

Processor Support

OS/2 Warp provides support for both uniprocessor systems with the ability toupgrade for Symmetric Multiprocessor support. This upgrade creates an operatingsystem capable of running high-speed networks and able to use multiprocessormotherboards to run large servers.

Single-User, Multi-tasking, and Multithreading

OS/2 is a single-user operating system, able to run in text mode, DOS mode, andits GUI interface Presentation Manager (PM).

OS/2 is a step up from DOS, using pre-emptive multi-tasking to schedule CPUtime. DOS uses co-operative multi-tasking when switching back and forth betweenprograms that does not prevent programs from possibly hogging the CPU. Manyvarieties of OS/2 handle symmetric multi-processing (SMP) given multiple CPUs. OS/2was the first Personal Computer to provide intrinsic multi-tasking, originally designed forthe 286 Intel chips and passed on to

the 386’s and on. It is the multi-tasking successor toDOS.

Native applications can utilize multi-threading capability, but not legacyapplications from DOS or Windows 3.1 unless it is an internal feature to those programs.

9

Characteristics

OS/2 has interesting features that date from IBMs collaboration with Microsoft inthe beginning of its lifecycle.

When running DOS programs OS/2 allows for different AUTOEXEC.BAT filesto be set for different DOS windows open. It is then possible to run applications withcontradictory requirements and settings.

Lower end versions either require for Windows 3.1 to already be installed on thecomputer or it includes in itself a re-compiled version.

History of OS/2

Originally IBM and Microsoft workedtogether to produce OS/2 operating system. In1987, OS/2 version 1.0 was released for computer with 286 processor or better. It wasthe first operating system for the personal computer to provide intrinsic multitaskingbased on hardware support. Version

1.0 was text mode and allowed only one program tobe on the screen at a time, but also allowed other programs to be running in thebackground.

Version 1.1 was released in 1988. In this new version, the graphical user interface calledPresentation Manager (PM) was added, which was more user friendly. The GUI allowedusers to click on icons with their mouse instead of typing commands.

In 1989 version 1.2 was released. The system’s graphical user interface was significantlyimproved. After the release of version 1.2 two new versions were underway. One of thetwo was version 2.0 of OS/2 that IBM was producing. Version 2.0 was to be the first 32-bit operating system for the personal computers requiring 386 processor. Microsoft wasdeveloping the second version, which was version 3.0. This version was intended fornetwork server, allowing it to be platform independent due to the user of microkernel.

In 1990, IBM and Microsoft separated and worked independently in their own versions ofOS/2. In 1991, IBM released version 1.3 of OS/2. This version was smaller, faster, andmore stable than previous versions.

In 1992, OS/2 version 2.0 was released. It was the first 32 bit operating system forpersonal computers. This version used Virtual DOS Machines (VDMs) allowing OS/2 torun many DOS and Windows programs at the same time. Version 2.0 was also the firstoperating system to introduce Workplace Shell (WPS), an object oriented user interface(OOUI). OS/2 version 2.1 was released in 1993. This system introduced new 32-bitgraphics subsystems. Version 2.1 allowed more CD-ROM and SCSI drivers.

10

In 1995, OS/2 Warp 3.0 was released only requiring 4MB of RAM to run. Warp 3.0improved Workplace Shell in performance and functionality. It also added TCP/IP andInternet communications, which allowed peer-to-peer networking and access to networkservers.

In 1996, Warp 4.0 was released. The system introduced new features including Java,VoiceType Navigation and Dictation. IBM calls Warp 4.0 the “Universal Client”because of its unparalleled network connectivity.

Screen shot of OS/2 Warp 4

11

Screen Shot of OS/2 Warp 4

Today OS/2

Today, OS/2 is not common operating systems that are used in personal computer.However OS/2 is still consider one of the most high performance and high end operatingsystem. OS/2 are produced by IBM, which runs on Intel, Cyrix, AMD pentium, andIntel. The current version of OS/2 is version 4.51. The system requires 32 bits and costsaround $250. The warp for small to medium scale servers is supported by 80486 pentiumhardware.

Conclusion

OS/2 has a rich and vibrant history. Many of the original concepts of OS/2 are still beingused by many operating systems today. It is a shame that OS/2 has gone unnoticed by alarge segment of the computer-owning population.