CSc 330 - OOD & Systems Programming - Prof Domanski

History Handout

Types of System Programs

Ÿ Compilers - translate from a high-level language to machine language

Ÿ Loaders - prepare machine language programs for execution

Ÿ Macro Processors - allow for abbreviations for sets of instructions

Ÿ Assemblers - translates from a low-level language (e.g. assembly language) to machine language

 

Self-Modifying Programs

Ÿ programs that contain instructions that change instructions (rather than data) while they are running

Ÿ if it's a subroutine, it will execute a different set of instructions the second time it's called as compared with the first time

Ÿ this is impure as compared with a re-entrant program (which is exactly the same each time it is called including any data constants that may be defined in it)

 

Assemblers

Ÿ designed to eliminate the need for programmers to use switches to enter a program into a computer

Ÿ assemblers and the language they translate make it easier to code and maintain programs

Ÿ two outputs are created: a listing which contains both source statements as well as object code, and an object program that contains the actual machine language program

 

Loaders

Ÿ places an object program (or programs) into memory in an executable form

Ÿ an assembler could do this memory placement after all the object code is generated, transfer control to it, and then regain control after the program runs.

Ÿ this would make the assembler necessary each time the program were to run - a waste!

 

Simple Loading Scheme

Ÿ object programs are placed onto secondary storage

Ÿ the loader is first put into core memory,

Ÿ it then extracts the object program(s) from secondary storage, finds room in core memory, and loads the object program into available core memory

Ÿ control is transferred from the loader to the object program

Ÿ loaders are much smaller than assemblers, so this frees more memory at execution time

 

Subprogram Structure

2 types: open (macros) vs. closed (subroutines)

Open: source code is inserted into the source program and assembled (or compiled if its a high-level language).

Closed: control is passed from a calling program to a subroutine at execution time

Symbolic vs Absolute referencing: programmers want to use symbols to reference storage locations (symbolic addressing). That way, instructions that reference locations by symbols don't have to worry about the actual locations assigned to the program. Absolute addressing forces locations to be referenced by their exact address ... the computer cannot move the program to a different set of memory locations without the program being seriously upset!

 

Relocation - adjusting programs so that they can be placed in arbitrary locations in memory

Relocation Loader

Ÿ allocation

Ÿ Linking or Binding - resolving symbolic references between object programs

Ÿ Relocation - adjusting address dependent locations like address constants so that they correspond to the actual allocated space

Ÿ Loading - place programs and data into memory

 

Macros - relieve programmers of the need to repeat identical parts of a program

Ÿ allows the use of abbreviations for sets of instructions

Ÿ a macro processor saves & processes macro definitions

Ÿ before assembly time, the macro processor substitutes the saved definition for each macro call used in a program

 

Compilers

Ÿ originally designed for used in scientific (FORTRAN) and business (COBOL) applications

Ÿ translate high-level languages to machine language (object code)

Ÿ an interpreter translates each line of a source program to machine language as it is processed, executes that line, then goes on to the next line ... if a line in a source program is repeated (as in a loop), an interpreter must re-translate the line to machine language

Ÿ a compiler translates every line at one time to machine language first, then the object program is executed

 

Operating Systems

Ÿ the earliest systems:

Ÿ load FORTRAN compiler card deck,

Ÿ run FORTRAN on user source program; punch object deck

Ÿ load LOADER card deck

Ÿ run LOADER on object deck(s)

Ÿ transfer control to user program, read data if necessary

Ÿ this wastes time processing the compiler and loader card decks

Ÿ Batch System places many jobs in the reader at once, and the compiler and loader are retrieved from secondary storage (e.g. disk or drum)

Ÿ Primary Function - to manage critical resources: CPU, memory, and I/O

 

Ÿ Multiprogramming - more than one program is resident in memory at any instant

Ÿ Multiprocessing - more than one program is executing at any instant; >1 CPU

Ÿ Fragmentation - holes in core memory from odd program sizes

Ÿ Paging

Ÿ program is divided into equal size segments called pages (4K)

Ÿ core memory is divided into equal size blocks (4K)

Ÿ pages are loaded into memory blocks

Ÿ Simple Paging - all pages are loaded into core before execution

Ÿ Demand Paging - pages are fetched from secondary storage during execution as they are referenced

Ÿ Scheduler - allocates processor time

Ÿ Virtual Memory - more addresses can be generated than there are actual core storage locations

Ÿ gives the illusion of having a large real memory space

 

Operating System Functions

Ÿ job sequencing, scheduling, traffic control

Ÿ I/O programming and file system management

Ÿ protection (so that one program can't modify another program accidentally)

Ÿ Storage management

Ÿ Error processing and recovery


Last Updated on 02.04.2003