linuxÇý¶¯¿ª·¢Ñ§Ï°±Ê¼Ç£¨¶þ£©
scull×Ö·ûÇý¶¯Ñ§Ï°±Ê¼Ç
Ŀ¼
1 scullÇý¶¯¼ò½é
2 Ö÷´Î±àºÅ
3 scullÔ´Âë·ÖÎö
-------------------------
| 1 scullÇý¶¯¼ò½é |
-------------------------
scullÊÇÒ»¸ö×Ö·ûÇý¶¯£¬ÎÒÃDzÙ×÷Ò»¿éÄÚ´æÇøºÃÏñËüÊÇÒ»¸öÉ豸¡£scullÊÇÓ²¼þÉ豸¹ØÁª²»´ó£¬ ËùÒÔËüÊÇͨÓÿÉÒÆÖ²µÄ¡£
-----------------------
| 2 Ö÷´Î±àºÅ |
----------------------
2.1
Ëæ±ãÌáÌáÖ÷´Î±àºÅ°É£¡
×Ö·ûÉ豸ͨ¹ýÎļþϵͳÖеÄÃû×ÖÀ´´æÈ¡£¬Ò²¾ÍÊdz£ËµµÄÉ豸Îļþ¡£ÎÒÃDz鿴/devĿ¼ÏµÄÎļþ£¬»á²é¿´µ½ÏµÍ³ÏÂËùÓÐÉ豸Îļþ¡£
Ö÷±àºÅ±êʶÉ豸ÏàÁ¬µÄÇý¶¯¡£´Î±àºÅÓÃÀ´¾ö¶¨ÒýÓÃÄĸöÉ豸£¬ÒÀ¾ÝÄãµÄÇý¶¯ÊÇÈçºÎ±àдµÄ£¬ Äã¿ÉÒÔ´ÓÄں˵õ½Ò»¸öÄãµÄÉ豸µÄÖ±½ÓÖ¸Õë¡£ÄÚºËÔÊÐí¶à¸öÇý¶¯¹²ÏíÖ÷±àºÅ¡£
2.2
һЩÖ÷É豸±àºÅÊǾ²Ì¬·Ö¸ø×îÆÕͨµÄÉ豸µÄ£¬¶ÔÓÚÐÂÇý¶¯£¬´ó¶àÊýÇé¿öÏÂʹÓö¯Ì¬·ÖÅäÀ´»ñÈ¡ÄãµÄÖ÷É豸ºÅ¡£
¶¯Ì¬·ÖÅäÖ÷É豸ºÅº¯Êý
alloc_chrdev_region
¶¯Ì¬·ÖÅäµÄȱµãÊÇÄãÎÞ·¨ÌáÇ°´´½¨É豸½Úµã, ÒòΪ·ÖÅä¸øÄãµÄÄ£¿éµÄÖ÷±àºÅ»á±ä»¯. ¶ÔÓÚÇý¶¯µÄÕý³£Ê¹ÓÃ, Õâ²»ÊÇÎÊÌâ, ÒòΪһµ©±àºÅ·ÖÅäÁË, Äã¿É´Ó /proc/devices ÖжÁÈ¡Ëü¡£ÎªÊ¹Óö¯Ì¬Ö÷±àºÅÀ´¼ÓÔØÒ»¸öÇý¶¯, Òò´Ë, ¿ÉʹÓÃÒ»¸ö¼òµ¥µÄ½Å±¾À´´úÌæµ÷Óà insmod, ÔÚµ÷ÓÃinsmod ºó, ¶ÁÈ¡ /proc/devices À´´´½¨ÌØÊâÎļþ.
ÔÚscullÔ´ÂëÖлñÈ¡Ö÷±àºÅµÄ´úÂë
if (scull_major) {
dev = MKDEV(scull_major, scull_minor);
result = register_chrdev_region(dev, scull_nr_devs, "scull");
} else {
result = alloc_chrdev_region(&dev, scull_minor, scull_nr_devs, "scull");
scull_major = MAJOR(dev);
}
if (result < 0) {
printk(KERN_WARNING "scull: can't get major %d\n", scull_major);
return result;
}
-------------------
| 3 scullÔ´Âë·ÖÎö |
-------------------
scull É豸½á¹¹Ìå
struct scull_dev {
struct scull_qset *data; /* Pointer to first quantum se
Ïà¹ØÎĵµ£º
Ò»°ãÀ´Ëµ£¬Ä¿Ç°Ð°æµÄ Linux Ô¤Éè¿ÉÒÔÖ§³ÖµÄÍøÂ翨оƬ×éÊýÁ¿ÒѾºÜÍ걸ÁË£¬ºÜ¶àÍøÂ翨оƬ¶¼ÒѾ±»Ö§³Ö,ÀýÈçRLT 8139 оƬ ( RealTek 8139 ) µÄÍøÂ翨ËùÒÔʹÓÃÕß¿ÉÒÔºÜÇáÒ×µÄÉ趨ºÃËûÃǵÄÍøÂ翨¡£²»¹ý£¬Èç¹ûÍòÒ»²»ÐÒºËÐÄûÓÐÖ§³Ö¸ÃÍøÂ翨µÄ»°£¬ÄÇô¿ÉÒÔ͸¹ýÖØбàÒëºËÐÄ»òÕß±àÒëÍøÂ翨Çý¶¯Ä£¿é ( Modul ......
Òýµ¼£º
ÈçÐè»ñµÃ¶Ô vmlinux ºÍ zimage Ö®¼äÇø±ðµÄ¼«ºÃ½âÊÍ£¬ÇëÔÚ Alessandro Rubini ±àдµÄ“Kernel Configuration: dealing with the unexpected£¨Linux Magazine£©µÄÒ»ÎÄÖÐÕÒµ½“Booting your kernel”Ò»½Ú¡£
ÓйØÄںˡ¢Ó³ÏñºÍÒýµ¼¹ý³ÌµÄ¸ü¶àÐÅÏ¢£¬ÇëÔĶÁÖÐÑëÀ¥Ê¿À¼´óѧ£¨Central Queensland Universit ......
ÓÐʱºòÔÚ³ÌÐòÀïÃæÐèÒª´ò¿ª¶à¸öÎļþ£¬½øÐзÖÎö£¬ÏµÍ³Ò»°ãĬÈÏÊýÁ¿ÊÇ1024£¬£¨ÓÃulimit -a¿ÉÒÔ¿´µ½£©¶ÔÓÚÕý³£Ê¹ÓÃÊǹ»ÁË£¬µ«ÊǶÔÓÚ³ÌÐòÀ´½²£¬¾ÍÌ«ÉÙÁË¡£
Ð޸İ취£º
ÖØÆô¾ÍOK
ÐÞ¸Ä2¸öÎļþ¡£
1./etc/security/limits.conf
vi /etc/security/limits.conf
¼ÓÉÏ£º
* soft nofile 8192
* hard nofile 20480
2./etc/pam.d/l ......
1.×¼±¸·ÖÇø
ÓÉÓÚSolarisºÍVista(µÄÒýµ¼¼ÓÔØ)±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ£¬linuxÊÇ¿ÉÒÔ°´ÔÚÀ©Õ¹·ÖÇøÉϵÄ
ËùÒÔÎÒ°Ñ´ÅÅÌ·Ö³É
30GÖ÷·ÖÇø£º°²×°Vista
27GÖ÷·ÖÇø£º±¾À´Òª°²×°FreeBSD(Ò²±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ,µ«ÊÇFreeBSD²»Ö§³ÖÎҵĻú×ÓËùÒÔ·ÅÆú)
135GÀ©Õ¹·ÖÇø£ºÆäÖзֳö40GµÄÂß¼Å̸ ......
ת×Ô:http://www.cublog.cn/u/12592/showart_163722.html
×î½ü¼¸Ìì¸ã wxWidgets£¬ÓÉÓÚҪͬʱ±àÒëÓ¦ÓóÌÐòµÄ Windows °æ±¾£¬ÓÖÀÁµÃÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò£¬ÓÚÊÇÏëµ½Óý»²æ±àÒëµÄ·½Ê½ÔÚ Linux ÉϱàÒëºÃ Windows °æ±¾µÄ³ÌÐò£¬ÔÙÓà Wine »òÕßÐéÄâ»úÀ´Ö´ÐС£ÊÔÁËһϣ¬ÕâÖÖ·½·¨ºÜºÃÓ㬱ÈÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò¿ìºÜ¶à¡£
ÎҵIJÙ×÷ ......