annotate slide/CbCXv6.md @ 18:afc36230cf4f

slide chapter3,4
author tobaru
date Fri, 07 Feb 2020 20:06:13 +0900
parents
children 98cee2f6c919
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
1 # CbCインターフェースによる CbCXv6 の書き換え
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
2 - 並列信頼研
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
3 - 桃原 優
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
4
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
5 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
7 # 目次
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
8 1. **OS の信頼性の保証**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
9 2. CbC による Gears OS の開発
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
10 3. Xv6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
11 4. CbCXv6 での Paging
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
12 5. CbC インターフェース
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
13 6. 評価
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
14 7. まとめ 
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
15
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
16 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
17
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
18 # OS の信頼性の重要性
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
19 - OS のバグは日常生活に支障をきたす
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
20 - パスワードなしで root にアクセスできるバグ
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
21 - 日付設定でコンピュータが壊れる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
22 - -> OS自体に信頼性が求められる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
23
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
24 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
25
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
26 # OS の信頼性の重要性
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
27
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
28 - 全てのOSのコードに対して検証を行うのは困難
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
29 - 複雑な機能が多い
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
30 - 短期間のアップデート
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
31
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
32 - ユーザーが検証を行うこともできない
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
33 - 資源管理はOSが行なってる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
34 - そもそも資源管理が複雑
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
35 - アクセスされたり書き換えられるリスク
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
36
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
37 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
38
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
39
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
40 # メタレベルとノーマルレベル
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
41 - ノーマルレベル
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
42 - ユーザーがプログラミング言語によって記述する部分の処理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
43 - メタレベル
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
44 - ユーザーが記述しないOS 側の処理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
45 - CPU
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
46 - メモリ
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
47
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
48 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
49
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
50 # Continuation based C
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
51 - ノーマルレベルとメタレベルの処理を同じ言語で行えるようにした言語(以下CbC)
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
52 - Code Gear
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
53 - 基本的な処理の単位
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
54 - Data Gear
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
55 - データの単位
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
56
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
57 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
58
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
59 # goto による継続
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
60
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
61 - Code Gear の処理の間を goto によって遷移していく
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
62
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
63 ![](https://i.imgur.com/etfQund.png)
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
64
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
65 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
66
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
67 # Data Gear の継続
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
68 - goto の際に Data Gear も継続される
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
69
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
70 ![](https://i.imgur.com/3E0DGWA.png)
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
71
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
72 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
73
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
74 # Meta Code Gear
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
75 - 実際にはノーマルレベルの間にメタレベルの処理がある
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
76 - Meta Level では Data Gear の見え方は変わる(Meta Data Gear)
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
77
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
78 ![](https://i.imgur.com/vy0NxrG.png)
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
79
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
80 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
81
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
82 # 状態遷移モデル
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
83 - goto の遷移によって状態遷移モデルに落とし込める
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
84 - Code Gear に対しての入力に対して期待される出力がされているかで検査して**信頼性を保証する**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
85
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
86 ----
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
87
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
88 # Agda による検証
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
89 - モデル検査
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
90 - 定理証明支援系である Agda を用いる。
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
91 - Agda
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
92 - Haure Logic という検証手法を扱える。
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
93
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
94 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
95
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
96 # Haure Logic
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
97 - 検証手法
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
98 - 事前条件を使ってある関数を実行して事後条件を満たすことを確認する
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
99 - CbCと相性がいい
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
100 - 継続に事前条件(Input Data Gear)と事後条件(Output Data Gear)を持たせることができる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
101
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
102 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
103
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
104 # Geas OS
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
105 - CbC を使って信頼性の保証と拡張性を持たせる Gears OS の開発を行なっている
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
106 - Xv6 という OS を参考に書き換えをしている
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
107
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
108 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
109
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
110 # メモリ管理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
111 - OS の信頼性の1つであるメモリ管理部分を CbC で書き換える
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
112 - Page のバリデーションチェック
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
113 - サンドボックスによるエクセプション
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
114
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
115 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
116
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
117 # インターフェース
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
118 - 書き換えを防ぐために見える Data Gear に違いが生じる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
119 - -> Gears OS のノーマルレベルからメタレベルの記述が記述が煩雑になるためインターフェースを導入
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
120 - 機能の入れ替えによる他のメリット
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
121 - 煩雑な記述の解消
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
122 - 機能の入れ替え
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
123 - Agda による証明
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
124
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
125
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
126 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
127
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
128 # 目次
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
129 1. OS の信頼性の保証
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
130 2. **CbC による Gears OS の開発**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
131 3. Xv6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
132 4. CbCXv6 での Paging
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
133 5. CbC インターフェース
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
134 6. 評価
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
135 7. まとめ 
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
136
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
137 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
138
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
139 # CbC による Gears OS の開発
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
140 - a
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
141
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
142
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
143
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
144 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
145
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
146
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
147 # Context
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
148 - a
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
149
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
150 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
151
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
152 # 目次
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
153 1. OS の信頼性の保証
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
154 2. CbC による Gears OS の開発
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
155 3. **Xv6**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
156 4. CbCXv6 での Paging
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
157 5. CbC インターフェース
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
158 6. 評価
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
159 7. まとめ 
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
160
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
161 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
162
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
163 # Xv6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
164 - MIT の講義用教材として作られたOS
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
165 - 企画課される前のCで書かれたUNIX V6 を書き換えた
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
166 - 1万行程の軽量なOS
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
167 - Linuxだと数千万行
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
168 - Xv6 を参考に CbC で書き直すことで Gears OS を実装する
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
169
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
170 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
171
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
172 # カーネル空間
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
173 - OS の中核となるプログラムで Meta Level に相当する
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
174 - Xv6 ではカーネルとユーザープログラムは分離されている
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
175 - ユーザープログラムはカーネルに直接アクセスできない。
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
176 - 書き換えやアクセスを防ぐため
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
177 - 呼び出す場合は system call
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
178
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
179 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
180
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
181 # カーネルが提供するもの
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
182 - プロセス管理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
183 - メモリ管理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
184 - ファイル管理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
185 - I/O, read, write
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
186
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
187
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
188 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
189
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
190 # カーネルの保護機構
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
191 - CPUのハードウェア保護機構を持っている
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
192 - ユーザー空間で実行されているプロセスが自身のメモリのみアクセスできるように保護
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
193 - system call
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
194 - ハードウェアが一時的に特権レベルをあげ、カーネルのプログラムが実行される
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
195
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
196 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
197
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
198 # system call
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
199 - system call 呼び出し
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
200 - トラップ の発生
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
201 - ユーザープログラムの中断
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
202 - 処理がカーネルに切り替わる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
203
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
204 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
205
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
206 # system call
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
207 - ソースコード載せる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
208
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
209 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
210
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
211 # Xv6-rpi
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
212 - Xv6 は Arm のバイナリを出力するので様々なハードウェアで動かすことができる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
213 - Raspberry Pi
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
214 - 携帯電話
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
215 - 実際にRaspberry Pi で動かすために xv6-rpi を用意して動作しているかコンソールで確認中
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
216 - CbCxv6 とは別
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
217
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
218
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
219 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
220
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
221 # 目次
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
222 1. OS の信頼性の保証
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
223 2. CbC による Gears OS の開発
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
224 3. Xv6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
225 4. **CbCXv6 での Paging**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
226 5. CbC インターフェース
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
227 6. 評価
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
228 7. まとめ 
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
229
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
230 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
231
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
232 # CbCXv6 での Paging
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
233 - OS の信頼性の1つであるメモリ管理部分の書き換えについて説明
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
234
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
235 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
236
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
237 # 実メモリの直接操作
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
238 - 実メモリを直接扱うと様々な問題が生じる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
239 - ユーザープログラムで空いているメモリ番地を探す必要
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
240 - フラグメンテーションが起こる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
241 - メモリ間に扱うには小さな隙間ができる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
242
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
243 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
244
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
245 # Paging
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
246 - メモリ管理の手法
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
247 - Page と呼ばれる固定長のブロックに分割して、メモリとスワップ領域で Page を入れ替えて管理
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
248 - 仮想メモリとして扱うことでフラグメンテーションの解消と空き番地を探す必要がなくなる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
249
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
250 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
251
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
252 # Pagingの図
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
253 - 必要?
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
254
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
255 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
256
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
257 # メタレベルでの Paging の操作
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
258 - Page Table に相当するデータを Input Data Gear で受け取って変更した後、Context にある Meta Data Gear に goto で遷移してアクセス
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
259 - メタレベルで処理することで本来カーネル側の処理である Page Table を操作できる
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
260
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
261 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
262
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
263 # Paging の信頼性
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
264 - Input Data Gear に対しての Output Data Gear をバリデーションチェックすることで他のプロセスから書き換えられることを防ぐ
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
265 - サンドボックス
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
266 - 他のプロセスから書き換えられた時にエクセプションを飛ばす
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
267
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
268 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
269
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
270 # Paging の書き換え
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
271 - Xv6 では実メモリから仮想メモリの変換をvm.cで行なっている。
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
272 - 次の章で書き換えについて説明する
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
273
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
274
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
275
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
276 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
277
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
278 # 目次
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
279 1. OS の信頼性の保証
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
280 2. CbC による Gears OS の開発
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
281 3. Xv6
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
282 4. CbCXv6 での Paging**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
283 5. **CbC インターフェース**
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
284 6. 評価
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
285 7. まとめ 
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
286
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
287 ---
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
288
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
289
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
290
afc36230cf4f slide chapter3,4
tobaru
parents:
diff changeset
291