Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sizeofÃæÊÔÌâÑ¡ Linux C±à³Ìʵս

   ½á¹¹ÌåºÍ¹²ÓÃÌåµÄÄÚ´æ·ÖÅäÊÇCÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇÃæÊÔÌâÖеÄÈȵ㡣
ʾÀý1£º
   Union data1
 {
  double  d;
  int     i;
  char    c1;
  char    c2[9]; 
 };
  sizeof(union data1)µÄֵΪ16.ÔÚ±àÒëÆ÷ĬÈÏÉèÖõÄÇé¿öÏ£¬¸Ã¹²ÓÃÌå×î´ó»ù±¾ÀàÐÍΪdouble,ËüÕ¼8×Ö½Ú£¬ËùÒԴ˹²ÓÃÌåÒÔ8À´¶ÔÆë¡£×Ö·ûÊý×éc2Õ¼9¸ö×Ö½Ú£¬ÄÇôÕû¸ö¹²ÓÃÌåÓ¦¸ÃÕ¼9¸ö×Ö½Ú£¬µ«°´ÕÕ¶ÔÆëÔ­Ôò£¬Êµ¼Ê·ÖÅä¸øËüµÄÄÚ´æΪ16×Ö½Ú¡£
  Èç¹ûÊÇ£º
  struct data1
  {
     double  d;
     int         i;
     char      c1;
     char      c2[9];
   };
 sizeof(struct data1)µÄֵΪ24£¬Ê×ÏÈ°´ÕÕ´æ´¢´óС£¬¸Ã½á¹¹ÌåËùÕ¼´æ´¢¿Õ¼äΪ£º8+4+1+9=22×Ö½Ú£¬Õâ¸ö½á¹¹ÌåÒ²ÊÇÒÔ8¶ÔÆ룬Òò´Ëʵ¼Ê·ÖÅäµÄÊÇ24×Ö½Ú¡£
ʾÀý2£º
   Union data2
 {
  int       i;
  char    c1;
  char    c2[9]; 
 };
   sizeof(union data2)µÄֵΪ12£¬¸Ã¹²ÓÃÌåÕ¼ÄÚ´æ¿Õ¼ä×î´óµÄ»ù±¾Êý¾ÝÀàÐÍΪint,Æ䳤¶ÈΪ4£¬ËùÒԸù²ÓÃÌåÒÔ4À´¶ÔÆë¡£¸Ã¹²ÓÃÌåµÄ³¤¶ÈÈ¡¾öÓÚ×Ö·ûc2£¬Æ䳤¶ÈΪ9£¬9²»ÊÇ4µÄ±¶Êý£¬Òª½øÐжÔÆ룬Òò´Ëʵ¼Ê·ÖÅäµÄ´æ´¢¿Õ¼äΪ12.
  struct data2
  {
     int         i;
     char      c1;
     char      c2[9];
   };
    sizeof(struct data2)µÄֵΪ16£¬ÓëÉÏÃæ¹²ÓÃÌåÒ»Ñù£¬¸Ã½á¹¹ÌåÒÔ4¶ÔÆë¡£°´ÕÕ´æ´¢´óС£¬¸Ã½á¹¹ÌåËùÕ¼´æ´¢¿Õ¼äΪ£º4+1+9=14£¬14²»ÊÇ4µÄ±¶Êý£¬½øÐжÔÆ룬¶ÔÆëºóµÄֵΪ16.
 
ʾÀý3£º
   Union data3
 {
   char    c1;
  char    c2[3]; 
 };
   sizeof(union data3)µÄֵΪ3£¬¸Ã¹


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈЭÒé ......

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

linux zImageÉú³É¹ý³ÌÏê½â


Äں˱àÒëÍê³Éºó»áÉú³ÉzImageÄں˾µÏñÎļþ¡£¹ØÓÚbootloader¼ÓÔØzImageµ½Äںˣ¬²¢ÇÒÌøתµ½zImage¿ªÊ¼µØÖ·ÔËÐÐzImageµÄ¹ý³Ì£¬ÏàÐÅ´ó¼Ò¶¼ºÜÈÝÒ×Àí½â¡£µ«¶ÔÓÚzImageÊÇÈçºÎ½âѹµÄ¹ý³Ì£¬¾Í²»ÊÇÄÇôºÃÀí½âÁË¡£±¾ÎĽ«½áºÏ²¿·Ö¹Ø¼ü´úÂ룬½²½âzImageµÄ½âѹ¹ý³Ì¡£
¡¡¡¡ÏÈ¿´¿´zImageµÄ×é³É°É¡£ÔÚÄں˱àÒëÍê³Éºó»áÔÚarch/arm/boot/ÏÂÉú ......

Linux ÄÚ´æ¹ÜÀí ¸ß¶ËÄÚ´æµÄÓ³É䷽ʽ

½âÊÍÒ»:
¸ß¶ËÄÚ´æÊÇÖ¸ÎïÀíµØÖ·´óÓÚ 896M µÄÄÚ´æ¡£
¶ÔÓÚÕâÑùµÄÄڴ棬ÎÞ·¨ÔÚ“ÄÚºËÖ±½ÓÓ³Éä¿Õ¼ä”½øÐÐÓ³Éä¡£
Ϊʲô£¿
ÒòΪ“ÄÚºËÖ±½ÓÓ³Éä¿Õ¼ä”×î¶àÖ»ÄÜ´Ó 3G µ½ 4G£¬Ö»ÄÜÖ±½ÓÓ³Éä 1G ÎïÀíÄڴ棬¶ÔÓÚ´óÓÚ 1G µÄÎïÀíÄڴ棬ÎÞÄÜΪÁ¦¡£
ʵ¼ÊÉÏ£¬“ÄÚºËÖ±½ÓÓ³Éä¿Õ¼ä”Ò²´ï²»µ½ 1G£¬ »¹µÃÁôµã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ