Linux³õʼ»¯ÄÚºËÁÙʱҳ±íÖ®ºóµÄsetup_memoryº¯Êý
»°ËµÔÚlinuxÄں˳õʼ»¯ÍêÄÚºËÁÙʱҳ±íÀ´Ó³ÉäÇ°8MBÄÚ´æºó£¬ÔÚÓûÍûµÄÇýʹÏ£¬linux¿ªÊ¼×ÅÊÖÇÀÕ¼
896MBÒÔϵÄÄÚ´æÁË¡£È»¶øÇÀ¶áÕâ896MBÄÚ´æ¾ø·ÇÒ×Ê¡£linux»¹ÓÐÐí¶àÂé·³µÄÊÂÒª×ö¡£±ÈÈç˵½ø¹¥ºÍÕ¼ÁìÒÁÀ¿ËµÈµÈ¡£ÓÚÊÇ
setup_memoryº¯Êý¿ªÊ¼Îªlinux²ß»®ºÍ³ï±¸´ËÊ¡£Ö÷ÒªÈÎÎñÊǽ¨Á¢Ò»ÕÅÓëÎïÀíÄÚ´æÒ³¿òºÅ¶ÔÓ¦µÄλͼ¡£Èç¹û¸ÃÒ³¿ò±»Õ¼ÓÃÔò¶ÔӦλͼÖеÄλ±»ÖÃ
1£¬·ñÔòÖÃ0¡£ÔÚ»ï°éϵͳ½¨Á¢Ç°¶ÔÄÚ´æ½øÐÐÁÙʱ¹ÜÀí¡£ÔÚ³õʼ»¯ÄÚºË×îÖÕÒ³±íʱalloc_bootmem_low_pagesÄÚ´æ·ÖÅ亯Êý¾ÍÓõ½ÁËÕâ¸öλ
ͼ¡£
ºËÐÄÊý¾Ý½á¹¹£º
typedef struct
bootmem_data
{
unsigned long node_boot_start; /* Æðʼҳ¿òºÅ0 */
unsigned long node_low_pfn; /* Èç¹ûÎïÀíÄÚ´æ´óÓÚ896MB£¬node_low_pfnΪ0x37FFF¡£
Èç¹ûÎïÀíÄÚ´æСÓÚµÈÓÚ896MB,node_low_pfnΪÎïÀíÄÚ´æµÄ×î´óÒ³¿òºÅ¡£*/
void *node_bootmem_map; /* λͼµÄÆðʼµØÖ· */
/* ÏÂÃæÈý¸ö±äÁ¿µÄ×÷ÓÃÓÃÓÚalloc_bootmem_low_pagesº¯Êý */
unsigned long last_offset;
unsigned long last_pos;
unsigned long last_success;
}
bootmem_data_t
;
´´½¨Î»Í¼µÄº¯ÊýÁ÷³Ì£º
start_kernel->setup_arch->setup_memory->init_bootmem
->init_bootmem_core
¡£
linux/arch/i386/kernel/setup.c
ÔÚsetup_memory()ÖÐÖ´ÐÐ
start_pfn = PFN_UP(init_pg_tables_end);
/* start_pfnÊÇÖ¸Ó³Éä8MBËùÓÃÒ³±íÖ®ºóµÚÒ»¸öÒ³¿òºÅ¡£PFN_UPµÄ×÷ÓÃÊǰѵØÖ·°´Ò³µÄ´óС½øÐжÔÆë¡£Ò²¾ÍÊǵØÖ·ÊÇ4kbµÄÕûÊý±¶´óС¡£*/
find_max_pfn();
/* ÕÒµ½ÎïÀíÄÚ´æÖÐ×î´óÒ³¿òºÅ¡£·ÅÈëmax_pfnÖС£*/
max_low_pfn=find_max_low_pfn();
/* Èç¹ûÎïÀíµØַСÓÚµÈÓÚ896MB£¬max_low_pfn=max_pfn¡£´óÓÚ896MBʱ£¬max_low_pfnΪ896MBÄÚ´æ´óСµÄ×î´óÒ³¿òºÅ */
bootmap_size = init_bootmem(start_pfn,max_low_pfn);
½øÈëinit_bootmemÖÐ
unsigned long
__init
init_bootmem
(unsigned long
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Files And Dirs
1. touch ---create a new, empty file
vi filename is also ok
2. mkdir ---make directory
mkdir -p ---to make all directories in the path
3. space in ......
´ó¼ÒÖªµÀLinuxÖд´½¨×Ó½ø³ÌµÄÒ»¸öºÜºÃµÄ·½·¨ÊǺ¯Êýµ÷ÓÃfork,µ«ÊǺܶà³õѧÕ߶ÔforkµÄÀí½âÉÏ¿ÉÄÜÓеãÀ§ÄÑ¡£ÏÂÃæ¾Ù¸öÀý×ÓÀ´¿´¿´forkµÄÓ÷¨°É¡£
Æäʵ£¬´ó¼ÒÓÃforkµÄʱºò¼ÇסforkÊÇ“·Ö²æ”µÄÒâ˼¾ÍºÜºÃÀí½âÁË¡£
  ......