Multiple problems without abstraction |BM360 a Memory divided into 2-KB blocks and each one with a 4-bit protection key a PSW also has a 4-bit protection key a Hardware will trap any attempt tries to access memory with a protection code different from PSW key
Multiple problems without abstraction ◼ IBM 360 ❑ Memory divided into 2-KB blocks and each one with a 4-bit protection key ❑ PSW also has a 4-bit protection key ❑ Hardware will trap any attempt tries to access memory with a protection code different from PSW key
Multiple Programs Without Memory Abstraction Drawback CMP 16412 16408 16400 16396 16388 JMP2816384 16380 16380 16380 MOV MOV 20 20 12 MP240 JMP 280 JMP240 Figure 3-2. Illustration of the relocation problem Tanenbaum, Modern Operating Systems 3 e, (c)2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Figure 3-2. Illustration of the relocation problem. Multiple Programs Without Memory Abstraction: Drawback Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Drawback of no abstraction Problem is that both programs reference absolute pnysical memory People hope that they can have a private space, that is addresses local to it BM360 a Modify the second program on the fly as it loaded it into memory a static re|ocatⅰon When a program is loaded into 16384, then the constant is added to every address Slow down loading needs extra information No abstraction memory still used in embedded and smart systems
Drawback of no abstraction ◼ Problem is that both programs reference absolute physical memory ◼ People hope that they can have a private space, that is, addresses local to it ◼ IBM 360 ❑ Modify the second program on the fly as it loaded it into memory ❑ Static relocation ◼ When a program is loaded into 16384, then the constant is added to every address ◼ Slow down loading, needs extra information ◼ No abstraction memory still used in embedded and smart systems
Abstraction: address space a Not to expose physical address to programmers o Crash OS 口 Hard to parallelize Two problems to solve a Protection a Relocation Address space aa set of memory processes can use to address memory a Each process has its own address space, independent of each other How?
Abstraction: address space ◼ Not to expose physical address to programmers ❑ Crash OS ❑ Hard to parallelize ◼ Two problems to solve: ❑ Protection ❑ Relocation ◼ Address space: ❑ A set of memory processes can use to address memory ❑ Each process has its own address space, independent of each other ❑ How?
D ynamic relocation Equip CPU with two special register: base and limit a Program be loaded into a consecutive space a No relocation during loading a When process is run and reference an address CPU automatically adds the base to that address as well as check whether it exceeds the limit register
Dynamic relocation ◼ Equip CPU with two special register: base and limit ❑ Program be loaded into a consecutive space ❑ No relocation during loading ❑ When process is run and reference an address, CPU automatically adds the base to that address; as well as check whether it exceeds the limit register