13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Preliminaries 631.6 Initial loading and executionWhen a process starts, its virtual space is initialized by the storage manager. The storagemanager can figure out what to put in the virtual space of a process in two ways: bycopying the virtual space of another process, which we will call splitting, or by reading afile that describes the initial virtual space, which we will call loading. We describe thesemethods in more detail in Chapter 9. Splitting might copy the entire virtual space or, ifsharing is possible, might allow parts of the virtual space to be shared. The exact meaningis part of the design of the particular operating system. The Dynix operating systemfor the Sequent Balance multicomputer, for example, distinguishes between private andshared data regions in virtual store. A new copy is created for the private region, but notfor the shared region.The file used for loading is called a load image. It contains the instructions andinitialized data of the program and may also indicate how much space is needed for uninitializeddata. It also tells where the program starts, that is, the initial value for the programcounter. This information must be packaged in a form understood by the storagemanager. A load image is prepared by a program called a linker, which combines theoutput of one or more compilation steps and searches libraries if necessary to find missingroutines the compiled program needs. Bringing the load image from a file into mainstore to start execution is performed by the loader, which is either a separate program orpart of the storage manager.The format of a link module is designed at the same time as the operating system.It generally includes the following information.A header that indicates that the file is a link module. Different kinds of linkmodules can have different headers. For example, the header can indicate thatsome debugging sections are missing.A list of sizes for the various parts of the module. This entry lets the storagemanager decide how much room to allocate.The starting address. The load-image format for Tops-10 also includes both a restartaddress and a debugger start address.The machine instructions that constitute the program.Data areas initialized with their first values.Size indications for uninitialized data regions. The loader can clear these regionsto prevent the new process from discovering secrets in the space vacated by theprevious user of main store.Relocation information that allows the loader to adjust instructions and data towork at the locations where they will be placed. Some operating systems avoidthis section by using appropriate virtual store techniques, described later in thischapter.A symbol table to be used during interactive debugging. It associates locations inthe data and instruction regions with labels.A cross-reference table to be used during interactive debugging. This table associateslocations in the instruction region with lines in source files.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!