Professional Documents
Culture Documents
MIT6 033s18lec3
MIT6 033s18lec3
• Operating systems
• Virtual memory
• OS abstractions
load(amazon.c
om/buy.html?s
ocks)
virtualize
2. programs should be able to
communication
communicate
links
instructions for
CPU2 (used by program2) program2
problem: no boundaries
7
0x00000000 0xbe26dc9
0x00000001 0xc090f81c
0x00000002 0xb762a572 2 entries
32
0x00000003 0x5dcc90ee
… …
11
12
15
17
18
19
int main() {
m = f;
set m to point to f
if (fork() == 0) {
printf("child has started\n");
15 seconds, call m
sleep(1);
(*m)();
}
}
else {
printf("parent has started\n");
sleep (5);
printf("parent is running; let's write to m = %p\n", m); Parent: overwrite
m and then call it
m = 0;
printf("parent tries to invoke m = %p\n", m);
(*m)();
printf("parent is still alive\n");
}
}
20
21
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.
22