[4.1 BASIC MEMORY MANAGEMENT]
when a program is linked (the main program, user-written procedures, and library procedures are combined into a single address space), the linker must know at what address the program will begin in memory. (fixed memory partition에서)
그래서 OS/MFT(Multiprogramming with a Fixed number of Tasks, IBM) 에서는 linker가 binary program에 list나 bitmap을 가지고 있었다. (여기에는 reload되어야 하는 것과, opcodes, constants와 같은 reload되지 않아야 할 것들을 구분하고 있다.)
=> protection 문제.
1. 그래서 IBM의 large mainframe인 OS/360은 메모리를 2-KB bytes로 나누고, 4-bit protection code를 각 block에 추가하였다. PSW(Program Status Word)가 4-bit key를 가지고 있고, 이것을 hardware trap으로 체크하였다. (OS만 key, code를 건드릴 수 있음)
2. hardware가 base/limit reg를 제공해도 된다. (user에서 이 레지스터들은 건드릴 수 없음.)
그런데 이 방법은 매 번 addition(base+offset)과 comparison(limit을 넘지 않는가?)을 해야하는 단점이 있다.
세계 최초의 supercomputer인 CDC 6600이 이 방법을 사용하였고, IBM PC에 사용된 Intel 8088 CPU는 base reg만 사용하였다.
[4.2 SWAPPING]
여러 프로그램이 실행되고 있는데 메모리가 모자랄 때에는, appoach는 두 가지가 있다. : swapping(프로그램 전체를 메모리에 올렸다가 다시 전체를 디스크에 back), virtual memory(프로그램이 일부만 올라와 있어도 실행이 가능하게 한다.).
memory compaction : 여러번 swapping으로 메모리에 여러 hole이 생기면 현재 올라와 있는 모든 process들을 최대한 아래로 다 옮긴다. 그런데 cpu time을 너무 많이 잡아먹어서 잘 사용 안한다.
fixed size memory allocation의 문제점 : heap등의 사용으로 process가 grow하면, 문제가 된다. 다른 process를 swap out 해야하는데, swap 디스크가 다 차던지 하면, process는 wait 하거나 kill해야한다. (이런 overhead를 방지하기 위해, extra memory를 조금 더 할당.)
when a program is linked (the main program, user-written procedures, and library procedures are combined into a single address space), the linker must know at what address the program will begin in memory. (fixed memory partition에서)
그래서 OS/MFT(Multiprogramming with a Fixed number of Tasks, IBM) 에서는 linker가 binary program에 list나 bitmap을 가지고 있었다. (여기에는 reload되어야 하는 것과, opcodes, constants와 같은 reload되지 않아야 할 것들을 구분하고 있다.)
=> protection 문제.
1. 그래서 IBM의 large mainframe인 OS/360은 메모리를 2-KB bytes로 나누고, 4-bit protection code를 각 block에 추가하였다. PSW(Program Status Word)가 4-bit key를 가지고 있고, 이것을 hardware trap으로 체크하였다. (OS만 key, code를 건드릴 수 있음)
2. hardware가 base/limit reg를 제공해도 된다. (user에서 이 레지스터들은 건드릴 수 없음.)
그런데 이 방법은 매 번 addition(base+offset)과 comparison(limit을 넘지 않는가?)을 해야하는 단점이 있다.
세계 최초의 supercomputer인 CDC 6600이 이 방법을 사용하였고, IBM PC에 사용된 Intel 8088 CPU는 base reg만 사용하였다.
[4.2 SWAPPING]
여러 프로그램이 실행되고 있는데 메모리가 모자랄 때에는, appoach는 두 가지가 있다. : swapping(프로그램 전체를 메모리에 올렸다가 다시 전체를 디스크에 back), virtual memory(프로그램이 일부만 올라와 있어도 실행이 가능하게 한다.).
memory compaction : 여러번 swapping으로 메모리에 여러 hole이 생기면 현재 올라와 있는 모든 process들을 최대한 아래로 다 옮긴다. 그런데 cpu time을 너무 많이 잡아먹어서 잘 사용 안한다.
fixed size memory allocation의 문제점 : heap등의 사용으로 process가 grow하면, 문제가 된다. 다른 process를 swap out 해야하는데, swap 디스크가 다 차던지 하면, process는 wait 하거나 kill해야한다. (이런 overhead를 방지하기 위해, extra memory를 조금 더 할당.)