Operating Systems

================ Start Lecture #7 ================

Remark: Lab 3 (banker) is on the web. It is due in 2 nyu weeks (3 calendar weeks) 21 march 2007. Note: I will place ** before each memory management scheme.

4.1: Basic Memory Management (Without Swapping or Paging)

Entire process remains in memory from start to finish and does not move.

The sum of the memory requirements of all jobs in the system cannot exceed the size of physical memory.

** 4.1.1: Monoprogramming without swapping or paging (Single User)

The “good old days” when everything was easy.

**4.1.2: Multiprogramming with fixed partitions

Two goals of multiprogramming are to improve CPU utilization, by overlapping CPU and I/O, and to permit short jobs to finish quickly.

4.1.3: Modeling Multiprogramming (crudely)

Homework: 1, 2 (typo in book; figure 4.21 seems irrelevant).

4.1.4: Analysis of Multiprogramming System Performance

Skipped

4.1.5: Relocation and Protection

Relocation was discussed as part of linker lab and at the beginning of this chapter. When done dynamically, a simple method is to have a base register whose value is added to every address by the hardware.

Similarly a limit register is checked by the hardware to be sure that the address (before the base register is added) is not bigger than the size of the program.

The base and limit register are set by the OS when the job starts.

4.2: Swapping

Moving the entire processes between disk and memory is called swapping.

Multiprogramming with Variable Partitions

Both the number and size of the partitions change with time.

Homework: 3

MVT Introduces the “Placement Question”

That is, which hole (partition) should one choose?

Homework: 5.

4.2.1: Memory Management with Bitmaps

Divide memory into blocks and associate a bit with each block, used to indicate if the corresponding block is free or allocated. To find a chunk of size N blocks need to find N consecutive bits indicating a free block.

The only design question is how much memory does one bit represent.

4.2.2: Memory Management with Linked Lists

Memory Management using Boundary Tags

MVT also introduces the “Replacement Question”

That is, which victim should we swap out? Note that this is an example of the suspend arc mentioned in process scheduling.

We will study this question more when we discuss demand paging in which case we swap out part of a process.

Considerations in choosing a victim