forked from linux-kernel-labs/linux-kernel-labs.github.io
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
1966 lines (1948 loc) · 167 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="writer-html4" lang="zh-CN" >
<head>
<meta charset="utf-8" /><meta content="本 Linux 内核教学文档介绍了一系列与 Linux 内核相关的课程和实验。课程侧重于理论和内核探索,实验则着重于设备驱动程序的主题。本文档内容基于布加勒斯特理工大学的“操作系统 2”课程。文档可以通过 Docker 容器或直接在主机上构建。该文档包含入门介绍、系统调用、进程管理、中断机制、SMP、地址空间、内存管理、文件系统、调试、网络、体系结构、虚拟化等 Linux 内核相关的多个专题。" name="description" />
<meta content="Linux, 内核, 内核编程, 操作系统, 设备驱动程序, 文件系统, 进程管理, 虚拟化" name="keywords" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Linux 内核教学 — Linux 系统内核文档</title><link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/asciinema-player.css" type="text/css" />
<link rel="stylesheet" href="_static/theme_overrides.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script>
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
LANGUAGE:'zh_CN',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/asciinema-player.js"></script>
<script src="_static/translations.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="索引" href="genindex.html" />
<link rel="search" title="搜索" href="search.html" />
<link rel="next" title="操作系统 2" href="so2/index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="#" class="icon icon-home">
Linux 系统内核
</a>
<div class="version">
5.10.14
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="so2/index.html">操作系统 2</a></li>
</ul>
<p class="caption"><span class="caption-text">课程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="lectures/intro.html">介绍</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/syscalls.html">系统调用</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/processes.html">进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/interrupts.html">中断</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/smp.html">对称多处理</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/address-space.html">地址空间</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/memory-management.html">内存管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/fs.html">文件系统管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/debugging.html">调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/networking.html">网络管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/arch.html">体系结构层</a></li>
<li class="toctree-l1"><a class="reference internal" href="lectures/virt.html">虚拟化</a></li>
</ul>
<p class="caption"><span class="caption-text">实验</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="labs/infrastructure.html">基础设施</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/introduction.html">介绍</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/kernel_modules.html">内核模块</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/kernel_api.html">内核 API</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/device_drivers.html">字符设备驱动程序</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/interrupts.html">I/O 访问和中断</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/deferred_work.html">延迟工作</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/block_device_drivers.html">块设备驱动程序</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/filesystems_part1.html">文件系统驱动程序(第一部分)</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/filesystems_part2.html">文件系统驱动程序(第二部分)</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/networking.html">网络</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/arm_kernel_development.html">ARM 内核开发</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/memory_mapping.html">内存映射</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/device_model.html">Linux 设备模型</a></li>
<li class="toctree-l1"><a class="reference internal" href="labs/kernel_profiling.html">内核分析</a></li>
</ul>
<p class="caption"><span class="caption-text">有用信息</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="info/vm.html">推荐配置</a></li>
<li class="toctree-l1"><a class="reference internal" href="info/vm.html#section-2">虚拟机配置</a></li>
<li class="toctree-l1"><a class="reference internal" href="info/extra-vm.html">自定义虚拟机配置</a></li>
<li class="toctree-l1"><a class="reference internal" href="info/contributing.html">向 Linux 内核实验项目做贡献</a></li>
<li class="toctree-l1"><a class="reference internal" href="info/chinese-localization-info.html">中文翻译介绍</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="#">Linux 系统内核</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="#" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Linux 内核教学</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="linux">
<h1>Linux 内核教学<a class="headerlink" href="#linux" title="永久链接至标题">¶</a></h1>
<p>本文档包含一系列 Linux 内核主题的课程和实验。课程侧重于理论和 Linux 内核探索。</p>
<p>实验侧重于设备驱动程序主题,文档风格类似“howto”。每个主题分两部分:</p>
<ul class="simple">
<li>主题概述,包含概述、主要抽象概念、简单示例和对 API 的指引。</li>
<li>实践部分,包含几个应由学生解决的练习;为了使学生专注于当下的主题,学生会得到一个起始编码框架和深入的解决练习的技巧提示。</li>
</ul>
<p>本文档内容基于布加勒斯特理工大学自动控制与计算机学院计算机科学与工程系的 <a class="reference external" href="http://ocw.cs.pub.ro/courses/so2">“操作系统 2”</a> 课程。</p>
<p>你可以在 <a class="reference external" href="https://github.com/linux-kernel-labs-zh">https://github.com/linux-kernel-labs-zh</a> 获取最新版本。</p>
<p>在你的主机上安装 docker-compose 后,可以从源代码构建文档:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">cd</span> tools/labs <span class="o">&&</span> make docker-docs
</pre></div>
</div>
<p>然后用你的浏览器中打开 <strong>Documentation/output/labs/index.html</strong>。</p>
<p>或者,你可以直接在主机上构建(参见 tools/labs/docs/Dockerfile 中的依赖项):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">cd</span> tools/labs <span class="o">&&</span> make docs
</pre></div>
</div>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="so2/index.html">操作系统 2</a><ul>
<li class="toctree-l2"><a class="reference internal" href="so2/grading.html">SO2——基本规则和评分</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/grading.html#section-1">基本规则</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-2">1. 实验室</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-3">2. 分配作业的最后期限</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-4">3. 作业演示</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-5">4. 作业规则</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-6">5. 抄袭作业的惩罚</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-7">6. 补考/提分</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-8">7. 重新上课</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/grading.html#section-9">评分</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-10">1. 讲座(3 分)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-11">2. 实验(2分)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/grading.html#section-12">3. 作业(5 分 + 额外加分)</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec1-intro.html">SO2 课程 01——课程概要以及 Linux 内核介绍</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-1">团队</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-2">课程定位</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-3">资源</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-4">社区</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-5">评分</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-6">课程目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-7">实验和作业目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-8">必修课程</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-9">关于课程</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-10">课程列表</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-11">关于实验</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-12">关于主题</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-13">主题列表</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-14">课程参考书目</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-15">实验参考书目</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-16">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#section-17">基本的操作系统名词和概念</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-18">用户与内核的比较</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-19">典型的操作系统架构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-20">单体内核</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-21">微内核</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-22">微内核与单体内核的比较</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-23">地址空间</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-24">用户和内核共享虚拟地址空间</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-25">执行上下文</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-26">多任务处理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-27">抢占式内核</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-28">可分页的内核内存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-29">内核堆栈</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-30">可移植性</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#asmp">非对称多处理(ASMP)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#smp">对称多处理(SMP)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#cpu">CPU 可扩展性</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec1-intro.html#linux">Linux 内核概述</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#linux-1">Linux 开发模型</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#section-31">维护者层次结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#linux-2">Linux 源代码布局</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec1-intro.html#linux-3">Linux 内核结构</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#arch">arch</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#section-32">设备驱动程序</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#section-33">进程管理</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#section-34">内存管理</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#i-o">块 I/O 管理</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#section-35">虚拟文件系统</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#section-36">网络堆栈</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec1-intro.html#linux-4">Linux 安全模块</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec2-syscalls.html">SO2 课程 02——系统调用</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec2-syscalls.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec2-syscalls.html#linux">Linux 系统调用实现</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec2-syscalls.html#section-2">系统调用表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec2-syscalls.html#section-3">系统调用参数处理</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec2-syscalls.html#vdso">虚拟动态共享对象 (VDSO)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec2-syscalls.html#section-4">通过系统调用访问用户空间</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec3-processes.html">SO2 课程 03——进程</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-1">课程目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-2">进程和线程</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-3">进程资源概述</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#struct-task-struct"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">task_struct</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#task-struct">检查 task_struct</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-4">测验:查看任务以确定打开的文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-5">线程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-6">克隆系统调用</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-7">命名空间和“容器”</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-8">访问当前进程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#current-x86">测验:current 宏的先前实现(x86)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-9">上下文切换</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-10">测验:上下文切换</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-11">阻塞和唤醒任务</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-12">任务状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-13">阻塞当前线程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-14">唤醒任务</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-15">任务抢占</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-16">非抢占式内核</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-17">抢占式内核</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#section-18">进程上下文</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#section-19">内核线程</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec3-processes.html#gdb">使用 gdb 脚本进行内核检查</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec3-processes.html#gdb-1">测验:内核 gdb 脚本</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec4-interrupts.html">SO2 课程 04——中断</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec4-interrupts.html#section-1">课堂目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec4-interrupts.html#section-2">什么是中断?</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-3">异常</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-4">测验:中断术语</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec4-interrupts.html#section-5">硬件概念</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-6">可编程中断控制器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#smp">在 SMP 系统中的中断控制器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-7">中断控制</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-8">中断优先级</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-9">测验:硬件概念</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec4-interrupts.html#x86">x86 架构上的中断处理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-10">中断描述符表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-11">中断处理程序地址</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-12">中断处理程序的栈</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-13">处理中断请求</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-14">从中断处理程序返回</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#x86-1">检查 x86 中断处理过程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#x86-2">测验:x86 中断处理</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec4-interrupts.html#linux">Linux 中的中断处理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-15">嵌套中断和异常</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-16">中断上下文</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-17">可延迟操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#soft-irq">软中断(Soft IRQ)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-18">网络包泛洪示例</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#tasklet">任务(tasklet)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-19">工作队列</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-20">定时器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#section-21">可延迟操作摘要</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec4-interrupts.html#linux-1">测验:Linux 中断处理</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec5-smp.html">SO2 课程 05——对称多处理</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-1">课堂目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-2">基本同步</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#linux">Linux 内核并发源</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-3">原子操作</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-4">禁用抢占(中断)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-5">自旋锁</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-6">多处理器系统中的缓存一致性</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-7">优化的自旋锁</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-8">进程和中断上下文同步</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#mutexes">互斥锁(Mutexes)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#cpu">CPU 独占数据</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#section-9">内存顺序和屏障</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec5-smp.html#read-copy-update-rcu">读-复制-更新(Read Copy Update,RCU)</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec6-address-space.html">SO2 课程 06——地址空间</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec6-address-space.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec6-address-space.html#x86-mmu">x86 MMU</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-2">选择器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-3">段描述符</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#linux">Linux 中的分段</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-4">检查选择器和段</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#x86">x86 分页</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-5">页表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#linux-1">Linux 分页</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#tlb">转译后备缓冲区(TLB)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec6-address-space.html#linux-2">Linux 地址空间</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-6">32 位系统的地址空间选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-7">线性映射</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-8">高内存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-9">固定映射的线性地址</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-10">临时映射</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec6-address-space.html#section-11">永久映射</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec7-memory-management.html">SO2 课程 07——内存管理</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec7-memory-management.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec7-memory-management.html#section-2">物理内存管理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#section-3">内存区域</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#section-4">非均匀内存访问</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#section-5">页面分配</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#linux">Linux 的实现</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#section-6">小型分配</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#slab">SLAB 架构</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec7-memory-management.html#section-7">虚拟内存管理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec7-memory-management.html#section-8">地址空间描述符</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec7-memory-management.html#section-9">缺页处理</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec8-filesystems.html">SO2 课程 08——文件系统管理</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec8-filesystems.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec8-filesystems.html#section-2">文件系统抽象</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec8-filesystems.html#section-3">文件系统操作</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-4">挂载文件系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-5">打开文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-6">查询文件属性</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-7">从文件读取数据</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-8">向文件写入数据</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-9">关闭文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-10">目录</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-11">创建文件</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-12">删除文件</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec8-filesystems.html#linux">Linux 虚拟文件系统</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-13">超级块操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#inode">Inode 操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#inode-1">Inode 缓存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-14">目录项缓存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec8-filesystems.html#section-15">页面缓存</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec9-debugging.html">SO2 课程 09——内核调试</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#oops-panic">解码 oops/panic</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#oops">解码 oops</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#addr2line">addr2line</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#objdump">objdump</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#gdb">gdb</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#section-2">内核崩溃</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#section-3">列表调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#section-4">内存调试</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#slab">SLAB 调试</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#debug-pagealloc">DEBUG_PAGEALLOC</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#kasan">KASan</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lec9-debugging.html#kasan-vs-debug-pagealloc">KASan vs DEBUG_PAGEALLOC</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lec9-debugging.html#kasan-vs-slub-debug">KASan vs SLUB_DEBUG</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec9-debugging.html#kmemleak">Kmemleak</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#lockdep">Lockdep 检查器</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#perf">perf</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec9-debugging.html#section-5">其他工具</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec10-networking.html">SO2 课程 10——网络</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-2">网络管理概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#sockets">Sockets 实现概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#sockets-1">Sockets 系列和协议</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec10-networking.html#udp">示例:UDP 发送</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-3">网络处理阶段</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-4">数据包路由</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec10-networking.html#section-5">路由表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec10-networking.html#section-6">路由策略数据库</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec10-networking.html#section-7">路由表处理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec10-networking.html#section-8">转发信息数据库</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#netfilter">Netfilter</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#skb-sk-buff">网络数据包/skb(结构 sk_buff)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-9">网络设备</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec10-networking.html#section-10">硬件和软件加速技术</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec11-arch.html">SO2 课程 11——体系结构层</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec11-arch.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec11-arch.html#section-2">体系结构层概述</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#boot">引导(boot)过程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-3">引导过程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-4">内存设置</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#mmu">MMU 管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-5">线程管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-6">时间管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-7">中断和异常管理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-8">系统调用</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-9">平台驱动程序</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec11-arch.html#section-10">机器特定代码</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec11-arch.html#section-11">引导过程概述</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lec12-virtualization.html">SO2 课程 12——虚拟化</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#section-1">课程目标:</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#emulation">模拟(emulation)基础知识</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#virtualization">虚拟化(virtualization)基础知识</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#section-2">经典虚拟化</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#section-3">软件虚拟化</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#mmu">MMU 虚拟化</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#section-4">影子页表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#section-5">延迟影子同步</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#i-o-emulation">I/O 仿真(emulation)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#section-6">部分虚拟化</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#intel-vt-x">Intel VT-x</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#section-7">虚拟机控制结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#section-8">虚拟机进入和退出</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#section-9">虚拟机执行控制字段</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#section-10">扩展页表</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lec12-virtualization.html#vpid">VPID</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#i-o">I/O 虚拟化</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#qemu">qemu</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#kvm">KVM</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#hypervisor">类型 1 和类型 2 的 Hypervisor</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lec12-virtualization.html#xen">Xen</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab1-intro.html">SO2 实验 01——介绍</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-2">关于本实验</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-3">参考资料</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-4">文档</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-5">内核模块概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-6">内核模块示例</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-7">编译内核模块</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-8">加载/卸载内核模块</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-9">内核模块调试</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#objdump">objdump</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#addr2line">addr2line</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#minicom">minicom</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#netconsole">netconsole</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#printk">Printk 调试</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-10">动态调试</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab1-intro.html#dyndbg-1">Dyndbg 选项</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#kdb">KDB:内核调试器</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-11">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-12">备注</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-13">1. 内核模块</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#printk-1">2. Printk</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-14">3. 错误</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-15">4. 子模块</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#oops-1">5. 内核 oops</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-16">6. 模块参数</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-17">7. 进程信息</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-18">了解更多</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-19">源代码导航</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#cscope">cscope</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#clangd">clangd</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#kscope">Kscope</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#lxr-cross-reference">LXR Cross-Reference</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#sourceweb">SourceWeb</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab1-intro.html#section-20">内核调试</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#gdb-linux">gdb(Linux)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab1-intro.html#section-21">获取堆栈跟踪</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab2-kernel-api.html">SO2 实验 02——内核 API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-2">概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-3">访问内存</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-4">执行上下文</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-5">锁定</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#preemptivity">可抢占性(preemptivity)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#linux-api">Linux 内核 API</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-6">表示错误的约定</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-7">字符串处理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#printk">printk</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-8">内存分配</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-9">列表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-10">自旋锁</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#mutex">互斥锁(Mutex)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-11">原子变量</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab2-kernel-api.html#section-12">原子变量的使用</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-13">原子位操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab2-kernel-api.html#section-14">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-15">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#linux">1. Linux 内核中的内存分配</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-16">2. 在原子上下文中睡眠</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-17">3. 使用内核内存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-18">4. 使用内核列表</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-19">5. 使用内核列表进行进程处理</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-20">6. 同步列表工作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab2-kernel-api.html#section-21">7. 在我们的列表模块中测试模块调用</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab3-device-drivers.html">SO2 实验 03——字符设备驱动</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-2">概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-3">主设备号和次设备号</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-4">字符设备的数据结构</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#struct-file-operations"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">file_operations</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#inode-file"><code class="docutils literal"><span class="pre">inode</span></code> 和 <code class="docutils literal"><span class="pre">file</span></code> 结构</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-5">实现操作</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-6">字符设备的注册和注销</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-7">访问进程地址空间</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-8">打开和释放</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-9">读取和写入</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#ioctl-1">ioctl</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-10">等待队列</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-11">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-12">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-13">1. 注册/注销</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-14">2. 注册一个已注册的主设备号</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-15">3. 打开和关闭</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-16">4. 访问限制</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-17">5. 读操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#section-18">6. 写操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#ioctl-2">7. ioctl 操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab3-device-drivers.html#section-19">额外练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#ioctl-3">带消息的 ioctl</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#ioctl-4">使用等待队列的 ioctl</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab3-device-drivers.html#o-nonblock">O_NONBLOCK 实现</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab4-interrupts.html">SO2 实验 04——I/O 访问和中断</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-2">背景信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-3">访问硬件</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#i-o">请求访问 I/O 端口</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#i-o-1">访问 I/O 端口</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#i-o-2">5. 从用户空间访问 I/O 端口</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-4">中断处理</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-5">请求中断</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-6">中断处理程序的实现</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-7">锁定</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-8">中断统计</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-9">进一步阅读</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-10">串口</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-11">并行端口</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-12">键盘控制器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#linux">Linux 设备驱动程序</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-13">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-14">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-15">键盘驱动程序</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#i-o-3">1. 请求 I/O 端口</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-16">2. 中断处理例程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#ascii">3. 将 ASCII 键存储到缓冲区</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab4-interrupts.html#section-17">读取数据寄存器</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab4-interrupts.html#section-18">解释扫描码</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab4-interrupts.html#section-19">将字符存储到缓冲区</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-20">4. 读取缓冲区</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#section-21">5. 重置缓冲区</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab4-interrupts.html#section-22">额外练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab4-interrupts.html#kfifo">1. kfifo</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab5-deferred-work.html">SO2 实验 05——延迟工作</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-2">背景信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#softirqs">软中断(Softirqs)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#tasklet">tasklet</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#timer">定时器(Timer)</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#locking">锁定(Locking)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-3">工作队列</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-4">内核线程</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-5">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab5-deferred-work.html#section-6">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-7">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-8">1. 定时器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-9">2. 周期性定时器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#ioctl">3. 使用 ioctl 控制定时器</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-10">4. 阻塞操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-11">5. 工作队列</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-12">6. 内核线程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab5-deferred-work.html#section-13">7. 定时器和进程之间共享的缓冲区</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab6-memory-mapping.html">SO2 实验 06——内存映射</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-2">概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-3">用于内存映射的结构</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#struct-page"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">page</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#struct-vm-area-struct"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">vm_area_struct</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#struct-mm-struct"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">mm_struct</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-4">设备驱动程序的内存映射</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-5">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-6">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-7">1. 将连续的物理内存映射到用户空间</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-8">2. 将非连续的物理内存映射到用户空间</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#section-9">3. 在映射内存中进行读写操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab6-memory-mapping.html#procfs">4. 在 procfs 中显示内存映射</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab7-block-device-drivers.html">SO2 实验 07——块设备驱动</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-2">概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#i-o">注册块 I/O 设备</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-3">注册磁盘</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-gendisk"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">gendisk</span></code> 结构体</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-block-device-operations"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">block_device_operations</span></code> 结构体</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-4">请求队列——多队列块层</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-5">软件分段队列</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-6">硬件调度队列</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-7">标签集</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-8">创建和删除请求队列</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-9">用于处理请求队列的有用函数</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-10">块设备的请求</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-11">创建请求</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-12">处理请求</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-1">创建 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-2">提交 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-3">等待 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构的完成</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-4">初始化 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-5">如何使用 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构的内容</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-6">释放 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-7">在 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 级别设置请求队列</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-13">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-14">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-15">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-16">1. 块设备</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-17">2. 磁盘注册</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#ram">3. RAM 磁盘</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-18">4. 从磁盘读取数据</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#section-19">5. 将数据写入磁盘</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab7-block-device-drivers.html#struct-bio-8">6. 在 <code class="docutils literal"><span class="pre">struct</span> <span class="pre">bio</span></code> 级别处理请求队列中的请求</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab8-filesystems-part1.html">SO2 实验 08——文件系统驱动(第一部分)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#vfs">虚拟文件系统(VFS)</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-2">常见的文件系统模型</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-3">超级块</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-4">本地化:</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#inode">inode</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-5">本地化:</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#file">file</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-6">本地化:</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-7">目录项</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-8">注册和注销文件系统</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#mount-kill-sb">mount 和 kill_sb 函数</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#vfs-1">VFS 中的超级块</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-9">超级块操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#fill-super"><code class="docutils literal"><span class="pre">fill_super()</span></code> 函数</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-10">缓冲区缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-11">函数和有用的宏</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-12">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab8-filesystems-part1.html#section-13">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#myfs">myfs</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#myfs-1">1. 注册和注销 myfs 文件系统</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#myfs-2">2. 完成 myfs 的超级块</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#myfs-3">3. 初始化 myfs 根索引节点</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#myfs-4">4. 测试 myfs 的挂载和卸载</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs">minfs</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs-1">1. 注册和注销 minfs 文件系统</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs-2">2. 完善 minfs 超级块</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs-3">3. 创建和销毁 minfs 索引节点</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs-4">4. 初始化 minfs 根索引节点</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab8-filesystems-part1.html#minfs-5">5. minfs 挂载和卸载的测试</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab9-filesystems-part2.html">SO2 实验 09——文件系统驱动程序(第二部分)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#inode">Inode</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#inode-1">inode 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#inode-2">Inode 操作</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#inode-3">获取 inode</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-2">超级块操作</a></li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#inode-operations">inode_operations</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#file">file 结构</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-3">常规文件索引节点</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-4">常规文件索引节点操作</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-5">地址空间操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#dentry">Dentry 结构体</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#dentry-1">Dentry 操作</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-6">目录索引节点操作</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-7">创建索引节点</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-8">创建目录</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-9">创建链接</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-10">创建符号链接</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-11">删除链接</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-12">删除目录</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-13">在目录中搜索索引节点</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-14">遍历目录中的条目</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-15">位图操作</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-16">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-17">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#myfs">myfs</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-18">1. 目录操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-19">测试</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-20">2. 文件操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-21">测试</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab9-filesystems-part2.html#minfs">minfs</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-22">1. 迭代操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-23">测试</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-24">2. 查找操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-25">测试</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-26">3. 创建操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab9-filesystems-part2.html#section-27">测试</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab10-networking.html">SO2 实验 10——网络</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#section-2">概述</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#section-3">用户空间中的网络编程</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#linux">Linux 网络编程</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#struct-socket"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">socket</span></code> 结构</a><ul>
<li class="toctree-l5"><a class="reference internal" href="so2/lab10-networking.html#socket">对 socket 结构的操作</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab10-networking.html#section-4">创建</a></li>
<li class="toctree-l6"><a class="reference internal" href="so2/lab10-networking.html#section-5">关闭连接</a></li>
<li class="toctree-l6"><a class="reference internal" href="so2/lab10-networking.html#section-6">发送/接收消息</a></li>
</ul>
</li>
<li class="toctree-l5"><a class="reference internal" href="so2/lab10-networking.html#struct-socket-1"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">socket</span></code> 字段</a><ul>
<li class="toctree-l6"><a class="reference internal" href="so2/lab10-networking.html#struct-proto-ops"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">proto_ops</span></code> 结构</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#struct-sock"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">sock</span></code> 结构</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#struct-sk-buff"><code class="docutils literal"><span class="pre">struct</span> <span class="pre">sk_buff</span></code> 结构体</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#section-7">转换</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#netfilter-1">netfilter</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#netcat">netcat</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#section-8">进一步阅读</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab10-networking.html#section-9">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#section-10">1. 在内核空间中显示数据包</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#section-11">2. 按目标地址进行过滤</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#tcp-socket">3. 监听 TCP socket</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#section-12">4. 在内核空间接受连接</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab10-networking.html#udp-1">5. UDP 套接字发送方</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab11-arm-kernel-development.html">SO2 实验 11——ARM 内核开发</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-2">片上系统</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-3">板级支持软件包</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-4">工具链</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#arm-linux">编译 ARM 版 Linux 内核</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#linux">Linux 内核镜像</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#rootfs">Rootfs</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-5">设备树</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#qemu">Qemu</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-6">练习</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-7">0. 简介</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-8">1. 启动</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#cpu">2. CPU 信息</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#i-o">3. I/O 内存</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#hello-world">4. Hello World</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab11-arm-kernel-development.html#section-9">5. 简单设备</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/lab12-kernel-profiling.html">SO2 实验 12——内核分析</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-1">实验目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-2">概述</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-3">分析工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#perf">perf</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#ps">ps</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#time">time</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#top">top</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-4">性能分析方法论</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-5">练习</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/lab12-kernel-profiling.html#i-o">0. 演示:I/O 问题的性能分析</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-6">1. 调查降低响应性的问题</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#section-7">2. 启动新线程</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#cp">3. 调整 <code class="docutils literal"><span class="pre">cp</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#i-o-1">4. I/O 延迟</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/lab12-kernel-profiling.html#elf">5. 错误的 ELF 文件</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/assign-collaboration.html">合作</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#github-gitlab">1. 使用 Github / Gitlab</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-2">2. 从任务的骨架开始</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-3">3. 为每个单独的更改添加提交</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-4">4. 在团队内拆分工作</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-5">5. 进行代码审查</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-6">6. 合并工作</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/assign0-kernel-api.html">作业 0——内核 API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-1">作业目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-2">说明</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-3">测试</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-4">快速开始</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-5">提示</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-6">扣分项</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-7">提交作业</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-8">资源</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-9">问题</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html">作业 1——基于 Kprobe 的跟踪器</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-1">作业目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-2">题目描述</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-3">实现细节</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-4">测试</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-5">快速开始</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-6">提示</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-7">扣分项</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-8">提交作业</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-9">资源</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html#section-10">问题</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="so2/assign2-driver-uart.html">作业 2——驱动 UART</a><ul>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-1">作业目标</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-2">任务描述</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/assign2-driver-uart.html#section-3">缓冲区方案</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-4">实现细节</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-5">测试</a></li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-6">快速开始</a><ul>
<li class="toctree-l4"><a class="reference internal" href="so2/assign2-driver-uart.html#section-7">提示</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign2-driver-uart.html#section-8">扣分规则</a></li>
<li class="toctree-l4"><a class="reference internal" href="so2/assign2-driver-uart.html#section-9">提交作业</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="so2/assign2-driver-uart.html#section-10">资源</a></li>