linuxÄÚ´æ¹ÜÀíÖØÒªµÄÊý¾Ý½á¹¹
ÕâÀïÖ»Áоټ¸¸ö±È½ÏÂé·³µÄÊý¾Ý½á¹¹
struct list_head {
struct list_head *next, *prev;
} //linuxͨÓõÄË«ÏòÁ´¶ÓÁУ¬ÏÂÃæ¶à´¦Óõ½£¬ÕâÀïÁгöÔ´´úÂë
linux¶ÔÄÚ´æÔÙÓÃҳʽ¹ÜÀí£¬¶ÔÓÚÒ³£¬¾ÍÓиöÊý¾Ý½á¹¹page¼ÓÒÔÃèÊö¡£ÔÚÄÚºËÖÐÓиöÈ«¾ÖÁ¿mem-mapÖ¸ÏòµÄÊÇÒ»¸öpageµÄÊý×飬Õû¸öÊý×éÃèÊöÁËÕû¸öÎïÀíÄڴ棬´ó¼Ò×¢Òâ32λµØÖ·Ïߣ¬ÄÚ´æ´óСÊÇ2µÄ32´Î·½¡£ÓÉÓÚÒ³´óСÊÇ4kÒ²¾ÍÊÇ2µÄ12´Î·½¡£Ã¿4KµÄÒ³¾ÍÓÐÒ»¸öpage¡£ÄÇô2µÄ32´Î·½¹²ÓÐ2µÄ20´Î·½¸öÒ³£¬Ôòmem-mapÖ¸ÏòµÄÊý×é´óС¾ÍÊÇ2µÄ20´Î·½¡£ÆäÖÐÃ÷ÏÔ¶ÔÓÚÒ³µÄÎïÀíµØÖ·£¬Ò»¶¨ÊÇ4KµÄ±¶Êý£¬ÒòΪËü´óСÊÇ4K£¬ÄÇôÕâ¸öÊý×é¾ÍÓиö¶ÔÓ¦£¬Êý×éϱêºóÃæ12¸ö0£¨2½øÖÆ£©¶ÔÓ¦ÁËÒ³ÃæµÄÎïÀíµØÖ·£¬ËûÃÇÔÚÊýÖµÉÏÊÇÏàµÈµÄ¡£ÄÇôÎÒÃÇÔÚpageÊý¾Ý½á¹¹ÖоÍûÓбØÒª´æÖüËüµÄÎïÀíµØÖ·¡£pageÊý¾Ý½á¹¹¶¨ÒåλÖÃinclude/linux/mm.h
struct page{
struct list_head list; //ͨ¹ýʹÓÃËü½øÈëÏÂÃæµÄÊý¾Ý½á¹¹free_area_struct½á¹¹ÖеÄË«ÏòÁ´¶ÓÁÐ
struct address_space * mapping; //ÓÃÓÚÄÚ´æ½»»»µÄÊý¾Ý½á¹¹
unsigned long index;//µ±Ò³ÃæµÄÄÚÈÝÀ´×ÔÒ»¸öÎļþʱ£¬index´ú±íןÃÒ³ÃæÔÚÎļþÖеÄÐòºÅ£¬µ±Ò³ÃæµÄÄÚÈݱ»»»³öµ½½»»»É豸ÉÏ¡¢µ«»¹±£Áô×ÅÄÚÈÝ×÷Ϊ»º³åʱ£¬ÔòindexÖ¸Ã÷ÁËÒ³ÃæµÄÈ¥Ïò£¬¸÷λµÄº¬ÒåͬÓÚswp_entry_tÖеÄvalº¬Òå¡£
struct page *next_hash; //×ÔÉíµÄÖ¸Õ룬ÕâÑù¾Í¿ÉÒÔÁ´½Ó³ÉÒ»¸öÁ´±í
atomic t count; //ÓÃÓÚÒ³Ãæ½»»»µÄ¼ÆÊý,ÈôÒ³ÃæΪ¿ÕÏÐÔòΪ0£¬·ÖÅä¾Í¸³Öµ1£¬Ã»½¨Á¢»ò»Ö¸´Ò»´ÎÓ³Éä¾Í¼Ó1£¬¶Ï¿ªÓ³Éä¾Í¼õÒ»
unsigned long flags;//·´Ó¦Ò³Ãæ¸÷ÖÖ״̬£¬ÀýÈç»îÔ¾£¬²»»îÔ¾Ô࣬²»»îÔ¾¸É¾»£¬¿ÕÏÐ
struct list_head lru;
unsigned long age; //±íʾҳÃæÊÙÃü
wait_queue_head_t wait;
struct page ** pprev_hash;
struct buffer_head * buffers;
void * virtual
struct zone_struct * zone; //Ö¸ÏòËùÊôµÄ¹ÜÀíÇø
}
(¶ÔÓÚÿ¸öÏîµÄ˵Ã÷£¬ÎÒ»áÂýÂý²¹ÉÏ£©
¶ÔÄڴ棬½ö½öÓÃpageÊý¾Ý½á¹¹À´ÃèÊö¿Ï¶¨Ô¶Ô¶²»¹»£¬¶ÔÓÚÕû¸öÄڴ棬ÎÒÃÇÔÚ´ËÖ®ÉÏ·ÖÁ˹ÜÀíÇøµÄ¸ÅÄÿ¸ö¹ÜÀíÇø¹ÜÀíÊý¸öÒ³Ãæ¡£Õâ¸öÊý¾Ý½á¹¹ÊÇ zone_struct¶¨ÒåλÖÃÊÇÔÚinclude/linux/mmzone.h
typedef struct free_area_struct {
struct list_head free_list; //linux ÖÐͨÓõÄË«ÏòÁ´¶ÓÁÐ
unsigned int * map;
} free_area_t;
typedef struct zone_struct{
sp
Ïà¹ØÎĵµ£º
°²×°mysql
sudo apt-get install mysql-servel-5.0 mysql-client-5.0
ÏÂÔØ°²×°¹ý³ÌÖУ¬»áÌáʾÊäÈërootÃÜÂë
°²×°CÓïÑÔ±à³Ì½Ó¿Ú£º
sudo apt-get install libmysqlclient15-dev
¸ü¶àapi ²é¿´£ºhttp://dev.mysql.com/doc/refman/5.0/en/c.html
Ïà¹ØmysqlÍ·ÎļþºÍ¿âÎļþ°²×°ÔÚ/usr/include/mysql/ºÍ/usr/lib/mysqlÄ¿ ......
¿ÉÒÔ½«Õâ¸ö½Å±¾·Å½øcrontab£¬ËûµÄÅäÖÆÎļþÔÚ /etc/crontabÖÐÿÌìÁ賿ִÐÐÒ»´Î£¬×Ô¶¯±¸·Ý Õâ¸ö½Å±¾Ã¿Ìì×î¶àÖ»Ö´ÐÐÒ»´Î£¬¶øÇÒÖ»±£Áô×î½üÎåÌìµÄ±¸·ÝÔÚ·þÎñÆ÷ÉÏ¡£
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Powered by aspbiz
#2004-09
#Setting
#ÉèÖÃÊý¾Ý¿âÃû£¬Êý¾Ý¿âµÇ¼Ãû£¬ÃÜÂ룬±¸·Ý·¾¶£¬ÈÕ־ ......
µ±ÔÚ Linux ÏÂºÍ ÐéÄâ»ú ¹²ÏíÎļþʱ£¬ÎÒ·¢ÏÖÒ»¸öÎÊÌ⣬²¢²»ÊÇËùÓеÄÐéÄâ»ú¶¼Ö§³Ö(»òºÜºÃµÄÖ§³Ö)ÔÚÖ÷»úºÍÐéÄâ»ú²Ù×÷ϵͳ֮¼ä¹²ÏíÎļþ£¬ÕâÑùÔÚÐèÒªÎļþ¹²Ïíʱºò¾Í»áÓöµ½ºÜ¶àÎÊÌâ¡£ ²»¹ýÒòΪ¼¸ºõËùÓвÙ×÷ϵͳ¶¼Ö§³Ö¶ÁдÈíÅ̺͹âÅÌ£¬¾Í¿ÉÒÔʹÓÃÒ»ÖֱȽÏÓػصİ취½â¾öÕâ¸öÎÊÌ⣺½¨Á¢ÈíÅÌ»òÕß¹âÅ̾µÏñÎļþ£¬ÐéÄâ»úʹÓöÁдÈí/¹âÇ ......
µÚËIJ¿·Ö һЩ¸üºÃµÄÏë·¨
4.1 »÷°Üϵͳ¹ÜÀíÔ±µÄLKMµÄ·½·¨
ÕâÒ»²¿·Ö»á¸øÎÒÃǶԸ¶Ò»Ð©Ê¹ÓÃLKM±£»¤Äں˵ĶàÒÉ£¨ºÃµÄ£©µÄ¹ÜÀíÔ±µÄ·½·¨¡£ÔÚ½âÊÍÁËËùÓÐϵͳ¹ÜÀíÔ±Äܹ»Ê¹Óõķ½·¨Ö®ºó£¬ºÜÄÑΪÎÒÃÇ£¨hackers£©ÕÒµ½Ò»¸ö¸üºÃµÄ°ì·¨¡£ÎÒÃÇÐèÒªÀ뿪LKMÒ»»á¶ù£¬À´Ñ°ÕÒ»÷°ÜÕâЩÀ§Äѵı£»¤µÄ·½·¨¡£
¼Ù¶¨Ò»¸öϵͳ¿ÉÒÔ±»¹ÜÀíÔ±°²×°ÉÏÒ»¸öÊ ......
¶ÔÓÚÊó±êÇý¶¯ºÍÇ°Ãæ·ÖÎö¹ýµÄ¼üÅÌÇý¶¯¶¼Êǹ²ÓÃinputÄ£ÐÍ,ËùÒÔ,¶ÔÓÚʼþÉϱ¨ºÍ´¦ÀíµÄ·½Ê½¶¼Ã»ÓÐÇø±ð,Ö»ÊÇmouseÊó±êÇý¶¯µ±Éϱ¨Íêdx,dy,left,middle,rightÖ®ºó,ÐèÒªµ÷ÓÃinput_sync(),½«Ç°ÃæÉϱ¨µÄ½ö½öÌî³äÔÚ»º³åÇøÖеÄÊý¾Ý,ͨ¹ýmousedev_notify_readers()·¢Ë͸øopenÁ˵ĹҽÓÔÚmousedev->client_listÁ´±íÉϵȴý»ñÈ¡Êó±êÐÅÏ¢µÄ ......