Table of Contents 1. Introduction................................................................................................................5 2. The Players .................................................................................................................6 2.1. User Context .....................................................................................................6 2.2. Hardware Interrupts (Hard IRQs) .....................................................................7 2.3. Software Interrupt Context: Bottom Halves, Tasklets, softirqs ........................7 3. Some Basic Rules........................................................................................................9 4. ioctls: Not writing a new system call ......................................................................10 5. Recipes for Deadlock ...............................................................................................12 6. Common Routines....................................................................................................13 6.1. printk() include/linux/kernel.h.......................................................13 6.2. copy_[to/from]_user() / get_user() / put_user() include/asm/uaccess.h..........................................................................13 6.3. kmalloc()/kfree() include/linux/slab.h.........................................14 6.4. current include/asm/current.h...........................................................15 6.5. local_irq_save()/local_irq_restore() include/asm/system.h15 6.6. local_bh_disable()/local_bh_enable() include/asm/softirq.h 16 6.7. smp_processor_id()/cpu_[number/logical]_map() include/asm/smp.h...................................................................................16 6.8. __init/__exit/__initdata include/linux/init.h.......................................16 6.9. __initcall()/module_init() include/linux/init.h .....................17 6.10. module_exit() include/linux/init.h ..............................................17 6.11. MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT include/linux/module.h 18 7. Wait Queues include/linux/wait.h .................................................................20 7.1. Declaring.........................................................................................................20 7.2. Queuing...........................................................................................................20 7.3. Waking Up Queued Tasks...............................................................................20 8. Atomic Operations...................................................................................................22 9. Symbols .....................................................................................................................23 3 9.1. EXPORT_SYMBOL() include/linux/module.h........................................23 9.2. EXPORT_SYMTAB ............................................................................................23 10. Routines and Conventions.....................................................................................24 10.1. Double-linked lists include/linux/list.h............................................24 10.2. Return Conventions.......................................................................................24 10.3. Breaking Compilation...................................................................................24 10.4. Initializing structure members ......................................................................24 10.5. GNU Extensions ...........................................................................................25 10.6. C++ ...............................................................................................................26 10.7. #if ..................................................................................................................26 11. Putting Your Stuff in the Kernel...........................................................................27 12. Kernel Cantrips......................................................................................................29 13. Thanks.....................................................................................................................31
- 粉丝: 0
- 资源: 5
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于c++的个人收支管理系统设计
- docker一键安装包
- Screenshot_20240430_144340_com.ss.android.ugc.live.jpg
- 回到山沟沟.mp3
- 基于matlab实现自适应波束形成RLS及LMS算法仿真源程序1.rar
- 基于matlab实现自己编写的基于卡尔曼滤波的利用加速度传感器的计步器,测试数据是传感器放在腰部和手臂 .rar
- 基于matlab实现阵列信号处理,波束形成.rar
- 111111111111111111
- 基于matlab实现计步器编程;对当前的计步器装置的数值算法模拟 .rar
- Mdb学习查看PW;access;mdb;pw;password;patch