Linux内核完全注释》,作者:赵烔 PDF格式,非扫描版,可搜索。 免费,欢迎下载!
2024-04-18 17:13:31 5.38MB linux内核 完全注释
1
Linux内核完全注释V3 0 pdf》 + Linux 0 11注释源码 + Linux 0 12 源码 这是由赵炯所写的 是Linux 内核开发来说相当不错的书籍 附带有注释的0 11源码 还有原生没注释的0 12源码 可以在source inside中对照查看 方便查找 对于学习内核是相当有帮助的 参考源码示例: 0 11注释 "schedule " is the scheduler function This is GOOD CODE There probably won"t be any reason to change this as it should work well in all circumstances ie gives IO bound processes good response etc The one thing you might take a look at is the signal handler code here NOTE Task 0 is the "idle" task which gets called when no other tasks can run It can not be killed and it cannot sleep The "state" information in task[0] is never used "schedule "是调度函数 这是个很好的代码 没有任何理由对它进行修改 因为它可以在所有的 环境下工作(比如能够对IO 边界处理很好的响应等) 只有一件事值得留意 那就是这里的信号 处理代码 注意 任务0 是个闲置 "idle" 任务 只有当没有其它任务可以运行时才调用它 它不能被杀 死 也不能睡眠 任务0 中的状态信息"state"是从来不用的 void schedule void { int i next c; struct task struct p; 任务结构指针的指针 check alarm wake up any interruptible tasks that have got a signal 检测alarm(进程的报警定时值) 唤醒任何已得到信号的可中断任务 从任务数组中最后一个任务开始检测alarm for p &LAST; TASK; p > &FIRST; TASK; p if p { 如果任务的alarm 时间已经过期 alarm<jiffies 则在信号位图中置SIGALRM 信号 然后清alarm jiffies 是系统从开机开始算起的滴答数(10ms 滴答) 定义在sched h 第139 行 if p >alarm && p >alarm < jiffies { p >signal | 1 << SIGALRM 1 ; p >alarm 0; } 如果信号位图中除被阻塞的信号外还有其它信号 并且任务处于可中断状态 则置任务为就绪状态 其中" BLOCKABLE & p >blocked "用于忽略被阻塞的信号 但SIGKILL 和SIGSTOP 不能被阻塞 if p >signal & BLOCKABLE & p >blocked && p >state TASK INTERRUPTIBLE p >state TASK RUNNING; 置为就绪(可执行)状态 } this is the scheduler proper: 这里是调度程序的主要部分 while 1 { c 1; next 0; i NR TASKS; p &task;[NR TASKS]; 这段代码也是从任务数组的最后一个任务开始循环处理 并跳过不含任务的数组槽 比较每个就绪 状态任务的counter(任务运行时间的递减滴答计数)值 哪一个值大 运行时间还不长 next 就 指向哪个的任务号 while i { if p continue; if p >state TASK RUNNING && p >counter > c c p >counter next i; } 如果比较得出有counter 值大于0 的结果 则退出124 行开始的循环 执行任务切换(141 行) if c break; 否则就根据每个任务的优先权值 更新每一个任务的counter 值 然后回到125 行重新比较 counter 值的计算方式为counter counter 2 + priority [右边counter 0 ] for p &LAST; TASK; p > &FIRST; TASK; p if p p >counter p >counter >> 1 + p >priority; } switch to next ; 切换到任务号为next 的任务 并运行之 } 0 12 "schedule " is the scheduler function This is GOOD CODE There probably won"t be any reason to change this as it should work well in all circumstances ie gives IO bound processes good response etc The one thing you might take a look at is the signal handler code here NOTE Task 0 is the "idle" task which gets called when no other tasks can run It can not be killed and it cannot sleep The "state" information in task[0] is never used void schedule void { int i next c; struct task struct p; check alarm wake up any interruptible tasks that have got a signal for p &LAST; TASK ; p > &FIRST; TASK ; p if p { if p >timeout && p >timeout < jiffies { p >timeout 0; if p >state TASK INTERRUPTIBLE p >state TASK RUNNING; } if p >alarm && p >alarm < jiffies { p >signal | 1<< SIGALRM 1 ; p >alarm 0; } if p >signal & BLOCKABLE & p >blocked && p >state TASK INTERRUPTIBLE p >state TASK RUNNING; } this is the scheduler proper: while 1 { c 1; next 0; i NR TASKS; p &task;[NR TASKS]; while i { if p continue; if p >state TASK RUNNING && p >counter > c c p >counter next i; } if c break; for p &LAST; TASK ; p > &FIRST; TASK ; p if p p >counter p >counter >> 1 + p >priority; } switch to next ; }">《Linux内核完全注释V3 0 pdf》 + Linux 0 11注释源码 + Linux 0 12 源码 这是由赵炯所写的 是Linux 内核开发来说相当不错的书籍 附带有注释的0 11源码 还有原生没注释的0 12源码 可以在source inside中对照查看 方便查找 对于学习 [更多]
2024-04-18 17:11:19 7.5MB V0.12 Linux
1
Octeon-Linux-kernel-4.14:这是Marvell Octeon Linux内核4.14源代码。 提供“原样”且无支持。 不支持对此代码进行任何更改。 不支持从此来源进行构建
2024-04-06 20:02:37 193.2MB 系统开源
1
Linux内核精髓-精通Linux内核必会的75个绝技,高清版本,有目录,1-8章节都有
2024-03-24 11:54:17 40.69MB Linux 内核精髓
1
资源名称:Linux内核精髓-精通Linux内核必会的75个绝技(带书签高清完整版)资源截图: 资源太大,传百度网盘了,链接在附件中,有需要的同学自取。
2024-03-24 11:50:06 125B
1
linux内核完全剖析.pdf
2024-03-19 20:19:39 7.61MB linux内核
1
Linux内核函数Start_kernel()中调用了一系列初始化函数,以完成kernel本身的设置。这些动作有的是公共的,有的则是需要配置的才会执行的。本文介绍了在start_kernel()函数中的一些功能。
2024-03-03 09:20:27 27KB 职场管理
1
这是Linux kernel的源代码,值得大家认真学习研究哦。Linux万岁,分享万岁!
2024-02-04 16:02:43 3.26MB Linux kernel source code
1
独辟蹊径品内核 LINUX内核源代码导读!
2024-02-04 15:50:15 43.17MB 独辟蹊径 LINUX 内核源代码
1
Linux内核完全注释 V3.0对Linux早期操作系统内核(v0.11)全部代码文件进行了详细全面的注释和说明,旨在使读者能够在尽量短的时间内对Linux的工作机理获得全面而深刻的理解,为进一步学习和研究Linux系统打下坚实的基础。书中首先以Linux源代码版本的变迁历史为主线,详细介绍了Linux系统的发展历史,着重说明了各个内核版本之间的重要区别和改进方面,给出了选择0.11(0.95)版作为研究的对象的原因。然后本书依据内核源代码的组织结构对所有内核程序和文件进行了注释和详细说明。 在注释的同时,还介绍了读者应该了解的相关知识,并给出了相关的硬件信息。
2024-02-02 17:01:35 7.52MB Linux内核 linux源码分析
1