L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .
-
date post
19-Dec-2015 -
Category
Documents
-
view
216 -
download
1
Transcript of L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .
![Page 1: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/1.jpg)
L3: Naming systems
Frans Kaashoek6.033 Spring 2007
http://web.mit.edu/6.033
![Page 2: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/2.jpg)
Fundamental abstractions
• Memory• Read/write
• Interpreter• Instruction repertoire• Environment• Instruction pointer
• Communication links• Send/receive
(loop (print (eval (read))))
![Page 3: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/3.jpg)
World-wide Web
![Page 4: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/4.jpg)
Web names
http://web.mit.edu/6.0333 naming systems
https://apply.eecs.mit.edu/ex?whatnext=ctlmyfolders&submitted=on&onlyreader=kaashoek
name overloading: user query in the name
ex is a new interpreter
![Page 5: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/5.jpg)
PC board
![Page 6: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/6.jpg)
![Page 7: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/7.jpg)
Abstract bus picture
• address is overloaded name with location info• LOAD 1742, R1
![Page 8: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/8.jpg)
Names• R1• 1742• 18.7.22.69• web.mit.edu• http://web.mit.edu/6.033• [email protected]• amsterdam• /mit/6.033/www• foo.c• .. (as in cd .. or ls ..)• wc• (617)253-7149, x37149• 021-84-2030
![Page 9: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/9.jpg)
Naming example
foo (…) { int x, y;init()x = bar(…)y = sqrt(x)printf (“answer is %d”, y)
}
init() { …}
0xff00: // foo:…
jmp 0xff20 // init…
jmp 0xffd0 // bar….
jmp 0xffc0 // sqrt…
jmp 0xdc00 // printf
![Page 10: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/10.jpg)
Step 1: compilation
foo (…) { int x, y;init();x = bar(…);y = sqrt(x);printf (“answer is %d”,
y);
}
init() { …}
gcc -c foo.c
foo.o:• Text:
0xff00:// foo:
jmp +20 // init()…jmp ??? // sqrt….
• Symbol table:[init, L, +20][bar, U, ??][sqrt, U, ??][printf, U, ??]
![Page 11: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/11.jpg)
Step 2: linking
foo.o:• Text:
0xff00:// foo:
jmp +20 // init()…jmp ??? // sqrt….
• Symbol table:[init, L, +20][bar, U, ??][sqrt, U, ??][printf, U, ??]
• Gcc foo.o bar.o /usr/lib/libm.a /usr/lib/libc.a
libm.a (sqrt.o, foo.o):
sqrt.o:• Text:
0xff00: // sqrt:jmp +20 // init()…
• Symbol table:[init, L, +20][sqrt, G, +100]
![Page 12: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/12.jpg)
Step 3: loading
• Load in memory and adjust addresses:
foo.o + bar.o + libm.a + libc.a
foo.o + bar.o + libm.a + libc.a
0x0
232-1 0xff00: // foo:…
jmp 0xff20 // init…
jmp 0xffd0 // bar….
jmp 0xffc0 // sqrt…
jmp 0xdc00 // printf
![Page 13: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/13.jpg)
Sophistication: dynamic linking
foo.o + bar.o + libm.a + libc.a
foo.o + bar.o + libm.a + libc.a
0x0
232-1
libm.a
libc.a
foo.o + bar.o
foo.o + bar.o
• Resolve names at runtime through indirection
dynamic linker
![Page 14: L3: Naming systems Frans Kaashoek 6.033 Spring 2007 .](https://reader035.fdocuments.in/reader035/viewer/2022062421/56649d385503460f94a1169c/html5/thumbnails/14.jpg)
Summary
• Understanding a naming system:• What is the syntax for name?• What are the values?• What is the naming resolution
algorithm?• Where does a name’s context from?