Linux????????????璞�?????????????璞�?????璞�
???????????? ???????[ 2013/5/7 9:57:29 ] ????????
????????????????????????璞�????????????????璞�???1??????LANANA????????璞�??10?????????璞�??????????????????????????些??????????????泄???????谐??些???璞�???????????????????濉�
??1 ???????璞�??1????????璞�??
?????些?璞�?????????????????/dev/null???????璞�??????????????????????????些???璞�???婕�????????????????????泻??????????????1?????璞�???1??memory_fops?卸???????些??????????????锟�?
????driver/char/mem.c
static const struct file_operations memory_fops = {
.open = memory_open??
.llseek = noop_llseek??
};
???????泻???memory_open???????????????????璞�????????璞�??????????
static int memory_open(struct inode *inode?? struct file *filp)
{
int minor;
const struct memdev *dev;
minor = iminor(inode); /* get the minor device number commented by guoqingbo */
if (minor >= ARRAY_SIZE(devlist))
return -ENXIO;
dev = &devlist[minor];/* select the specific file_operations */
if (!dev->fops)
return -ENXIO;
filp->f_op = dev->fops;
if (dev->dev_info)
filp->f_mapping->backing_dev_info = dev->dev_info;
/* Is /dev/mem or /dev/kmem ? */
if (dev->dev_info == &directly_mappable_cdev_bdi)
filp->f_mode |= FMODE_UNSIGNED_OFFSET;
if (dev->fops->open) //open the device
return dev->fops->open(inode?? filp);
return 0;
}
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11