Addressing Process control information Process Control Block Entry pon to program Branch togram Instruction Increasing address valules Reference to data The processor and os must be ata able to translate the memory references found in the code of current top f stack the program into actual physical Stack memory addresses(to be discussed
6 Addressing The processor and OS must be able to translate the memory references found in the code of the program into actual physical memory addresses (to be discussed)
Requirements: Protection Processes should not be able to reference memory locations in another process Without permission Impossible to check absolute addresses at compile time Must be checked at run time
7 Requirements: Protection • Processes should not be able to reference memory locations in another process without permission • Impossible to check absolute addresses at compile time • Must be checked at run time
Requirements: Sharing Allow several processes to access the same portion of memory Better to allow each process executing the same program access to the same copy of the program rather than have their own separate copy Processes that are cooperating on some task may need to share access to the same data structure
8 Requirements: Sharing • Allow several processes to access the same portion of memory – Better to allow each process executing the same program access to the same copy of the program rather than have their own separate copy – Processes that are cooperating on some task may need to share access to the same data structure
Requirements Logical Organization Memory is organized linearly (usually) n contrast, programs are organized into modules Modules can be written and compiled independentl Different degrees of protection can be given to different modules(read-only, execute-only) Modules can be shared among processes Segmentation helps here
9 Requirements: Logical Organization • Memory is organized linearly (usually) • In contrast, programs are organized into modules – Modules can be written and compiled independently – Different degrees of protection can be given to different modules (read-only, execute-only) – Modules can be shared among processes • Segmentation helps here
Requirements: Physical Organization Cannot leave the programmer with the responsibility to manage memory Memory available for a program plus its data may be insufficient Programmer does not know how much space will be available The task of moving information between the two levels of memory should be a system responsibility 10
10 Requirements: Physical Organization • Cannot leave the programmer with the responsibility to manage memory – Memory available for a program plus its data may be insufficient – Programmer does not know how much space will be available • The task of moving information between the two levels of memory should be a system responsibility