Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1276 lines (881 loc) · 41 KB
/
Copy pathindex.html
File metadata and controls
1276 lines (881 loc) · 41 KB
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 lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="generator" content="Hugo 0.57.2" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>kernel 字符设备驱动 | WorkSpace</title>
<meta property="og:title" content="kernel 字符设备驱动 - WorkSpace">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2020-04-22T15:14:50+08:00">
<meta property="article:modified_time" content="2020-04-22T15:14:50+08:00">
<meta name="Keywords" content="golang,rust,workerwork,python,c,博客,项目管理,软件架构,公众号,小程序">
<meta name="description" content="kernel 字符设备驱动">
<meta name="author" content="dongfeng">
<meta property="og:url" content="https://workerwork.github.io/posts/kernel-dev/">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/css/normalize.css">
<link rel="stylesheet" href="/css/prism.css">
<link rel="stylesheet" href="/css/style.css">
<script type="text/javascript" src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<header id="header" class="clearfix">
<div class="container">
<div class="col-group">
<div class="site-name ">
<a id="logo" href="https://workerwork.github.io">
WorkSpace
</a>
<p class="description">专注于C、Python、Go、Rust、Shell、项目管理、软件架构</p>
</div>
<div>
<nav id="nav-menu" class="clearfix">
<a class="" href="https://workerwork.github.io">首页</a>
<a href="https://workerwork.github.io/books/" title="笔记">笔记</a>
<a href="https://workerwork.github.io/archives/" title="归档">归档</a>
<a href="https://workerwork.github.io/about/" title="关于">关于</a>
</nav>
</div>
</div>
</div>
</header>
<div id="body">
<div class="container">
<div class="col-group">
<div class="col-8" id="main">
<div class="res-cons">
<article class="post">
<header>
<h1 class="post-title">kernel 字符设备驱动</h1>
</header>
<date class="post-meta meta-date">
2020年4月22日
</date>
<div class="post-meta">
<span>|</span>
<span class="meta-category"><a href="https://workerwork.github.io/categories/kernel">kernel</a></span>
</div>
<div class="post-meta">
<span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span> 阅读</span></span>
</div>
<div class="post-content">
<h2 id="1-字符设备">1. 字符设备</h2>
<p>Linux字符设备是一种按字节来访问的设备,字符驱动则负责驱动字符设备,这样的驱动通常实现open、close、read和write系统调用。例如:串口、Led、按键等</p>
<p>通过字符设备文件(/dev/xxx),应用程序可以使用相应的字符设备驱动来控制字符设备</p>
<p><img src="/kernel-dev/img/001.png" alt="" /></p>
<h2 id="2-如何创建字符设备">2. 如何创建字符设备</h2>
<ol>
<li>使用命令mknod : mknod /dev/文件名 c 主设备号 次设备号 (查看主设备号:cat /proc/devices)</li>
<li><p>使用函数创建:mknod()</p>
<pre><code class="language-shell">int mknod(const char *pathname, mode_t mode, dev_t dev);
</code></pre></li>
</ol>
<h2 id="3-文件系统与字符设备驱动程序之间的关系">3. 文件系统与字符设备驱动程序之间的关系</h2>
<p><img src="/kernel-dev/img/002.png" alt="" /></p>
<ol>
<li><p>在Linux系统中,每一个打开的文件,在内核中都会关联一个struct file结构,它是由内核在打开文件时创建,在文件关闭后释放。</p>
<pre><code class="language-shell">struct file结构中的重要成员
* struct file_operations* f_op; //文件操作函数集
* loff_t f_pos; //文件读写指针
</code></pre></li>
<li><p>每一个存在于文件系统中的文件都会关联一个inode结构,该结构主要用来记录文件物理上的信息。因此,它和代表打开文件的file结构是不同的,一个文件没有被打开时不会关联file结构,但是会关联一个inode结构(存于磁盘,操作文件时在内存中建立相应的映射结构)</p></li>
</ol>
<p>注:inode用于存储文件的元信息(除了文件名的所有信息),中文译名索引节点</p>
<ol>
<li><p>从上图可知,系统实质上是把字符设备的注册表看成了文件。其中chrdevs[]在内核的定义如下</p>
<pre><code class="language-c">static struct char_device_struct {
struct char_device_struct *next;
unsigned int major;
unsigned int baseminor;
int minorct;
char name[64];
struct cdev *cdev; /* will die */
} *chrdevs[CHRDEV_MAJOR_HASH_SIZE];
</code></pre></li>
</ol>
<h2 id="4-在任何一种驱动模型中-设备都会用内核中的一种结构来描述-字符设备在内核中使用struct-cdev来描述">4. 在任何一种驱动模型中,设备都会用内核中的一种结构来描述。字符设备在内核中使用struct cdev来描述</h2>
<pre><code class="language-c">struct cdev {
struct kobject kobj;
struct module *owner;
const struct file_operations *ops; //设备操作函数集
struct list_head list;
dev_t dev; //设备号
unsigned int count; //设备数
};
</code></pre>
<h2 id="5-linux内核中使用dev-t类型来定义设备号-dev-t其实质为32位unsigned-int类型-其中高12位为主设备号-低20位为次设备号">5. Linux内核中使用dev_t类型来定义设备号,dev_t其实质为32位unsigned int类型,其中高12位为主设备号,低20位为次设备号。</h2>
<ol>
<li>MKDEV(主设备号,次设备号)</li>
<li>MAJOR(dev_t dev)</li>
<li>MINOR(dev_t dev)</li>
</ol>
<p>注:字符设备文件与字符设备驱动是通过主设备号建立对应关系;驱动程序用次设备号来区分同类型的设备</p>
<h2 id="6-设备号的申请与注销">6. 设备号的申请与注销</h2>
<ol>
<li>静态申请:开发者自己选择一个数字作为主设备号,通过函数 register_chardev_region 向内核申请</li>
<li>动态分配:使用 alloc_chrdev_region 由内核分配一个可用的主设备号(推荐使用)</li>
<li>不论使用何种方法分配设备号,都应该在驱动退出时,使用 unregister_chrdev_region 函数释放这些设备</li>
</ol>
<h2 id="7-操作函数集-struct-file-operations是一个函数指针的集合-定义能在设备上进行的操作">7. 操作函数集:struct file_operations是一个函数指针的集合,定义能在设备上进行的操作。</h2>
<h2 id="8-字符设备描述结构的分配-注册与注销">8. 字符设备描述结构的分配、注册与注销</h2>
<ul>
<li><p>cdev变量的定义可以采用静态和动态两种方法</p>
<ul>
<li>静态分配:struct cdev mdev;
</li>
<li>动态分配:struct cdev* pdev = cdev_alloc();(可以通过命令:cat /proc/devices查看主设备号)</li>
</ul></li>
<li><p>cdev变量的初始化使用cdev_init()函数来完成</p>
<ul>
<li>void cdev_init(struct cdev *cdev, const struct file_operations *fops)
</li>
<li>cdev: 待初始化的cdev结构
</li>
<li>fops: 设备对应的操作函数集</li>
</ul></li>
<li><p>字符设备的注册使用cdev_add()函数来完成</p></li>
<li><p>字符设备的注销使用cdev_del()函数来完成</p></li>
</ul>
<h2 id="9-设计linux字符设备驱动程序的主要工作">9. 设计Linux字符设备驱动程序的主要工作:</h2>
<ol>
<li>根据外部设备的特点,实现file_operations结构所需要的函数</li>
<li>调用函数cdev_alloc()函数向系统动态申请一个cdev结构实例</li>
<li>调用函数cdev_init()初始化cdev实例,并建立cdev实例与file_operations实例之间的连接</li>
<li>调用函数alloc_chrdev_region()向系统申请一个设备号</li>
<li>调用函数cdev_add()向系统添加一个设备</li>
<li>调用函数cdev_del()从系统删除一个cdev结构实例</li>
</ol>
<p>注:如果把驱动程序制作成一个内核模块,上述的第2、3、4、5步应在模块的初始化函数中实现,而第6步应在模块的卸载函数中实现</p>
<h2 id="10-设备操作-struct-file-operations">10. 设备操作:struct file_operations</h2>
<pre><code class="language-c">struct file_operations {
struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *, fl_owner_t id);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*aio_fsync) (struct kiocb *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
int (*setlease)(struct file *, long, struct file_lock **);
};
</code></pre>
<ul>
<li><p>open: int (*open) (struct inode *, struct file *);(打开设备,响应open系统调用)
open方法是驱动程序用来为以后的操作完成初始化准备工作的。在大部分驱动程序红,open主要完成以下工作:</p>
<ul>
<li><p>标明次设备号</p></li>
<li><p>启动设备</p></li>
</ul></li>
<li><p>release: int (*release) (struct inode *, struct file *);(关闭设备,响应close系统调用)</p></li>
<li><p>llseek: loff_t (*llseek) (struct file *, loff_t, int);(重定位读写指针,响应lseek系统调用)</p></li>
<li><p>read:ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);(从设备读取数据,响应read系统调用)</p></li>
</ul>
<p> ① read设备方法通常完成两件事情</p>
<ul>
<li><p>从设备中读取数据(属于硬件访问类操作)</p></li>
<li><p>将读取到的数据返回给应用程序</p></li>
</ul>
<p> ② ssize_t (*read) (struct file *filp, char __user *buff, size_t count, loff_t *offp)</p>
<p> filp:与字符设备文件关联的file结构,由内核创建</p>
<p> buff:从设备文件读取到的数据,需要保存到的位置。由read系统调用提供该参数</p>
<p> count:请求传输的数据量,由read系统调用提供该参数</p>
<p> offp:文件的读写位置,由内核从file结构中取出后,传递进来</p>
<p> ③ buff参数是来源于用户空间的指针,这类指针都不能被内核代码直接引用,必须使用专门的函数</p>
<pre><code class="language-c">int copy_from_user(void *to, const void __user *from, int n)
int copy_to_user(void __user *to, const void *from, int n)
</code></pre>
<p><img src="/kernel-dev/img/003.png" alt="" /></p>
<ul>
<li><p>write:ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);(向设备写入数据,响应write系统调用)
① write设备方法通常完成2件事情</p>
<ul>
<li>从应用程序提供的地址中取出数据</li>
<li>将数据写入设备(属于硬件访问类操作)</li>
</ul></li>
</ul>
<p>② 其参数类似于read</p>
<h2 id="11-字符设备简单示例">11. 字符设备简单示例</h2>
<p>① 驱动程序 MemDev.c</p>
<pre><code class="language-c">#include <linux/module.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
/* We suppose this is the two device's registers */
int dev1_registers[5];
int dev2_registers[5];
struct cdev cdev;
dev_t devno;
/*文件打开函数*/
int mem_open(struct inode *inode, struct file *filp)
{
/*获取次设备号*/
int num = MINOR(inode->i_rdev);
if (num == 0)
filp->private_data = dev1_registers;
else if(num == 1)
filp->private_data = dev2_registers;
else
return -ENODEV; //无效的次设备号
return 0;
}
/*文件释放函数*/
int mem_release(struct inode *inode, struct file *filp)
{
return 0;
}
/*读函数*/
static ssize_t mem_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos)
{
unsigned long p = *ppos;
unsigned int count = size;
int ret = 0;
int *register_addr = filp->private_data; /*获取设备的寄存器基地址*/
/*判断读位置是否有效*/
if (p >= 5 * sizeof(int))
return 0;
if (count > 5 * sizeof(int) - p)
count = 5 * sizeof(int) - p;
/*读数据到用户空间*/
if (copy_to_user(buf, register_addr + p, count))
{
ret = -EFAULT;
}
else
{
*ppos += count;
ret = count;
}
return ret;
}
/*写函数*/
static ssize_t mem_write(struct file *filp, const char __user *buf, size_t size, loff_t *ppos)
{
unsigned long p = *ppos;
unsigned int count = size;
int ret = 0;
int *register_addr = filp->private_data; /*获取设备的寄存器地址*/
/*分析和获取有效的写长度*/
if (p >= 5*sizeof(int))
return 0;
if (count > 5 * sizeof(int) - p)
count = 5 * sizeof(int) - p;
/*从用户空间写入数据*/
if (copy_from_user(register_addr + p, buf, count))
ret = -EFAULT;
else
{
*ppos += count;
ret = count;
}
return ret;
}
/* seek文件定位函数 */
static loff_t mem_llseek(struct file *filp, loff_t offset, int whence)
{
loff_t newpos;
switch(whence) {
case SEEK_SET:
newpos = offset;
break;
case SEEK_CUR:
newpos = filp->f_pos + offset;
break;
case SEEK_END:
newpos = 5 * sizeof(int) - 1 + offset;
break;
default:
return -EINVAL;
}
if ((newpos < 0) || (newpos > 5 * sizeof(int)))
return -EINVAL;
filp->f_pos = newpos;
return newpos;
}
/*文件操作结构体*/
static const struct file_operations mem_fops =
{
.open = mem_open,
.read = mem_read,
.write = mem_write,
.llseek = mem_llseek,
.release = mem_release,
};
/*设备驱动模块加载函数*/
static int memdev_init(void)
{
/*初始化cdev结构*/
cdev_init(&cdev, &mem_fops);
/* 注册字符设备 */
alloc_chrdev_region(&devno, 0, 2, "memdev");
cdev_add(&cdev, devno, 2);
}
/*模块卸载函数*/
static void memdev_exit(void)
{
cdev_del(&cdev); /*注销设备*/
unregister_chrdev_region(devno, 2); /*释放设备号*/
}
MODULE_LICENSE("GPL");
module_init(memdev_init);
module_exit(memdev_exit);
</code></pre>
<p>② 测试代码MemWrite.c</p>
<pre><code class="language-c">#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
int fd = 0;
int src0[] = {0, 1, 2, 3, 4};
int src1[] = {10, 11, 12, 13, 14};
/*打开设备文件*/
fd = open("/dev/memdev0", O_RDWR);
/*写入数据*/
write(fd, src0, sizeof(src0));
/*关闭设备*/
close(fd);
fd = open("/dev/memdev1", O_RDWR);
/*写入数据*/
write(fd, src1, sizeof(src1));
/*关闭设备*/
close(fd);
return 0;
}
</code></pre>
<p>③测试代码MemRead.c</p>
<pre><code class="language-c">#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main()
{
int fd = 0;
int dst = 0;
/*打开设备文件*/
fd = open("/dev/memdev0", O_RDWR);
lseek(fd, 2, SEEK_SET);
/*写入数据*/
read(fd, &dst, sizeof(int));
printf("dst0 is %d\n", dst);
/*关闭设备*/
close(fd);
/*打开设备文件*/
fd = open("/dev/memdev1", O_RDWR);
lseek(fd, 3, SEEK_SET);
/*写入数据*/
read(fd, &dst, sizeof(int));
printf("dst1 is %d\n", dst);
/*关闭设备*/
close(fd);
return 0;
}
</code></pre>
<p>④ 测试步骤</p>
<p>(1)安装驱动模块:insmod MemDev.ko</p>
<p>(2)查看主设备号:cat /proc/devices(查找memdev对应的主设备号)</p>
<p>(3)创建设备文件:mknod /dev/memdev0 c 主设备号 0</p>
<p>(4)运行测试代码进行测试</p>
<h2 id="12-实例">12. 实例</h2>
<p><a href="https://github.com/workerwork/kernel-dev">https://github.com/workerwork/kernel-dev</a></p>
</div>
<br>
<br>
<div class="post-archive">
<h2>See Also</h2>
<ul class="listing">
<li><a href="/posts/kernel-module/">kernel module编程</a></li>
<li><a href="/posts/self-kernel/">linux内核定制</a></li>
<li><a href="/posts/affinity/">cpu亲和性</a></li>
<li><a href="/posts/wcg-kernel/">WCG内核修改</a></li>
<li><a href="/posts/centos-iso/">制作CentOS ISO</a></li>
</ul>
</div>
<div class="post-meta meta-tags">
<ul class="clearfix">
<li><a href="https://workerwork.github.io/tags/kernel">kernel</a></li>
<li><a href="https://workerwork.github.io/tags/device">device</a></li>
<li><a href="https://workerwork.github.io/tags/linux">linux</a></li>
</ul>
</div>
</article>
<div id="vcomments"></div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script type="text/javascript">
new Valine({
el: '#vcomments' ,
appId: '2t4DpILldEkd0cGL96gyV1IM-gzGzoHsz',
appKey: 'YVysijaVMqjziCECLGL8jnCh',
notify: 'false',
verify: 'false',
avatar:'mm',
placeholder: '说点什么吧...',
visitor: 'true'
});
</script>
</div>
</div>
<div id="secondary">
<section class="widget">
<form id="search" action="//www.google.com/search" method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
<input type="text" name="q" maxlength="20" placeholder="Search">
<input type="hidden" name="sitesearch" value="https://workerwork.github.io">
<button type="submit" class="submit icon-search"></button>
</form>
</section>
<section class="widget">
<h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
<li>
<a href="https://workerwork.github.io/posts/build-5gc/" title="BUILD 5GC">BUILD 5GC</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/checksum/" title="linux checksum">linux checksum</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/sub-bin/" title="二进制瘦身">二进制瘦身</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/export-symbol/" title="EXPORT SYMBOL">EXPORT SYMBOL</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/vpp-kernel/" title="vpp和linux内核协议栈通信">vpp和linux内核协议栈通信</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/xfrm/" title="xfrm框架">xfrm框架</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/oom-killer/" title="oom killer">oom killer</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/gcc/" title="linux gcc编译">linux gcc编译</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/core/" title="linux coredump设置">linux coredump设置</a>
</li>
<li>
<a href="https://workerwork.github.io/posts/rustdoc/" title="rustdoc 范例">rustdoc 范例</a>
</li>
</ul>
</section>
<section class="widget">
<h3 class="widget-title">分类</h3>
<ul class="widget-list">
<li>
<a href="https://workerwork.github.io/categories/5g/">5g(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/crash/">crash(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/devops/">devops(9)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/dpdk/">dpdk(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/hugo/">hugo(2)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/ipc/">ipc(2)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/kernel/">kernel(4)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/linux/">linux(22)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/p4/">p4(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/python/">python(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/rust/">rust(2)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/servers/">servers(7)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/shell/">shell(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/site/">site(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/ubuntu/">ubuntu(1)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/vpp/">vpp(7)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/%E4%BA%A7%E5%93%81doc/">产品doc(2)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/%E5%AE%89%E5%85%A8/">安全(2)</a>
</li>
<li>
<a href="https://workerwork.github.io/categories/%E8%99%9A%E6%8B%9F%E5%8C%96/">虚拟化(2)</a>
</li>
</ul>
</section>
<section class="widget">
<h3 class="widget-title">标签</h3>
<div class="tagcloud">
<a href="https://workerwork.github.io/tags/5gc/">5gc</a>
<a href="https://workerwork.github.io/tags/apt/">apt</a>
<a href="https://workerwork.github.io/tags/auto/">auto</a>
<a href="https://workerwork.github.io/tags/bin/">bin</a>
<a href="https://workerwork.github.io/tags/build-5gc/">build-5gc</a>
<a href="https://workerwork.github.io/tags/caddy/">caddy</a>
<a href="https://workerwork.github.io/tags/centos/">centos</a>
<a href="https://workerwork.github.io/tags/checksum/">checksum</a>
<a href="https://workerwork.github.io/tags/ci/cd/">ci/cd</a>
<a href="https://workerwork.github.io/tags/cli/">cli</a>
<a href="https://workerwork.github.io/tags/core/">core</a>
<a href="https://workerwork.github.io/tags/coredump/">coredump</a>
<a href="https://workerwork.github.io/tags/cpu/">cpu</a>
<a href="https://workerwork.github.io/tags/crash/">crash</a>
<a href="https://workerwork.github.io/tags/deb/">deb</a>
<a href="https://workerwork.github.io/tags/debootstrap/">debootstrap</a>
<a href="https://workerwork.github.io/tags/deb%E6%89%93%E5%8C%85/">deb打包</a>
<a href="https://workerwork.github.io/tags/device/">device</a>
<a href="https://workerwork.github.io/tags/doc/">doc</a>
<a href="https://workerwork.github.io/tags/docker/">docker</a>
<a href="https://workerwork.github.io/tags/docker-compose/">docker-compose</a>
<a href="https://workerwork.github.io/tags/dockerfile/">dockerfile</a>
<a href="https://workerwork.github.io/tags/dpdk/">dpdk</a>
<a href="https://workerwork.github.io/tags/drone/">drone</a>
<a href="https://workerwork.github.io/tags/en-strip/">en-strip</a>
<a href="https://workerwork.github.io/tags/epc/">epc</a>
<a href="https://workerwork.github.io/tags/fpm/">fpm</a>
<a href="https://workerwork.github.io/tags/frp/">frp</a>
<a href="https://workerwork.github.io/tags/game/">game</a>
<a href="https://workerwork.github.io/tags/gcc/">gcc</a>
<a href="https://workerwork.github.io/tags/git/">git</a>
<a href="https://workerwork.github.io/tags/github/">github</a>
<a href="https://workerwork.github.io/tags/gitlab/">gitlab</a>
<a href="https://workerwork.github.io/tags/gogs/">gogs</a>
<a href="https://workerwork.github.io/tags/gso/">gso</a>
<a href="https://workerwork.github.io/tags/ha/">ha</a>
<a href="https://workerwork.github.io/tags/hugo/">hugo</a>
<a href="https://workerwork.github.io/tags/ipc/">ipc</a>
<a href="https://workerwork.github.io/tags/ipsec/">ipsec</a>
<a href="https://workerwork.github.io/tags/iso/">iso</a>
<a href="https://workerwork.github.io/tags/jenkins/">jenkins</a>
<a href="https://workerwork.github.io/tags/k8s/">k8s</a>
<a href="https://workerwork.github.io/tags/keepalived/">keepalived</a>
<a href="https://workerwork.github.io/tags/kernel/">kernel</a>
<a href="https://workerwork.github.io/tags/kube/">kube</a>
<a href="https://workerwork.github.io/tags/kubernetes/">kubernetes</a>
<a href="https://workerwork.github.io/tags/kvm/">kvm</a>
<a href="https://workerwork.github.io/tags/linux/">linux</a>
<a href="https://workerwork.github.io/tags/module/">module</a>
<a href="https://workerwork.github.io/tags/objcopy/">objcopy</a>
<a href="https://workerwork.github.io/tags/offload/">offload</a>
<a href="https://workerwork.github.io/tags/oom-killer/">oom-killer</a>
<a href="https://workerwork.github.io/tags/openssh/">openssh</a>
<a href="https://workerwork.github.io/tags/p4/">p4</a>
<a href="https://workerwork.github.io/tags/pip/">pip</a>
<a href="https://workerwork.github.io/tags/plugin/">plugin</a>
<a href="https://workerwork.github.io/tags/pypi/">pypi</a>
<a href="https://workerwork.github.io/tags/python/">python</a>
<a href="https://workerwork.github.io/tags/redis/">redis</a>
<a href="https://workerwork.github.io/tags/remote-desktop/">remote-desktop</a>
<a href="https://workerwork.github.io/tags/rpm/">rpm</a>
<a href="https://workerwork.github.io/tags/rpm%E6%89%93%E5%8C%85/">rpm打包</a>
<a href="https://workerwork.github.io/tags/rust/">rust</a>
<a href="https://workerwork.github.io/tags/sdl2/">sdl2</a>
<a href="https://workerwork.github.io/tags/security/">security</a>
<a href="https://workerwork.github.io/tags/server/">server</a>
<a href="https://workerwork.github.io/tags/shell/">shell</a>
<a href="https://workerwork.github.io/tags/shm/">shm</a>
<a href="https://workerwork.github.io/tags/socket/">socket</a>
<a href="https://workerwork.github.io/tags/strip/">strip</a>
<a href="https://workerwork.github.io/tags/strongswan/">strongswan</a>
<a href="https://workerwork.github.io/tags/symbol/">symbol</a>
<a href="https://workerwork.github.io/tags/system-map/">system-map</a>
<a href="https://workerwork.github.io/tags/tso/">tso</a>
<a href="https://workerwork.github.io/tags/ubuntu/">ubuntu</a>
<a href="https://workerwork.github.io/tags/upf/">upf</a>
<a href="https://workerwork.github.io/tags/video/">video</a>
<a href="https://workerwork.github.io/tags/vm/">vm</a>
<a href="https://workerwork.github.io/tags/vmcore/">vmcore</a>
<a href="https://workerwork.github.io/tags/vmess/">vmess</a>
<a href="https://workerwork.github.io/tags/vpp/">vpp</a>
<a href="https://workerwork.github.io/tags/wcg/">wcg</a>
<a href="https://workerwork.github.io/tags/workspace/">workspace</a>
<a href="https://workerwork.github.io/tags/xfrm/">xfrm</a>
<a href="https://workerwork.github.io/tags/yum/">yum</a>
<a href="https://workerwork.github.io/tags/%E4%BB%A3%E7%90%86/">代理</a>
<a href="https://workerwork.github.io/tags/%E4%BC%98%E5%8C%96/">优化</a>
<a href="https://workerwork.github.io/tags/%E5%90%AF%E5%8A%A8%E7%9B%98/">启动盘</a>
<a href="https://workerwork.github.io/tags/%E7%BD%91%E5%8D%A1%E5%91%BD%E5%90%8D/">网卡命名</a>
<a href="https://workerwork.github.io/tags/%E8%99%9A%E6%9C%BA/">虚机</a>
</div>
</section>
<section class="widget">
<h3 class="widget-title">友情链接</h3>
<ul class="widget-list">
<li>
<a target="_blank" href="https://www.teambition.com/" title="teambition">teambition</a>
</li>
<li>
<a target="_blank" href="https://www.yuque.com/" title="语雀">yuque</a>
</li>
<li>
<a target="_blank" href="https://www.bookstack.cn/" title="书栈网">bookstack</a>
</li>
<li>
<a target="_blank" href="https://www.bookstack.cn/read/sdn-handbook/SUMMARY.md" title="SDN技术栈">SDN技术栈</a>
</li>
<li>
<a target="_blank" href="https://www.kdocs.cn/" title="在线文档">wps</a>
</li>
<li>
<a target="_blank" href="https://www.youtube.com/" title="youtube">youtube</a>
</li>
<li>
<a target="_blank" href="https://vimeo.com/" title="vimeo">vimeo</a>
</li>
<li>
<a target="_blank" href="https://www.wikipedia.org/" title="维基">维基</a>
</li>
<li>
<a target="_blank" href="https://thepiratebay.org/index.html" title="海盗湾">海盗湾</a>
</li>
<li>
<a target="_blank" href="https://thekickasstorrents.to/" title="KickassTorrents">KickassTorrents</a>
</li>