-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathNoMemoryAbstract.html
215 lines (201 loc) · 7.44 KB
/
NoMemoryAbstract.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css"/>
<title>
No Memory Abstraction
</title>
</head>
<body>
<div id="header">
<div id="logo">
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/IBM_PPC604e_200.jpg/220px-IBM_PPC604e_200.jpg"
height="56" width="56"
max-height=100%>
</div>
<div id="user-tools">
<a href="index.html">Home</a>
<a href="about.html">About</a>
</div>
</div>
<h1>
No Memory Abstraction
</h1>
<div style="text-align:center">
<p>
<img
src="graphics/MemChip.png"
height="200" width="320">
</p>
</div>
<details>
<summary class="sum1">
History
</summary>
<p>
<b>The simplest memory abstraction is no abstraction at all.</b>
</p>
<ul>
<li>
Early computers did not have any memory
abstraction at all, which means all
programs had direct access to physical memory.
</li>
<li>
This means we could not have 2 programs running
in main memory at once,
as this would cause inconsistency in data.
</li>
<li>
Processes could erase each others' written output/input
and cause severe inconsistencies.
</li>
</ul>
</details>
<details>
<summary class="sum1">
Multiprogramming without memory abstraction
</summary>
<ul>
<li>
It is possible to run multiple programs
without having memory abstraction.
</li>
<li>
The idea is to have just one running process in main
memory at any point of time.
</li>
<li>
Whenever a process leaves main memory, all of its current
state and values are copied
out of main memory and another process
is brought onto main memory.
</li>
<li>
Whenever the process returns to main memory,
all of the saved contents are brought back to main memory.
</li>
</ul>
</details>
<details>
<summary class="sum1">
Multiprogramming without memory abstraction or swapping
</summary>
<ul>
<li>
With addition of special hardware, it is possible to
run multiprogramming without swapping.
</li>
<li>
Early models of IBM 360 followed this approach:
<ul>
<li>
Memory was divided into 2 KB blocks and each
block was assigned a 4-bit protetion key
held in special registers inside the CPU.
</li>
<li>
A machine with 1 MB memory needed only 512 of
these 4 bit registers for a total
of 256 bytes of key storage.
</li>
<li>
The PSW (Program Status Word) also contained a 4-bit key.
</li>
<li>
The 360 hardware trapped any attempt by a running
process to access memory
with a protection code from the PSW key.
</li>
<li>
Only the OS is permitted to change
the protection keys, hence,
user processes could not interfere with one another
and also with the OS process.
</li>
</ul>
</li>
</ul>
</details>
<details>
<summary class="sum1">
Quiz
</summary>
<ol>
<li>
The main problem with having two programs in memory without memory abstraction is
</li>
<ol type="a">
<li>
<input type="radio" name="q1" value="new">
it is difficult to determine the name of each program
</li>
<li>
<input type="radio" name="q1" value="new">
each program will have different ideas about what the CPU should be doing
</li>
<li>
<input type="radio" name="q1" value="new">
each program can overwrite the memory of the other
</li>
<li>
<input type="radio" name="q1" value="new">
none of the above
</li>
</ol>
<li>
Without memory abstraction we can still have multiprogramming
</li>
<ol type="a">
<li>
<input type="radio" name="q2" value="new">
by only running one program at a time and completely swapping each successive program in and out of memory
</li>
<li>
<input type="radio" name="q2" value="new">
by using VT
</li>
<li>
<input type="radio" name="q2" value="new">
by taking advantage of an MMU
</li>
<li>
<input type="radio" name="q2" value="new">
with paging
</li>
</ol>
<li>
Even without swapping or memory abstraction we can multiprogram
</li>
<ol type="a">
<li>
<input type="radio" name="q3" value="new">
if we write our code very carefully
</li>
<li>
<input type="radio" name="q3" value="new">
if we have an MMU
</li>
<li>
<input type="radio" name="q3" value="new">
if we have special hardware to divide memory between different programs
</li>
<li>
<input type="radio" name="q3" value="new">
all of the above
</li>
</ol>
</ol>
<details>
<summary class="sum2">
Answers
</summary>
<p>
1. c; 2. a; 3. c;
</p>
</details>
</details>
</body>
</html>