免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: 勿丑于
打印 上一主题 下一主题

结贴 [复制链接]

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
101 [报告]
发表于 2009-08-05 16:49 |只看该作者
原帖由 richardhesidu 于 2009-8-5 16:31 发表
3. Linux的实现技术,比如sockets, softirqs等。

请教一下,
1, 软中断和tasklet最显著的区别在哪里?
2, 我有一个防火墙设备,内核是linux,没有自己的ip,要怎么在应用层抓到防火墙保护的网站服务器发出 ...


刚开始学Linux的kernel,一直做应用来着
问一下

第一个问题是不是我该看下面这段啊?

  1. 398 /* Tasklets --- multithreaded analogue of BHs.
  2. 399
  3. 400    Main feature differing them of generic softirqs: tasklet
  4. 401    is running only on one CPU simultaneously.
  5. 402
  6. 403    Main feature differing them of BHs: different tasklets
  7. 404    may be run simultaneously on different CPUs.
  8. 405
  9. 406    Properties:
  10. 407    * If tasklet_schedule() is called, then tasklet is guaranteed
  11. 408      to be executed on some cpu at least once after this.
  12. 409    * If the tasklet is already scheduled, but its excecution is still not
  13. 410      started, it will be executed only once.
  14. 411    * If this tasklet is already running on another CPU (or schedule is called
  15. 412      from tasklet itself), it is rescheduled for later.
  16. 413    * Tasklet is strictly serialized wrt itself, but not
  17. 414      wrt another tasklets. If client needs some intertask synchronization,
  18. 415      he makes it with spinlocks.
  19. 416  */
复制代码

  1. 879 /**
  2. 880  *  request_threaded_irq - allocate an interrupt line
  3. 881  *  @irq: Interrupt line to allocate
  4. 882  *  @handler: Function to be called when the IRQ occurs.
  5. 883  *        Primary handler for threaded interrupts
  6. 884  *  @thread_fn: Function called from the irq handler thread
  7. 885  *          If NULL, no irq thread is created
  8. 886  *  @irqflags: Interrupt type flags
  9. 887  *  @devname: An ascii name for the claiming device
  10. 888  *  @dev_id: A cookie passed back to the handler function
  11. 889  *
  12. 890  *  This call allocates interrupt resources and enables the
  13. 891  *  interrupt line and IRQ handling. From the point this
  14. 892  *  call is made your handler function may be invoked. Since
  15. 893  *  your handler function must clear any interrupt the board
  16. 894  *  raises, you must take care both to initialise your hardware
  17. 895  *  and to set up the interrupt handler in the right order.
  18. 896  *
  19. 897  *  If you want to set up a threaded irq handler for your device
  20. 898  *  then you need to supply @handler and @thread_fn. @handler ist
  21. 899  *  still called in hard interrupt context and has to check
  22. 900  *  whether the interrupt originates from the device. If yes it
  23. 901  *  needs to disable the interrupt on the device and return
  24. 902  *  IRQ_WAKE_THREAD which will wake up the handler thread and run
  25. 903  *  @thread_fn. This split handler design is necessary to support
  26. 904  *  shared interrupts.
  27. 905  *
  28. 906  *  Dev_id must be globally unique. Normally the address of the
  29. 907  *  device data structure is used as the cookie. Since the handler
  30. 908  *  receives this value it makes sense to use it.
  31. 909  *
  32. 910  *  If your interrupt is shared you must pass a non NULL dev_id
  33. 911  *  as this is required when freeing the interrupt.
  34. 912  *
  35. 913  *  Flags:
  36. 914  *
  37. 915  *  IRQF_SHARED     Interrupt is shared
  38. 916  *  IRQF_DISABLED   Disable local interrupts while processing
  39. 917  *  IRQF_SAMPLE_RANDOM  The interrupt can be used for entropy
  40. 918  *  IRQF_TRIGGER_*      Specify active edge(s) or level
  41. 919  *
  42. 920  */
复制代码

论坛徽章:
0
102 [报告]
发表于 2009-08-05 16:49 |只看该作者
原帖由 epegasus 于 2009-8-5 16:46 发表

浏览器有时会崩溃掉,我已经懒得重装和修复了.


实在不行就用lynx吧,感觉挺好!

论坛徽章:
0
103 [报告]
发表于 2009-08-05 16:50 |只看该作者
原帖由 T-bagwell 于 2009-8-5 16:49 发表


刚开始学Linux的kernel,一直做应用来着
问一下

第一个问题是不是我该看下面这段啊?

398 /* Tasklets --- multithreaded analogue of BHs.
399
400    Main feature differing them of generic s ...


扔掉所有的注释。

代码里面的可以看一下,但那绝对不是重点。

[ 本帖最后由 勿丑于 于 2009-8-5 16:57 编辑 ]

论坛徽章:
0
104 [报告]
发表于 2009-08-05 16:52 |只看该作者
原帖由 richardhesidu 于 2009-8-5 16:49 发表


你那种问题还叫问题呀,自己的工作范围而已,拿到论坛里显什么?

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
105 [报告]
发表于 2009-08-05 16:59 |只看该作者
原帖由 勿丑于 于 2009-8-5 16:50 发表


扔掉所有的注释。

代码里面的可以看一下,但那绝对不是重点。


我觉得不买书也可以,Linux的代码的注释就说得很详细了
我想,我大概知道一点点他们的区别了,下班后试验一下,嘿嘿

论坛徽章:
0
106 [报告]
发表于 2009-08-05 17:02 |只看该作者
原帖由 T-bagwell 于 2009-8-5 16:59 发表


我觉得不买书也可以,Linux的代码的注释就说得很详细了
我想,我大概知道一点点他们的区别了,下班后试验一下,嘿嘿


你一定能成功!就凭你说实验这两个字。

论坛徽章:
0
107 [报告]
发表于 2009-08-05 17:03 |只看该作者
原帖由 T-bagwell 于 2009-8-5 16:59 发表


我觉得不买书也可以,Linux的代码的注释就说得很详细了
我想,我大概知道一点点他们的区别了,下班后试验一下,嘿嘿


书的话,毛德操的那本我觉得挺好,你可以参考一下!

论坛徽章:
0
108 [报告]
发表于 2009-08-05 17:13 |只看该作者

回复 #1 勿丑于 的帖子

不懂得太多了...回家好好看书去了...

论坛徽章:
0
109 [报告]
发表于 2009-08-05 17:26 |只看该作者
原帖由 edgar51774 于 2009-8-5 17:13 发表
不懂得太多了...回家好好看书去了...


不必的

论坛徽章:
0
110 [报告]
发表于 2009-08-05 18:01 |只看该作者
今天估计就到这里了,明天我不来了,我在网吧上网的,昨天呀,聊的比较投机,回去已经没有车了,我从镇上走回去了,呵呵,15里路。路上,大卡车拉着货呼呼的跑。

谁帮忙顶这个帖子,我在这万分感激。

认为我在空谈的人,继续你们的观点吧,不要告诉我,我没有影响你。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP