@@ -58,9 +58,8 @@ libvmmapiはvmm.koへのioctl, sysctlを抽象化したライブラリで、/usr
58
58
59
59
リスト2 bhyverun.cは/usr/sbin/bhyveの中心になるコードです。
60
60
61
+ # ## リスト1 lib/libvmmapi/vmmapi.c
61
62
` ` `
62
- リスト1 lib/libvmmapi/vmmapi.c
63
-
64
63
......(省略)......
65
64
280: int
66
65
281: vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *vmexit)
@@ -81,9 +80,8 @@ libvmmapiはvmm.koへのioctl, sysctlを抽象化したライブラリで、/usr
81
80
- \(1) 前回の記事の最後でユーザランドへreturnされたioctlはここに戻ってくる。
82
81
- \(2) vmm.koから渡されたvmexit情報をコピーしてコール元へ渡す。
83
82
83
+ # ## リスト2 usr.sbin/bhyve/bhyverun.c
84
84
` ` `
85
- リスト2 usr.sbin/bhyve/bhyverun.c
86
-
87
85
......(省略)......
88
86
294: static int
89
87
295: vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu)
@@ -195,9 +193,8 @@ inout.cはI/O命令エミュレーションを行うコードです。
195
193
実際にはI/Oポートごとの各デバイスエミュレータのハンドラを管理する役割を担っており、要求を受けるとデバイスエミュレータのハンドラを呼び出します。
196
194
呼び出されたハンドラが実際のエミュレーション処理を行います。
197
195
196
+ # ## リスト3 usr.sbin/bhyve/inout.c
198
197
` ` `
199
- リスト3 usr.sbin/bhyve/inout.c
200
-
201
198
......(省略)......
202
199
72: int
203
200
73: emulate_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
@@ -261,9 +258,8 @@ inout.cはI/O命令エミュレーションを行うコードです。
261
258
consport.cはBHyVe専用の準仮想化コンソールドライバです。
262
259
現在はUART(Universal Asynchronous Receiver Transmitter)エミュレータが導入されたので必ずしも使う必要がなくなったのですが、デバイスエミュレータとしては最も単純な構造をしているので、デバイスエミュレータの例として取り上げました。
263
260
261
+ # ## リスト4 usr.sbin/bhyve/inout.c
264
262
` ` `
265
- リスト4 usr.sbin/bhyve/inout.c
266
-
267
263
......(省略)......
268
264
95: static void
269
265
96: ttywrite(unsigned char wb)
@@ -332,6 +328,3 @@ I/O命令によるVMExitを受けて行われるユーザランドでのエミ
332
328
Copyright (c) 2014 Takuya ASADA. 全ての原稿データ は
333
329
クリエイティブ・コモンズ 表示 - 継承 4.0 国際
334
330
ライセンスの下に提供されています。
335
-
336
- 参考文献
337
- ========
0 commit comments