LinuxÖеÄÄÚ´æ¹ÜÀí
Ò».ÔÚLinux²Ù×÷ϵͳµÄÄÚ´æÖй²ÓÐÎå¿é¿Õ¼ä:´úÂë¶Î£¬Êý¾Ý¶Î£¬BBS¶Î£¬¶ÑºÍÕ»
´úÂë¶Î£º´úÂë¶ÎÊÇÓÃÀ´´æ·Å¿ÉÖ´ÐÐÎļþµÄ²Ù×÷Ö¸ÁҲ¾ÍÊÇ˵ÊÇËüÊÇ¿ÉÖ´ÐгÌÐòÔÚÄÚ´æÖֵľµÏñ¡£´úÂë¶ÎÐèÒª·ÀÖ¹ÔÚÔËÐÐʱ±»·Ç·¨Ð޸ģ¬ËùÒÔÖ»×¼Ðí¶ÁÈ¡²Ù×÷£¬¶ø²»ÔÊÐíдÈ루Ð޸ģ©²Ù×÷——ËüÊDz»¿ÉдµÄ¡£
Êý¾Ý¶Î£ºÊý¾Ý¶ÎÓÃÀ´´æ·Å¿ÉÖ´ÐÐÎļþÖÐÒѳõʼ»¯È«¾Ö±äÁ¿£¬»»¾ä»°Ëµ¾ÍÊÇ´æ·Å³ÌÐò¾²Ì¬·ÖÅä[1]µÄ±äÁ¿ºÍÈ«¾Ö±äÁ¿¡£
BSS¶Î[2]£ºBSS¶Î°üº¬Á˳ÌÐòÖÐδ³õʼ»¯È«¾Ö±äÁ¿£¬ÔÚÄÚ´æÖÐ bss¶ÎÈ«²¿ÖÃÁã¡£
¶Ñ£¨heap£©£º¶ÑÊÇÓÃÓÚ´æ·Å½ø³ÌÔËÐÐÖỶ¯Ì¬·ÖÅäµÄÄÚ´æ¶Î£¬Ëü´óС²¢²»¹Ì¶¨£¬¿É¶¯Ì¬À©ÕÅ»òËõ¼õ¡£µ±½ø³Ìµ÷ÓÃmallocµÈº¯Êý·ÖÅäÄÚ´æʱ£¬Ð·ÖÅäµÄÄÚ´æ¾Í±»¶¯Ì¬Ìí¼Óµ½¶ÑÉÏ£¨¶Ñ±»À©ÕÅ£©£»µ±ÀûÓÃfreeµÈº¯ÊýÊÍ·ÅÄÚ´æʱ£¬±»ÊͷŵÄÄÚ´æ´Ó¶ÑÖб»ÌÞ³ý£¨¶Ñ±»Ëõ¼õ£©
Õ»£ºÕ»ÊÇÓû§´æ·Å³ÌÐòÁÙʱ´´½¨µÄ¾Ö²¿±äÁ¿£¬Ò²¾ÍÊÇ˵ÎÒÃǺ¯ÊýÀ¨»¡“{}”Öж¨ÒåµÄ±äÁ¿£¨µ«²»°üÀ¨staticÉùÃ÷µÄ±äÁ¿£¬staticÒâζÕâÔÚÊý¾Ý¶ÎÖдæ·Å±äÁ¿£©¡£³ý´ËÒÔÍâÔÚº¯Êý±»µ÷ÓÃʱ£¬Æä²ÎÊýÒ²»á±»Ñ¹Èë·¢Æðµ÷ÓõĽø³ÌÕ»ÖУ¬²¢ÇÒ´ýµ½µ÷ÓýáÊøºó£¬º¯ÊýµÄ·µ»ØÖµÒ²»Ø±»´æ·Å»ØÕ»ÖС£ÓÉÓÚÕ»µÄÏȽøÏȳöÌص㣬ËùÒÔÕ»Ìر𷽱ãÓÃÀ´±£´æ/»Ö¸´µ÷ÓÃÏÖ³¡¡£´ÓÕâ¸öÒâÒåÉϽ«ÎÒÃÇ¿ÉÒ԰ѶÑÕ»¿´³ÉÒ»¸öÁÙʱÊý¾Ý¼Ä´æ¡¢½»»»µÄÄÚ´æÇø¡£
¶þ. ÏÂÀÏʦ²¼ÖõijÌÐò£º
#include<stdio.h>
#include<malloc.h>
#include<unistd.h> //it contains sbrk() and brk()
int bss_var;
int data_var0 = 0;
int main(int argc,char **argy){
printf("below are addresses of types's menory\n");
printf("Text location:\n");
printf("\tAddress of main(Code Segement):%p\n",main);//fuction name is a pointer
int stack_var0 = 2;
printf("Stack Location:\n");
printf("\tInitial of stack:%p\n",&stack_var0);
int stack_var1 = 3;
printf("\tnew end of stack:%p\n",&stack_var1);
printf("Data Location:\n");
printf("\tAddress of data_var(Data Segement):%p\n",&data_var0);
static int data_var1 = 4;
printf("\tNew address of data_var(Data Segement):%p\n",&data_var1);
printf("BSS Locatin\n");
printf("\tAddress of bss_var:%p\n",&bss_var);
char *b = sbrk((ptrdiff_t)0);
printf("Heap Location :\n");
printf("\tInitial end
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
±ÈÌØÍøתÔØ£ºhttp://datacenter.chinabyte.com/308/11039308.shtml
ÈÕÖ¾¶ÔÓÚ°²È«À´Ëµ£¬·Ç³£ÖØÒª£¬Ëû¼Ç¼ÁËϵͳÿÌì·¢ÉúµÄ¸÷ÖÖ¸÷ÑùµÄÊÂÇ飬Äã¿ÉÒÔͨ¹ýËûÀ´¼ì²é´íÎó·¢ÉúµÄÔÒò£¬»òÕßÊܵ½¹¥»÷ʱ¹¥»÷ÕßÁôϵĺۼ£¡£ÈÕÖ¾Ö÷ÒªµÄ¹¦ÄÜÓУºÉó¼ÆºÍ¼à²â¡£Ëû»¹¿ÉÒÔʵʱµÄ¼à²âÏµÍ³×´Ì ......
typedef struct siginfo
{
int si_signo; /* Signal number.*/
&n ......
²Î¿¼×ÊÁÏ£ºhttp://captain.javaeye.com/blog/104242
1¡¢Ê¹ÓÃAutofs×Ô¶¯¹ÒÔØ·ÖÇø
2¡¢ÐÞ¸Ä/etc/fstab
3¡¢±àдshell½Å±¾£¬¿ª»ú×Ô¶¯ÔËÐÐmountÃüÁî
·½·¨Ò»¡¢Ê¹ÓÃAutofs
1¡¢AutofsµÄÌص㣺AutofsÓëMount/UmountµÄ²»Í¬Ö®´¦ÔÚÓÚ£¬ËüÊÇÒ»ÖÖ¿´ÊسÌÐò£¨deamon£©¡£Èç¹ûËü¼ì²âµ½Óû§ÕýÊÔͼ·ÃÎÊÒ»¸öÉÐδ¹Ò½ÓµÄÎļþϵͳ£¬Ëü¾Í» ......