detailed information on the switc h subsystem and programmatic access through switc h stubs, refer to Switch Programming Guide (32650-90014).

Virtual Memory and Demand Paging

When a program is running, only part of it is needed at an y one time. To save space in main memory, MPE/iX brings pieces of a program in, as needed for curren t execution. It divides a program into ￿xed-length pieces called pages (for a description of pages, refer to Chapter 1).

The remainder of the program can be stored on a high-speed device (for example, a disc) that can act as an extension of real memory . This extension is called virtual memory . The use of virtual memory reduces to a minim um the problem of application program size compared to available memory size, because it eliminates the requiremen t for loading all code and data in to main memory at once.

LMAP: Load MAP

An LMAP facilitates code managemen t by listing a loaded program. It describes the spaces loaded for a process and the link ages used to connect the external references of the process for the program and eac h library speci￿ed b y the user. To produce a load map (map of a loaded program), specify the LMAP parameter of the :RUN command. To print an LMAP, use :FILE to de￿ne the ￿le with the formal ￿le designator LOADLIST as a line printer device ￿le. For detailed information refer to the MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364). A load map can also help to determine if y ou have achieved good localization. An LMAP shows:

File name and type of ￿le (program or library)

Number of external references a program ￿le mak es Type of library from whic h each call is resolv ed

Load-time Binding Sequence

The loader assigns virtual addresses and mak es an executable program ￿le in to a runnable process.

Running a Program

When a program has been successfully link ed, you can load it and execute the :RUN command. At this stage of operation, the program is called a process. A process is a unique execution of

a particular program b y a particular user at a particular time. If y ou change even one element of a program, it becomes a di￿eren t process than it w as before.

When you execute a program, a piece of softw are called the LOADER starts the process on the system. The loader m ust resolve any external references in the program b y using executable libraries.

MPE/iX is a m ultiprogramming operating system, whic h has many processes competing for CPU time. Only one process can execute at a giv en instant in time. When a program has had external references resolv ed it is ready to execute. It can no w compete with other processes for the resources of main memory and CPU time.

The :RUN command requires y ou to specify the ￿lename of the program and allows y ou to specify many other options, suc h as obtaining a program load map. Y ou can specify values for process stack and heap size to o verride values speci￿ed at the link stage. There are facilities

3-16 Program Development