Skip to content

Commit 77154cf

Browse files
committed
Fixes on part10
1 parent fc85c81 commit 77154cf

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

part10.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ libvmmapiはvmm.koへのioctl, sysctlを抽象化したライブラリで、/usr
5858

5959
リスト2 bhyverun.cは/usr/sbin/bhyveの中心になるコードです。
6060

61+
### リスト1 lib/libvmmapi/vmmapi.c
6162
```
62-
リスト1 lib/libvmmapi/vmmapi.c
63-
6463
......(省略)......
6564
280: int
6665
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
8180
- \(1) 前回の記事の最後でユーザランドへreturnされたioctlはここに戻ってくる。
8281
- \(2) vmm.koから渡されたvmexit情報をコピーしてコール元へ渡す。
8382

83+
### リスト2 usr.sbin/bhyve/bhyverun.c
8484
```
85-
リスト2 usr.sbin/bhyve/bhyverun.c
86-
8785
......(省略)......
8886
294: static int
8987
295: vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu)
@@ -195,9 +193,8 @@ inout.cはI/O命令エミュレーションを行うコードです。
195193
実際にはI/Oポートごとの各デバイスエミュレータのハンドラを管理する役割を担っており、要求を受けるとデバイスエミュレータのハンドラを呼び出します。
196194
呼び出されたハンドラが実際のエミュレーション処理を行います。
197195

196+
### リスト3 usr.sbin/bhyve/inout.c
198197
```
199-
リスト3 usr.sbin/bhyve/inout.c
200-
201198
......(省略)......
202199
72: int
203200
73: emulate_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
@@ -261,9 +258,8 @@ inout.cはI/O命令エミュレーションを行うコードです。
261258
consport.cはBHyVe専用の準仮想化コンソールドライバです。
262259
現在はUART(Universal Asynchronous Receiver Transmitter)エミュレータが導入されたので必ずしも使う必要がなくなったのですが、デバイスエミュレータとしては最も単純な構造をしているので、デバイスエミュレータの例として取り上げました。
263260

261+
### リスト4 usr.sbin/bhyve/inout.c
264262
```
265-
リスト4 usr.sbin/bhyve/inout.c
266-
267263
......(省略)......
268264
95: static void
269265
96: ttywrite(unsigned char wb)
@@ -332,6 +328,3 @@ I/O命令によるVMExitを受けて行われるユーザランドでのエミ
332328
Copyright (c) 2014 Takuya ASADA. 全ての原稿データ は
333329
クリエイティブ・コモンズ 表示 - 継承 4.0 国際
334330
ライセンスの下に提供されています。
335-
336-
参考文献
337-
========

0 commit comments

Comments
 (0)