Linux¼üÅÌÇý¶¯·¶Àý
¼üÅÌÔÚËùÓеÄÇý¶¯Ö®ÖÐ×îΪ¼òµ¥µÄÒ»ÖÖ£¬µ«ËüÈ´°üº¬ÁËÇý¶¯µÄ»ù±¾¿ò¼Ü£¬¶ÔÒÔºó¼ÌÐøÉîÈëѧϰÆäËû¸´ÔÓµÄÇý¶¯´óÓÐñÔÒæ£¬ÒÔϱãΪÄãÖð²½ÆÊÎöÇý¶¯µÄ¿ª·¢¡£²ÉÓõÄÊDzéѯ·½Ê½¡£×ªÔØÇë×¢Ã÷³ö´¦£ºqiangren.blog.edu.cn
Ò».ÄÚºËÄ£¿éµÄ×¢²áºÍ³·Ïú
ÔÚ¼ÓÔØÄ£¿éµÄʱºò£¬Ê×ÏÈÔËÐеÄÊÇÄÚºËÄ£¿éµÄ×¢²áº¯Êý¡£ËüµÄ¹¦ÄܰüÀ¨ÄÚºË×¢²áÉ豸ÒÔ¼°±äÁ¿µÄ³õʼ»¯¡£
static int head,tail;
int _init Keypad_init(void)
{
int result;
result=register_chrdev(KEY_LED_MAJOR,KEY_LED_NAME,&Keypad_fops);
Keypad_clear();
init_waitqueue_head(&queue);
prink("%s %s initialized.\n",KEY_LED_NAME,KEY_LED_VERSION);//²»ÄÜÓÃprinf
return 0;
}
module_init(Keypad_init);//¼ÓÔØÄ£¿é
void _exit Keypad_cleanup(void)
{
del_timer(&timer);
unregister_chrdev(KEY_LED_MAJOR,KEY_LED_NAME);
prink("Keypad driver removed \n");
}
module_exit(Keypad_cleanup);//Ð¶ÔØ¸ÃÄ£¿é
¶þ.ÐéÄâÎļþϵͳÓëÓ²¼þÇý¶¯µÄ½Ó¿Ú
static struct file_operations Keypad_fops={
open:Keypad_open,
read:Keypad_read,
poll:Keypad_poll,
fasync:Keypad_fasync,
release:Keypad_release,
};
¸Ã½Ó¿Ú¶¨ÒåÍêÖ®ºóһЩ±ãÊǶÔÕ⼸¸ö¾ßÌ庯ÊýµÄʵÏÖÁË£¡ÏÖÔÚÎÒÃÇÒ»Æð½øÈëÏÂÒ»²½°É£¬ÊDz»ÊǾõµÃÆäʵûʲôÄѶȵÄÄØ£¿±ðÄÇôÔ翪ÐÄ×ÅÄØ£¿Õ⼸¸öº¯ÊýµÄʵÏÖʱºò£¬Éæ¼°µ½ºÜ¶à¼¼Êõ£¬°üÀ¨Äں˶¨Ê±Æ÷£¬*µÈ´ý¶ÓÁеľßÌåʵÏÖ£¨×èÈû·½Ê½£©£¬Òì²½·½Ê½µÄ¾ßÌåʵÏÖ¼¼ÇÉ£¬Ñ»·¶ÓÁС£¿´µ½Õâô¶à¼¼ÊõÄãÊÇ·ñ¸Ðµ½ºÜÐË·ÜÄØ£¿ÒÔϱ¾È˽«ÒÔͨË׵ķ½Ê½ÎªÄã½²½â£¬Ï£ÍûÄãÄÜÀí½â¡£
Èý.É豸µÄ´ò¿ª²Ù×÷½Ó¿Úº¯Êý¾ßÌåʵÏÖ£¨Keypad_open)
É豸´ò¿ªÒ»°ã°üÀ¨Á½´ó²Ù×÷£¬Ò»ÊÇÍê³ÉÉ豸µÄ³õʼ»¯£¬¶þÊÇÉ豸ÒýÓüÆÊýÆ÷¼Ó1
static int Keypad_open(struct inode *inode,struct file *filp)
{
read_xy();
try_module_get(THIS_MODULE);//´Ëº¯ÊýΪLinux 2.6ÄÚºËÔö¼ÓµÄ£¬²»Í¬ÓÚ2.4Äںˣ¬¹¦ÄÜÊǼÆÊýÆ÷µÄÖµ¼Ó1
return 0;
}
static void read_xy(void)
{
&nbs
Ïà¹ØÎĵµ£º
µÝ¹é²éÕÒÎļþÄÚÈÝ£º
grep -n -ri "slewing" ./
ÔÚµ±Ç°Ä¿Ïµݹé²éÕÒËùÓеÄÎļþ
-i, --ignore-case
Ignore case distinctions  ......
¼¶±ð£º ³õ¼¶
·®Ææ (fanqi@cn.ibm.com), Xseries eServer ¹¤³Ìʦ, IBM TSS China Beijing
2004 Äê 11 ÔÂ 01 ÈÕ
Linux I/O ÖØ¶¨ÏòËäÈ»ºÜ¼òµ¥£¬µ«Ôڽű¾±àд¡¢ÏµÍ³¹ÜÀíʱȴҪ³£³£´ò½»µÀ£¬¸ãÇåÆäÖÐʹÓü¼Çɷdz£ÓÐÓá£
Ê×ÏÈ˵һÏÂʲôÊÇI/OÖØ¶¨Ïò£¬ËùνI/OÖØ¶¨Ïò¼òµ¥À´Ëµ¾ÍÊÇÒ»¸ö¹ý³Ì£¬Õâ¸ö¹ý³Ì²¶×½Ò»¸öÎļþ£¬»òÕßÃüÁ³ÌÐò ......
ÔÌû£ºhttp://www.cnscn.org/read.php?tid-44684.html
iptablesÓÐÈýÖÖÁ´
1£ºINPUT (½øÀ´µÄÁ´)
2£ºOUTPUT(³öÈ¥µÄÁ´)
3£ºFORWARD(ת·¢µÄÁ´)
iptables -A INPUT -p icmp -j DROP
-A(Ìí¼ÓÒ»¸öÁ´) -p ÐÒé -j(Ìí¼Ó¶¯×÷) ˵Ã÷Ìí¼ÓÒ»¸ö½øÀ´µÄÁ´¡£ÐÒéÊÇicmp¶¯×÷¾Ü¾ø¡£
iptables -L -n (ÓÃÊ÷ÐνṹÀ´¿´Ò»ÏÂiptablesµÄÉèÖÃ)
......
http://hi.baidu.com/j_fo/blog/item/55f4014f1a226937aec3ab01.html
Linux Kernel Thread µÄÌÖÂÛ
2007-05-14 11:45
kernel thread
Gearheads Written by Sreekrishnan Venkateswaran
Thursday, 15 September 2005
Threads are programming abstractions used in concurrent processing. A ke ......
1¡¢¼ì²â
°²×°Ö®Ç°Ïȼì²âÊÇ·ñÕâЩÈí¼þ°üÒѰ²×°£¬·½·¨ÈçÏ£º[root@localhost
root]#rpm -q telnet»ò[root@localhost root]#rpm -q telnet-client
[root@localhost root]#rpm -q
telnet-server
Èç¹ûûÓмì²âµ½Èí¼þ°ü£¬ÐèÒª½øÐа²×°£¬¾Ý˵red hat Linux
9ĬÈÏÒѰ²×°ÁËtelnetÈí¼þ°ü£¬²»ÖªµÀΪʲôÎÒµÄûÓУ¬»¹ºÃû¹ØÏµ£ ......