Linux KernelÇýÖðAndroid£ºµ½µ×·¢ÉúÁËʲô
¹Ø×¢Android£¬¹Ø×¢Google Ç°ÈÕLinux Kernelά»¤ÕßGreg Kroah-Hartman°ÑAndroid´úÂë´ÓLinux Kernel´úÂë¿âÖÐɾ³ýµÄÏûÏ¢ÒýÀ´Á˹㷺¹Ø×¢£¬¿ª·¢½çÒÑÓкܶàÆÀÂÛ¶Ô´ËʽøÐÐÌÖÂÛ¡£ifanr½ñÈÕÌṩÁ˵±ÌìGregÉùÃ÷µÄÈ«ÒëÎÄ£¬ÏÂÃæ¾ÍÈÃÎÒÃÇÀ´¿´¿´¡£ 2.6.33 °æÄÚºËÒƳýÁËAndroidµÄ´úÂë¡£ºÜ¶àÈ˲»¶ÏµØÎÊÎÒ·¢ÉúÁËʲô£¬¶ÔÓÚAndroidÏÂÒ»²½ÒªÔõô°ì¡£ÕâÀïÊÇÎÒ¶ÔÕû¼þÊÂÇéµÄ³ÎÇ壺 Ê×ÏÈ£¬ÎÒºÜϲ»¶Androidƽ̨¡£Ö±µ½ÉÏÖÜ£¬ÎÒ»¹Ã¿ÌìʹÓÃÎҵĿª·¢ÊÖ»úG1¡£Ëü¹¤×÷Á¼ºÃ£¬×÷ΪÓû§ÎÒºÜÂúÒâ¡£ÁíÍ⣬´Ó¼¼Êõ½Ç¶ÈÎÒÒ²ºÜϲ»¶Ëû¡£ÁîÈ˾ªÆæµÄÊÇ£¬Google½ö½öʹÓÃLinuxÄں˹¹½¨ÁËÒ»¸ö¿ÉÒÆÖ²µÄºÍ½¡×³µÄÊÖ»úƽ̨£¬¶ø²¢Ã»ÓÐʹÓá±´«Í³¡±LinuxµÄÈκÎÆäËû¶«Î÷¡£¸ü¼ÓÄÑÄܿɹóµÄÊÇ£¬Äã¿ÉÒÔ ÔÚAndroidϵͳ֮ÉÏ°²×°Ò»¸ö¡±ÕæÕý¡±µÄLinux¾µÏñ£¬Á½Õ߶¼ÄÜÕý³£¹¤×÷¶øÎÞÐèÈκÎÐ޸ġ£ Android Ò²½â¾öÁËÊÖ»úÖÆÔìÉ̶àÄêÀ´Óöµ½µÄÎÊÌ⣺Ëü´´ÔìÁËÒ»¸öÃâ·ÑµÄJavaÐéÄâ»úºÍͳһµÄÓ¦ÓÃÈí¼þ²ã£¬Ê¹³ÌÐò¿ÉÒÔÔÚËùÓм¯³ÉËüµÄÊÖ»úƽ̨ÉÏÔËÐС£ÒòΪËûËüµÄ³öÏÖ£¬ ËùÓÐÏÖ´æµÄ¡±LinuxÊÖ»úлᡱ£¨¡±Linux Phone Consortium¡± £©×éÖ¯¶¼Ðû¸æÖսᣬ»òÕß¼´½«¹Ø±Õ¡£ ³öÁËʲôÎÊÌ⣿ ·¢ÉúÁËʲôÖÂʹAndroidÄں˴úÂ뱻ɾ³ý£¿ ¼òµ¥µÄ˵£¬Ã»ÓÐÈ˹ØÐÄ´úÂ룬ËùÒÔËû±»É¾³ýÁË¡£ÕýÈçÎÒ֮ǰµÄÉùÃ÷£¬¿ª·¢·ÖÖ§µÄ´úÂëÐèÒª¼ÌÐøÐ޸IJÅÄܺϲ¢½øÄÚºËÖ÷ÏßÄÚºËÊ÷£¬·ñÔò½«±»É¾³ý¡£µ«ÊÇ£¬Õâ¶ù»¹ÓиüÑÏÖصÄÎÊÌâ¡£Android´úÂë²»½ö½öÊÇdrivers/staging/androidĿ¼ÏµÄһЩÇý¶¯³ÌÐò¡£ AndroidϵͳµÄÕý³£ÔËÐУ¬ÐèÒªGoogle´´½¨µÄÒ»ÖÖеÄÄÚºËËøºÍÆ䰲ȫģÐÍËøÒÀÀµµÄºËÐÄϵͳÖеĹ³×Ó£¨hooks£©¡£ÒªÐ´³öÄܹ»ÔÚAndroidÉÏÖ´ÐеÄÇý¶¯³ÌÐò£¬ÄãÐèҪǡµ±µÄʹÓÃеÄÄÚºËËø£¬ÓÐʱºò»¹ÐèҪʹÓùÖÒìµÄ°²È«Ä£ÐÍ¡£ ÕâÒâζ×ÅËùÓÐΪAndroidÓ²¼þƽ̨±àдµÄÇý¶¯¶¼²»ÄÜÈںϽøÖ÷ÏßÄÚºËÊ÷£¬ËüÃÇÔÚÖ÷ÏßÄÚºËÖлá±àÒëʧ°Ü¡£ÒòΪËüÃÇÒÀÀµµÄ´úÂëÖ»´æÔÚÓÚGoogleµÄÄں˷ÖÖ§ÖС£ÒòΪÉÏÃæÕâЩ£¬Google×è°ÁË´óÁ¿Ó²¼þÇý¶¯¡¢Æ½Ì¨´úÂëºÍÖ÷ÏßÄÚºËÊ÷µÄÕûºÏ¡£²¢´´½¨ÁËÒ»¸öºÜ¶àÖÆÔìÉÌÏÖÔÚÒÀÀµµÄÄں˷ÖÖ§¡££¨ÒëÕßÆÀÂÛ£ºÐ°¶ñµÄ×ö·¨£¬ÀûÓÿªÔ´µÄ³É¹ûıÀû£¬¶ø²¢Ã»ÓлØÀ¡¿ªÔ´ÉçÇø£© ´´ÔìÄÚºËÔ´´úÂë·ÖÖ§²¢Ã»ÓÐÎÊÌ⣬¼¸ºõÿһ¸ö·¢Ðа涼ÓÐ×Ô¼ºµÄ·ÖÖ§¡£µ«ÊǸüÔãµÄÊÇ£¬Google²»°ÑËûÃǵĴúÂëÕûºÏ½øÖ÷ÏßÄÚºËÊ÷£¬Ê¹±àдÇý¶¯ºÍƽ̨´úÂëµÄ¹«Ë¾ÎÞ·¨»ØÀ¡¿ªÔ´ÉçÇø¡£Äں˿ª·¢ÉçÇøÔçÔÚ¼¸ÄêÇ°¾Í¸æËßÕâЩ¹«Ë¾Ê¹ËûÃǵĴúÂëºÏ²¢½øÖ÷ÏßÄںˣ¬ÒԵõ½×Ô¶¯µÄ°²È«ÐÞ¸´ºÍ×Ô¶¯´¦ÀíAPI±ä¶¯£¬ºÜ¶à¹«Ë¾Ìý´Ó½¨Ò
Ïà¹ØÎĵµ£º
#include
#include
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
void *thread1(void *);
void *thread2(void *);
int i=1;
main(void)
{
pthread_t t_a;
pthread_t t_b;
pthread_create(&t_a,NULL,thread1,(void *)NULL) ......
°æȨÉùÃ÷£ºÔ´´×÷Æ·£¬ÔÊÐíתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ Ôʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£http://blog.csdn.net/Neverland2012
ÎÒÃǾ³£»áÈ¥ÏÂÔرð ......
LinuxÄÚºËÅäÖð취£º
1. make config
ÕâÖÖ°ì·¨»á±éÀúËùÓÐÅäÖÃÏҪÇóÓû§Öð¸öÑ¡ÔñY/N/M
2. make menuconfig
Õâ¸ö°ì·¨ÊÇ»ùÓÚncurse¿â±àÖƵÄͼÐνçÃ湤¾ß¡£³£ÓÃ
3. make xconfig
ÓÃÓÚ»ùÓÚX11µÄͼÐι¤¾ß
4. make gconfig
ÓÃÓÚ»ùÓÚgtk+ͼÐι¤¾ß
5. make defconfig
´´½¨Ò»¸öĬÈϵÄÅäÖã¬Éú³Éµ±Ç°µÄ.config
6. make x ......
/*
* linux/fs/char_dev.c
*
* (C) 1991 Linus Torvalds
*/
#include <errno.h>
#include <sys/types.h> // ¶¨ÒåÁË»ù±¾µÄϵͳÊý¾ÝÀàÐÍ
#include <linux/sched.h>
#include <linux/kernel.h> // º¬ÓÐһЩÄں˳£Óú¯ÊýµÄÔÐζ¨Òå
#include < ......
1£¬ÍøÂçÕûÌåÁ÷Á¿²é¿´
ifconfig -s
cat /proc/net/dev
sar -n DEV/EDEV interval(ʱ¼ä¸ô) count(´ÎÊý)
nload -m [-d interface]
2£¬Ïêϸ²é¿´ÍøÂçÁ÷Á¿£¬±ÈÈç²é¿´Ä³Ò»¸öip/port£¬Ä³Ò»¸öÐÒé
iptraf£¬Îı¾´°¿Ú½çÃæ
ntop£¬webÍøÒ³½çÃæ ......