Exercise 3 - Multiple DOS Sessions

This exercise demonstrates how an OS/2 protected mode program may start a DOS program in a virtual DOS machine. Furthermore, the growth of the swap file is shown, as well as the decrease in the size of the swap file after termination of the OS/2 program.

The program used in this exercise makes use of the DosStartSession() function.

In this exercise, the student is required to run the memory lab program:

      MEMLAB3.EXE

Syntax: MEMLAB3 <no. of DOS sessions>

The steps in the program are as follows:

  • If a parameter is passed to the program, it will use this as the number of DOS sessions to start. If no parameter is provided, four DOS sessions are started.

  • The program reads a file named: MEMLAB3.PRO.

    A sample MEMLAB3.PRO is shown in Sample Input File for MEMLAB3.EXE.

    The file must be created using an ASCII editor such as the OS/2 V2.0 System Editor and consists of three lines as follows: