|
|
@@ -2,20 +2,20 @@
|
|
2
|
2
|
|
|
3
|
3
|
### Warmup
|
|
4
|
4
|
|
|
5
|
|
-| VA Number | Virtual Adress | Binary Address | Segment Number |
|
|
6
|
|
-| --------- | -------------- | -------------- | -------------- |
|
|
7
|
|
-| VA 0 | 0x00000011 | 0**0**010001 | 0 |
|
|
8
|
|
-| VA 1 | 0x0000006c | 0**1**101100 | 1 |
|
|
9
|
|
-| VA 2 | 0x00000061 | 0**1**100001 | 1 |
|
|
10
|
|
-| VA 3 | 0x00000020 | 0**0**100000 | 0 |
|
|
11
|
|
-| VA 4 | 0x0000003f | 0**0**111111 | 0 |
|
|
|
5
|
+| VA Number | Virtual Adress | Physical Adress | Valid |
|
|
|
6
|
+| --------- | :----------------- | ----------------------- | ----- |
|
|
|
7
|
+| VA 0 | 0x11 --> 0010001 | **00**0010001 --> 0x11 | YES |
|
|
|
8
|
+| VA 1 | 0x6c --> 1101100 | **11**1101100 --> 0x1ec | YES |
|
|
|
9
|
+| VA 2 | 0x61 --> 1100001 | **11**1100001 --> 0x1e1 | NO |
|
|
|
10
|
+| VA 3 | 0x20 --> 0100000 | **00**100000 --> 0x1e1 | NO |
|
|
|
11
|
+| VA 4 | 0x3f --> 0111111 | **00**111111 --> 0x1e1 | NO |
|
|
12
|
12
|
|
|
13
|
13
|
|
|
14
|
14
|
|
|
15
|
15
|
```
|
|
16
|
16
|
--------------- 0x00000000
|
|
17
|
17
|
| Segment 0 |
|
|
18
|
|
- |-------------| 0x00000020
|
|
|
18
|
+ |-------------| 0x00000014
|
|
19
|
19
|
| |
|
|
20
|
20
|
| |
|
|
21
|
21
|
| |
|
|
|
@@ -29,5 +29,46 @@
|
|
29
|
29
|
|
|
30
|
30
|
## Questions
|
|
31
|
31
|
|
|
32
|
|
-1. Die höchste erlaubte Adresse in Segment 0 ist 0x00000020. Die niedrigste valide Addresse des Segments 1 ist 0x000001ec.
|
|
33
|
|
-2.
|
|
|
32
|
+1. Die höchste erlaubte Adresse in Segment 0 ist 0x00000020. Die niedrigste valide Addresse des Segments 1 ist 0x000001ec. Um zu testen ob das stimmt kann mann alle validen Adressen des ersten Segments UND Adressen über dem Limit
|
|
|
33
|
+
|
|
|
34
|
+ `-A 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127`
|
|
|
35
|
+
|
|
|
36
|
+
|
|
|
37
|
+2. Der Aufruf muss wie folgt aussehen:
|
|
|
38
|
+
|
|
|
39
|
+ > ./segmentation.py -a 16 -p 128 -A 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 **--b0 0 --l0 2 --b1 16 --l1 2** -c
|
|
|
40
|
+
|
|
|
41
|
+ Die Flags `-l0` und `-l1` setzten jeweils das Limit für das Segment auf 2:
|
|
|
42
|
+
|
|
|
43
|
+ Segment 0 nimmt also die virtuellen Adressen 0 und 1 an und
|
|
|
44
|
+
|
|
|
45
|
+ Segment 1 nimmt die Adressen 14 und 15 an
|
|
|
46
|
+
|
|
|
47
|
+3. Man sollte das Limit `-l` so wählen, dass es 90% der Adressen des Adressraums `-a` abdeckt. Dann werden die restliche 10% über das gesetzte Limit gehen und einen Segmentation Fault auslösen.
|
|
|
48
|
+
|
|
|
49
|
+4. Man setzt die Limits der Segmente auf 0, dann ist keine virtuelle Adresse valide.
|
|
|
50
|
+
|
|
|
51
|
+5. `Segment 0: 0x0000 bis 0x0040`
|
|
|
52
|
+
|
|
|
53
|
+ `Segment 1: 0x0380 bis 0x0400`
|
|
|
54
|
+
|
|
|
55
|
+ | VA Nr. | Virtual Address | Physical Address HEX | PA DEC |
|
|
|
56
|
+ | ------ | --------------- | -------------------- | ------ |
|
|
|
57
|
+ | 0 | 0x0000005c | | |
|
|
|
58
|
+ | 1 | 0x00000011 | | |
|
|
|
59
|
+ | 2 | 0x00000043 | | |
|
|
|
60
|
+ | 3 | 0x00000021 | | |
|
|
|
61
|
+ | 4 | 0x0000006c | | |
|
|
|
62
|
+ | 5 | 0x0000007a | | |
|
|
|
63
|
+ | 6 | 0x00000050 | | |
|
|
|
64
|
+ | 7 | 0x00000037 | | |
|
|
|
65
|
+ | 8 | 0x000000ff | | |
|
|
|
66
|
+ | 9 | 0x000000e9 | | |
|
|
|
67
|
+ | 10 | 0x00000001 | | |
|
|
|
68
|
+ | 11 | 0x0000014c | | |
|
|
|
69
|
+ | 12 | 0x000000b4 | | |
|
|
|
70
|
+ | 13 | 0x000000cf | | |
|
|
|
71
|
+ | 14 | 0x0000012b | | |
|
|
|
72
|
+ | 15 | 0x00000084 | | |
|
|
|
73
|
+
|
|
|
74
|
+
|