LinuxÄں˼°ARMµÄÄÚ´æ¹ÜÀí
arch\arm\kernel\head.S
¸ÃÎļþĩβ°üº¬ÁËÓï¾ä£º#include "head-common.S"£¬__lookup_processor_typeº¯ÊýÔÚarch\arm\kernel\head-common.SÖж¨Òå¡£
¹Ø¼üÊý¾Ý½á¹¹£ºstruct proc_info_list£¬ÔÚarch\arm\include\asm\procinfo.hÎļþÖж¨Ò壬Cortex¶Ô´ËÊý¾Ý½á¹¹µÄÌî³äÔÚarch\arm\mm\proc-v7.sÎļþÖж¨Òå¡£
head.sÖУ¬kernelµÄ¹Ø¼üÈë¿ÚÈçÏ£º
ENTRY(stext)
ARM( msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE ) @ ensure svc mode
THUMB( mov r9, #PSR_F_BIT | PSR_I_BIT | SVC_MODE )
THUMB( msr cpsr_c, r9 ) @ ensure svc mode
@ and irqs disabled
mrc p15, 0, r9, c0, c0 @ get processor id
bl __lookup_processor_type @ r5=procinfo r9=cpuid
movs r10, r5 @ invalid processor (r5=0)?
beq __error_p @ yes, error 'p'
bl __lookup_machine_type @ r5=machinfo
movs r8, r5 @ invalid machine (r5=0)?
beq __error_a @ yes, error 'a'
bl __vet_atags
bl __create_page_tables
/*
* The following calls CPU specific code in a position independent
* manner. See arch/arm/mm/proc-*.S for details. r10 = base of
* xxx_proc_info structure selected by __lookup_machine_type
* above. On return, the CPU will be ready for the MMU to be
* turned on, and r0 will hold the CPU control register value.
*/
ldr r13, __switch_data @ address to jump to after
@ mmu has been enabled
badr lr, __enable_mmu @ return (PIC) address
ARM( add pc, r10, #PROCINFO_INITFUNC )
THUMB( add r12, r10, #PROCINFO_INITFUNC )
THUMB( mov pc, r12 )
ENDPROC(stext)
Óï¾ä“add pc, r10, #PROCINFO_INITFUNC”ͨ¹ý²é±íµ÷ÓÃproc-v7.sÖÐ__v7_setupº¯Êý£¬¸Ãº¯Êýĩβͨ¹ý½«lr¼Ä´æÆ÷¸³¸øpc£¬µ¼Ö¶Ô__enable_mmuµÄµ÷Óã¬Íê³ÉʹÄÜmmuµÄ²Ù×÷£¬Ö®ºó½«r13¼Ä´æÆ÷Öµ¸³¸øpc£¬µ÷ÓÃ__switch_dataÊý¾Ý½á¹¹ÖеĵÚÒ»¸öº¯Êý__mmap_switched£¬¸Ãº¯ÊýÖ¸Ïò×îºóµÄ³õʼ»¯º¯Êý£¬¶¨ÒåÔÚhead-common.sÎļþÖУ¬¸Ãº¯Êý×îÖÕµ÷ÓÃinit\main.cÎļþÖеÄstart_kernelº¯Êý¡£
Óï¾ä“mrc p15, 0, r9, c0, c0”½«Ð´¦ÀíÆ÷¼Ä´æÆ÷CP15¶ÁÈë¼Ä´æÆ÷r9£¬´Ë¼Ä´æÆ÷±£´æCPUID£»Ö®ºóµ÷Óú¯Êý__lookup_processor_type²éÕÒ
Ïà¹ØÎĵµ£º
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 Ê ......
1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......
¹ØÓÚlinux»·¾³±äÁ¿Îļþ
µÚÒ»ÄÚÈÝ£º
etc/profile:´ËÎļþΪϵͳµÄÿ¸öÓû§ÉèÖû·¾³ÐÅÏ¢,µ±Óû§µÚÒ»´ÎµÇ¼ʱ,¸ÃÎļþ±»Ö´ÐÐ.
²¢´Ó/etc/profile.dĿ¼µÄÅäÖÃÎļþÖÐËѼ¯shellµÄÉèÖÃ.
/etc/bashrc:Ϊÿһ¸öÔËÐÐbash shellµÄÓû§Ö´ÐдËÎļþ.µ±bash shell±»´ò¿ªÊ±,¸ÃÎļþ±»¶ÁÈ¡.
µÚ¶þÄÚÈÝ£º
~/.bash_profile:ÿ¸öÓû§¶¼¿ÉʹÓà ......
1.“/bin”¡¢“/sbin”¡¢“/usr/bin”¡¢“/usr/sbin”¡¢“/usr/local/bin”µÈ·¾¶ÒѾÔÚϵͳ»·¾³±äÁ¿ÖÐÁË£¬Èç¹û¿ÉÖ´ÐÐÎļþ ÔÚÕ⼸¸ö±ê׼λÖã¬ÔÚÖÕ¶ËÃüÁîÐÐÊäÈë¸ÃÈí¼þ¿ÉÖ´ÐÐÎļþµÄÎļþÃûºÍ²ÎÊý£¬»Ø³µ¼´¿É¡£
2.Èç¹û²»ÔÚ±ê׼λÖã¬ÎļþÃûÇ°ÃæÐèÒª¼ÓÉÏÍêÕûµÄ ......