《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
资源名称: Embedded Browser 资源版本: 3.0.0 资源类型: .unitypackage 资源大小: 430.5M 更新时间: 2019-08-28
2024-04-08 11:18:12 430.46MB unity
1
Octeon-Linux-kernel-4.14:这是Marvell Octeon Linux内核4.14源代码。 提供“原样”且无支持。 不支持对此代码进行任何更改。 不支持从此来源进行构建
2024-04-06 20:02:37 193.2MB 系统开源
1
linux-2.4.22.tar.bz2内核
2024-04-01 22:38:13 28.16MB linux 2.4.22
1
VBS加载微软网页控件webview2(Edge-Chromium谷歌内核) 代替了ie的webbrowser控件,效果类似: set IE = CreateObject("InternetExplorer.Application") IE.Visible = true IE.Navigate "https://www.baidu.com/"
2024-03-26 14:53:22 3.6MB edge
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
本文介绍了ARM7内核的中断屏蔽方法
2024-03-22 17:39:03 82KB ARM
1
嵌入式主控模块采用了基于ARM7TDMI-S内核的微控制器LPC2148,集成度非常高。内嵌40kB的片内静态RAM和512kB的片内Flash存储器,片内集成ADC、DAC转换器,看门狗,实时时钟RTC,2个UART,2个I2C还有SPI等多个总线接口,及USB2.0全速接口。
2024-03-22 17:23:47 96KB 接口电路 ARM7 技术应用
1