Chinaunix首页 | 论坛 | 博客
  • 博客访问: 438267
  • 博文数量: 67
  • 博客积分: 2468
  • 博客等级: 上尉
  • 技术积分: 1050
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-05 01:21
文章分类

全部博文(67)

文章存档

2013年(1)

2012年(65)

2011年(1)

分类: 嵌入式

2012-02-18 21:43:37

1,分散/聚集(SG,scatter/gather)操作?
       http://blog.chinaunix.net/space.php?uid=20774181&do=blog&id=1847063,
       我不得不感叹,百度都没有站内搜索好用。多谢CUers!

2,看看内核block目录
      其中,Makefile内容为:(然后就迷茫了,初始block驱动!)
  1. #
  2. # Makefile for the kernel block layer
  3. #

  4. obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
  5. blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \
  6. blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
  7. blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o

  8. obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
  9. obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
  10. obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
  11. obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
  12. obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o

  13. obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
  14. obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
3,“反弹”缓冲区??
       我晕,在书里找不到了。看来下次还是得记下页码。没有找到所谓的“反弹”缓冲区的感念,看来有些理解不能脱离上下文,不一定是标准的。

4,struct block_device
       在源码/include/linux/fs.h中:
  1. struct block_device {
  2.     dev_t            bd_dev; /* not a kdev_t - it's a search key */
  3.     struct inode *        bd_inode;    /* will die */
  4.     struct super_block *    bd_super;
  5.     int            bd_openers;
  6.     struct mutex        bd_mutex;    /* open/close mutex */
  7.     struct list_head    bd_inodes;
  8.     void *            bd_claiming;
  9.     void *            bd_holder;
  10.     int            bd_holders;
  11. #ifdef CONFIG_SYSFS
  12.     struct list_head    bd_holder_list;
  13. #endif
  14.     struct block_device *    bd_contains;
  15.     unsigned        bd_block_size;
  16.     struct hd_struct *    bd_part;
  17.     /* number of times partitions within this device have been opened. */
  18.     unsigned        bd_part_count;
  19.     int            bd_invalidated;
  20.     struct gendisk *    bd_disk;
  21.     struct list_head    bd_list;
  22.     /*
  23.      * Private data. You must have bd_claim'ed the block_device
  24.      * to use this. NOTE: bd_claim allows an owner to claim
  25.      * the same device multiple times, the owner must take special
  26.      * care to not mess up bd_private for that case.
  27.      */
  28.     unsigned long        bd_private;

  29.     /* The counter of freeze processes */
  30.     int            bd_fsfreeze_count;
  31.     /* Mutex for freeze */
  32.     struct mutex        bd_fsfreeze_mutex;
  33. };

5,drivers/block/floppy.c

6,inode, vnode, blocks???
       这个帖子还不错!
       难道对于Unix系列的操作系统,大多都有v节点。但是对于linux来说,只有通用的i节点,却没有v节点吗???

7,书内vmem_disk的驱动????
      #遗留问题啊~~~~

8,硬盘基本知识(磁道、扇区、柱面、磁头数、簇、MBR、DBR)?
     

9,块设备的读写,核心是“请求处理函数  和   请求'制造'函数”?
      那么块设备的读写是怎么完成的呢?靠映射,由内核其它部分来处理……真心没有搞懂!


阅读(1338) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~