nucleus plus代码学习
来源:互联网 发布:网络教育专科报名 编辑:程序博客网 时间:2024/05/22 03:28
int.S:
初始化组件由三个部分组成,硬件在reset后首先进入INT_initialize(),进行板级的相关初始化,首先设置SVC mode,关中断,然后将内核从rom中拷贝至ram中,建立bss段,依次建立sys stack, irq stack和fiq stack,最后初始化timer,建立timer HISR的栈空间,看了一下2410平台的代码,一个tick大概是15.8ms,完成板级的初始化后就进入了INC_initialize。
inc.c:
到这里找不到函数了。。。
csc.c:包含nucleus plus系统中使用的连接表处理工具,采用双向循环链表(doubley-linked circulat lists)
dmc.c:包含动态内存管理组件的核心事务
dmce.c:包含动态内存管理组件中的函数错误检查例程,可以关闭?
dmd.c:包含动态内存管理组件中的全局数据结构
dmf.c:包含获取管理动态内存管理组件的事实的例程
dmi.c:包含动态内存管理组件的初始化例程
dms.c:包含动态内存管理组件的补充例程
erc.c:包含错误管理组件的核心事务
erd.c:包含错误管理组件的官居数据结构
eri.c:包含错误管理组件初始化例程
evc.c:包含事件组管理组件核心事务
evce.c:包含事件组错误检查
evd.c:事件组全局数据结构
evf.c
evi.c
hic.c:包含历史管理组件的核心事务
hid.c
hii.c
inc.c
int.s
ioc.c:I/O驱动管理核心事务
ioce.c
iod.c
iof.c
ioi.c
lic.c:license informations组件核心事务
lid.c
mbc.c:邮箱管理组件核心事务
mbce.c
mbd.c
mbf.c
mbi.c
mbs.c
mbse.c
pic.c:管道管理核心事务
pice.c
pid.c
pif.c
pii.c
pis.c
pise.c
pmc.c:内存管理划分(partition)核心事务
pmce.c
pmd.c
pmf.c
pmi.c
quc.c:队列管理核心事务
quce.c
qud.c
quf.c
qui.c
qus.c
quse.c
rlc.c:版本信息(Release Information)核心事务
rld.c
sdc.c:包含串行驱动特定功能
smc.c:信号量管理核心事务
smce.c
smd.c
smd.c
smf.c
smi.c
sms.c
smse.c
tcc.c:进程控制
tcce.c
tcd.c
tcf.c
tci.c
tcs.c
tcse.c
tct.s
tmc.c:此函数负责提供初始化的任务定时器,此程序必须在svc/usr模式下内核切换成svc模式运行。
tmd.c
tmf.c
tmi.c
tms.c
tmse.c
tmt.s
文件命名前2个字母是组件的缩写,后面的字母是不同的文件。
d包含了相关全局变量,i是初始化部分,f是组件管理的对象的信息,c是核心函数,ce是错误处理,se是补充。
- ;************************************************************************
- ;*
- ;* FUNCTION
- ;*
- ;* INT_Initialize
- ;*
- ;* DESCRIPTION
- ;*
- ;* This function sets up the global system stack variable and
- ;* transfers control to the target independent initialization
- ;* function INC_Initialize. Responsibilities of this function
- ;* include the following:
- ;*
- ;* - Setup necessary processor/system control registers
- ;* - Initialize the vector table
- ;* - Setup the system stack pointers
- ;* - Setup the timer interrupt
- ;* - Calculate the timer HISR stack and priority
- ;* - Calculate the first available memory address
- ;* - Transfer control to INC_Initialize to initialize all of
- ;* the system components.
- ;*
- ;* Major Revision:
- ;*
- ;* M. Kyle Craig, Accelerated Technology, Inc.
- ;*
- ;*
- ;*
- ;*
- ;* CALLED BY
- ;*
- ;* Nothing. This function is the ENTRY point for Nucleus PLUS.
- ;*
- ;* CALLS
- ;*
- ;* INC_Initialize Common initialization
- ;*
- ;* INPUTS
- ;*
- ;* None
- ;*
- ;* OUTPUTS
- ;*
- ;* None
- ;*
- ;* HISTORY
- ;*
- ;* NAME DATE REMARKS
- ;*
- ;* W. Lamie 08-27-1994 Created initial version 1.0
- ;* D. Lamie 08-27-1994 Verified version 1.0
- ;*
- ;************************************************************************
- ;VOID INT_Initialize(void)
- ;{
- .def _c_int00
- _c_int00
- .def _INT_Initialize
- _INT_Initialize:
- ; Insure that the processor is in supervisor mode. //设置了arm的svc模式
- MRS r0,CPSR ; Pickup current CPSR
- BIC r0,r0,#MODE_MASK ; Clear the mode bits
- ORR r0,r0,#SUP_MODE ; Set the supervisor mode bits
- ORR r0,r0,#LOCKOUT ; Insure IRQ/FIQ interrupts are //关闭中断
- ; locked out
- MSR CPSR,r0 ; Setup the new CPSR
- ; Clear the un-initialized global and static C data areas.
- LDR r0,BSS_Start ; Pickup the start of the BSS area
- MOV r2,#0 ; Clear value in r2
- LDR r1,BSS_End ; Pickup the end of the BSS area
- INT_BSS_Clear_Loop
- STR r2,[r0],#4 ; Clear a word //初始化Bss段
- INT_BSS_Clear_Check
- CMP r0,r1 ; Are the start and end equal?
- BNE INT_BSS_Clear_Loop ; If so, continue with BSS clear
- ; Perform auto-initialization. if cinit is -1, then there is none.
- LDR r0, c_cinit
- CMN r0, #1
- BLNE _auto_init
- ; Turn-on the I-Cache for the TI 925T Processor //开启I-Cache
- MRC p15,#0,r1,C1,C0,#0 ; Read the control register.
- ORR r1,r1,#0x1000 ; Set the I bit to enable Instruction Cache
- NOP
- MCR p15,#0,r1,C1,C0,#0 ; Write the control register.
- ; Setup the vectors loaded flag to indicate to other routines in the
- ; system whether or not all of the default vectors have been loaded.
- ; If INT_Loaded_Flag is 1, all of the default vectors have been loaded.
- ; Otherwise, if INT_Loaded_Flag is 0, registering an LISR cause the
- ; default vector to be loaded. In the ARM60 this variable is always
- ; set to 1. All vectors must be setup by this function.
- ; INT_Loaded_Flag = 0;
- MOV r0,#1 ; All vectors are assumed loaded
- LDR r1,Loaded_Flag ; Build address of loaded flag
- STR r0,[r1,#0] ; Initialize loaded flag
- ; Initialize the system stack pointers. This is done after the BSS is
- ; clear because the TCD_System_Stack pointer is a BSS It is
- ; assumed that available memory starts immediately after the end of the
- ; BSS section. //建立sys stack
- LDR r10,System_Stk_Limit ; Pickup the system stack limit (bottom of system stack)
- LDR r3,System_Limit ; Pickup sys stack limit addr
- STR r10,[r3, #0] ; Save stack limit
- LDR sp,System_Stack_SP ; Set-up the system stack pointer
- LDR r3,System_Stack ; Pickup system stack address
- STR sp,[r3, #0] ; Save stack pointer
- MRS r0,CPSR ; Pickup current CPSR
- BIC r0,r0,#MODE_MASK ; Clear the mode bits
- ORR r0,r0,#IRQ_MODE ; Set the IRQ mode bits
- MSR CPSR,r0 ; Move to IRQ mode
- LDR sp,IRQ_Stack_SP ; Setup IRQ stack pointer
- MRS r0,CPSR ; Pickup current CPSR
- BIC r0,r0,#MODE_MASK ; Clear the mode bits
- ORR r0,r0,#FIQ_MODE ; Set the FIQ mode bits
- MSR CPSR,r0 ; Move to the FIQ mode
- LDR sp,FIQ_Stack_SP ; Setup FIQ stack pointer
- MRS r0,CPSR ; Pickup current CPSR
- BIC r0,r0,#MODE_MASK ; Clear mode bits
- ORR r0,r0,#SUP_MODE ; Set the supervisor mode bits
- MSR CPSR,r0 ; All interrupt stacks are setup,
- ; return to supervisor mode
- ; Define the global data structures that need to be initialized by this //设置中断
- ; routine. These structures are used to define the system timer
- ; management HISR.
- ; TMD_HISR_Stack_Ptr = (VOID *) r2;
- ; TMD_HISR_Stack_Size = TIMER_SIZE;
- ; TMD_HISR_Priority = TIMER_PRIORITY;
- LDR r2,HISR_Stack_Mem ; Get HISR stack memory address
- LDR r3,HISR_Stack_Ptr ; Pickup variable's address
- STR r2,[r3, #0] ; Setup timer HISR stack pointer
- MOV r1,#HISR_STACK_SIZE ; Pickup the timer HISR stack size
- LDR r3,HISR_Stack_Size ; Pickup variable's address
- STR r1,[r3, #0] ; Setup timer HISR stack size
- MOV r1,#HISR_PRIORITY ; Pickup timer HISR priority (0-2)
- LDR r3,HISR_Priority ; Pickup variable's address
- STR r1,[r3, #0] ; Setup timer HISR priority
- ; Make a call to begin all board specific initialization. //初始化时钟
- ; Begin with Initializing the Vector table and replacing
- ; default interrupts with Plus IRQs. Then setup the timer
- ; and begin the system clock.
- .if $$isdefed("NU_ROM_SUPPORT")
- BL _INT_Timer_Initialize ; Initialize the timer
- .else
- BL INT_Install_Vector_Table ; Install the vector table
- BL _INT_Timer_Initialize ; Initialize the timer
- .endif
- ; Call INC_Initialize with a pointer to the first available memory
- ; address after the compiler's global data. This memory may be used
- ; by the application.
- ; INC_Initialize(first_available_memory);
- LDR r0,First_Avail_Mem ; Get address of first available memory
-
- B _INC_Initialize ; to high-level initialization //最后跳转到_INC_Initialize,找不到函数在哪
- ;}
- 。。。。。。
- 。。。。。。
inc.c:
- /*************************************************************************/
- /* */
- /* Copyright Mentor Graphics Corporation 2002 */
- /* All Rights Reserved. */
- /* */
- /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */
- /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */
- /* SUBJECT TO LICENSE TERMS. */
- /* */
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* FILE NAME VERSION */
- /* */
- /* inc.c Nucleus PLUS 1.14 */
- /* */
- /* COMPONENT */
- /* */
- /* IN - Initialization */
- /* */
- /* DESCRIPTION */
- /* */
- /* This file contains initialization and setup routines associated */
- /* with the initialization component. */
- /* */
- /* DATA STRUCTURES */
- /* */
- /* None */
- /* */
- /* FUNCTIONS */
- /* */
- /* INC_Initialize Common system initialization */
- /* */
- /* DEPENDENCIES */
- /* */
- /* in_extr.h Initialization functions */
- /* er_extr.h Error handling function */
- /* hi_extr.h History functions */
- /* tc_extr.h Thread Control functions */
- /* mb_extr.h Mailbox functions */
- /* qu_extr.h Queue functions */
- /* pi_extr.h Pipe functions */
- /* sm_extr.h Semaphore functions */
- /* ev_extr.h Event group functions */
- /* pm_extr.h Partition memory functions */
- /* dm_extr.h Dynamic memory functions */
- /* tm_extr.h Timer functions */
- /* io_extr.h I/O Driver functions */
- /* */
- /* HISTORY */
- /* */
- /* DATE REMARKS */
- /* */
- /* 03-01-1993 Created initial version 1.0 */
- /* 04-19-1993 Verified version 1.0 */
- /* 03-01-1994 Replaced void with VOID, */
- /* resulting in version 1.1 */
- /* */
- /* 03-18-1994 Verified version 1.1 */
- /* 04-17-1996 updated to version 1.2 */
- /* 03-20-1998 Moved the INC_Initialize_State */
- /* define values into their own */
- /* in_defs.h include file as part */
- /* of SPR455. This creates */
- /* version 1.2a. */
- /* 03-24-1998 Released version 1.3. */
- /* 03-26-1999 Released 1.11m (new release */
- /* numbering scheme) */
- /* 04-17-2002 Released version 1.13m */
- /* 11-07-2002 Released version 1.14 */
- /*************************************************************************/
- #define NU_SOURCE_FILE
- #include "in_defs.h" /* Initialization defines */
- #include "in_extr.h" /* Initialization functions */
- #include "hi_extr.h" /* History functions */
- #include "er_extr.h" /* Error handling function */
- #include "tc_extr.h" /* Thread Control functions */
- #include "mb_extr.h" /* Mailbox functions */
- #include "qu_extr.h" /* Queue functions */
- #include "pi_extr.h" /* Pipe functions */
- #include "sm_extr.h" /* Semaphore functions */
- #include "ev_extr.h" /* Event group functions */
- #include "pm_extr.h" /* Partition memory functions*/
- #include "dm_extr.h" /* Dynamic memory functions */
- #include "tm_extr.h" /* Timer functions */
- #include "io_extr.h" /* I/O Driver functions */
- /* Define global variable that contains the state of initialization. This
- flag is for information use only. */
- INT INC_Initialize_State;
- /* Define external functions that access the release and license
- information. */
- CHAR *RLC_Release_Information(VOID);
- CHAR *LIC_License_Information(VOID);
- #if defined(NU_MODULE_SUPPORT) && (NU_MODULE_SUPPORT > 0)
- /* Prototypes for Module Initialization funcitons */
- STATUS MRC_Initialize(VOID);
- STATUS MSC_Initialize(VOID);
- #endif
- /*************************************************************************/
- /* */
- /* FUNCTION */
- /* */
- /* INC_Initialize */
- /* */
- /* DESCRIPTION */
- /* */
- /* This function is the main initialization function of the system. */
- /* All components are initialized by this function. After system */
- /* initialization is complete, the Application_Initialize routine */
- /* is called. After all initialization is complete, this function */
- /* calls TCT_Schedule to start scheduling tasks. */
- /* */
- /* CALLED BY */
- /* */
- /* INT_Initialize Target dependent initialize */
- /* */
- /* CALLS */
- /* */
- /* Application_Initialize Application initialize */
- /* RLC_Release_Information Release information */
- /* LIC_License_Information License information */
- /* ERI_Initialize Error handling initialize */
- /* HII_Initialize History initialization */
- /* TCI_Initialize Thread control initialize */
- /* MBI_Initialize Mailbox initialize */
- /* QUI_Initialize Queue initialize */
- /* PII_Initialize Pipe initialize */
- /* SMI_Initialize Semaphore initialize */
- /* EVI_Initialize Event flag initialize */
- /* PMI_Initialize Partition memory initialize */
- /* DMI_Initialize Dynamic memory initialize */
- /* TMI_Initialize Timer initialize */
- /* IOI_Initialize I/O Driver initialize */
- /* MRC_Initialize Memory Region initialize */
- /* MSC_Initialize Module Support initialize */
- /* TCT_Schedule Thread scheduling loop */
- /* */
- /* INPUTS */
- /* */
- /* first_available_memory Pointer to available memory */
- /* */
- /* OUTPUTS */
- /* */
- /* None */
- /* */
- /* HISTORY */
- /* */
- /* DATE REMARKS */
- /* */
- /* 03-01-1993 Created initial version 1.0 */
- /* 04-19-1993 Verified version 1.0 */
- /* */
- /*************************************************************************/
- VOID INC_Initialize(VOID *first_available_memory)
- {
- /* Indicate that initialization is starting. */
- INC_Initialize_State = INC_START_INITIALIZE;
- /* Call release information function. */
- RLC_Release_Information();
- /* Call license information function. */
- LIC_License_Information();
- /* Initialize the Error handling (ER) component. */
- ERI_Initialize();
- /* Initialize the History (HI) component. */
- HII_Initialize();
- #if defined(NU_MODULE_SUPPORT) && (NU_MODULE_SUPPORT > 0)
- MRC_Initialize(); /* Initialize Memory Region component */
- MSC_Initialize(); /* Initialize Module Support component */
- #endif
- /* Initialize the Thread Control (TC) component. */
- TCI_Initialize();
- /* Initialize the Mailbox (MB) component. */
- MBI_Initialize();
- /* Initialize the Queue (QU) component. */
- QUI_Initialize();
- /* Initialize the Pipe (PI) component. */
- PII_Initialize();
- /* Initialize the Semaphore (SM) component. */
- SMI_Initialize();
- /* Initialize the Event Group (EV) component. */
- EVI_Initialize();
- /* Initialize the Partition memory (PM) component. */
- PMI_Initialize();
- /* Initialize the Dynamic memory (DM) component. */
- DMI_Initialize();
- /* Initialize the Timer (TM) component. */
- TMI_Initialize();
- /* Initialize the I/O Driver (IO) component. */
- IOI_Initialize();
- /* Invoke the application-supplied initialization function. */
- Application_Initialize(first_available_memory); //应用程序初始化
- /* Indicate that initialization is finished. */
- INC_Initialize_State = INC_END_INITIALIZE;
- /* Start scheduling threads of execution. */
- TCT_Schedule();
- }
csc.c:包含nucleus plus系统中使用的连接表处理工具,采用双向循环链表(doubley-linked circulat lists)
dmc.c:包含动态内存管理组件的核心事务
dmce.c:包含动态内存管理组件中的函数错误检查例程,可以关闭?
dmd.c:包含动态内存管理组件中的全局数据结构
dmf.c:包含获取管理动态内存管理组件的事实的例程
dmi.c:包含动态内存管理组件的初始化例程
dms.c:包含动态内存管理组件的补充例程
erc.c:包含错误管理组件的核心事务
erd.c:包含错误管理组件的官居数据结构
eri.c:包含错误管理组件初始化例程
evc.c:包含事件组管理组件核心事务
evce.c:包含事件组错误检查
evd.c:事件组全局数据结构
evf.c
evi.c
hic.c:包含历史管理组件的核心事务
hid.c
hii.c
inc.c
int.s
ioc.c:I/O驱动管理核心事务
ioce.c
iod.c
iof.c
ioi.c
lic.c:license informations组件核心事务
lid.c
mbc.c:邮箱管理组件核心事务
mbce.c
mbd.c
mbf.c
mbi.c
mbs.c
mbse.c
pic.c:管道管理核心事务
pice.c
pid.c
pif.c
pii.c
pis.c
pise.c
pmc.c:内存管理划分(partition)核心事务
pmce.c
pmd.c
pmf.c
pmi.c
quc.c:队列管理核心事务
quce.c
qud.c
quf.c
qui.c
qus.c
quse.c
rlc.c:版本信息(Release Information)核心事务
rld.c
sdc.c:包含串行驱动特定功能
smc.c:信号量管理核心事务
smce.c
smd.c
smd.c
smf.c
smi.c
sms.c
smse.c
tcc.c:进程控制
tcce.c
tcd.c
tcf.c
tci.c
tcs.c
tcse.c
tct.s
tmc.c:此函数负责提供初始化的任务定时器,此程序必须在svc/usr模式下内核切换成svc模式运行。
tmd.c
tmf.c
tmi.c
tms.c
tmse.c
tmt.s
文件命名前2个字母是组件的缩写,后面的字母是不同的文件。
d包含了相关全局变量,i是初始化部分,f是组件管理的对象的信息,c是核心函数,ce是错误处理,se是补充。
0
上一篇:sed编辑器基础
下一篇:nucleus学习
相关热门文章
- SHTML是什么_SSI有什么用...
- 查看linux中某个端口(port)...
- 卡尔曼滤波的原理说明...
- shell中字符串操作
- 关于java中的“错误:找不到或...
给主人留下些什么吧!~~
评论热议
阅读全文
0 0
- nucleus plus代码学习
- nucleus plus学习总结
- nucleus plus(Hisr,lisr学习)
- nucleus plus学习总结(后续)
- Nucleus PLUS
- Nucleus PLUS介绍
- Nucleus PLUS任务调度
- Nucleus PLUS简介
- Nucleus PLUS任务调度
- Nucleus学习
- nucleus学习
- Nucleus PLUS应用系统示例
- Nucleus PLUS应用系统示例
- nucleus 学习 中断
- Nucleus PLUS嵌入式操作系统的简单介绍
- Nucleus Plus在嵌入式系统应用
- Nucleus Plus内核技术(转载)
- Nucleus Plus在嵌入式系统应用
- IDEA Tomcat Debug启动非常慢
- 初识sed和gwak
- 信号和槽函数的基础实现
- 最常用的1000个Java类(附代码示例)
- sed编辑器基础
- nucleus plus代码学习
- nucleus学习
- nucleus plus学习总结
- nucleus 学习 中断
- 解决html表格字体
- nucleus plus学习总结(后续)
- 光衰代码整理学习
- 5-32 哥尼斯堡的“七桥问题”(并查集+度的判断)
- C# 串口总结
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
顾漫作品集
顾漫新书
何以顾漫
顾漫文集
明晓溪 顾漫
顾漫照片
顾漫大学
顾漫的qq
顾漫的作品
顾漫论坛
顾漫 学校
顾漫 下载
顾漫明晓溪
顾漫 大学
顾漫结婚
类似顾漫
顾漫双宜
顾漫 小白
双宜 顾漫
何以 顾漫
顾漫 语录
顾漫何以
微微顾漫
顾漫 完结
顾漫相片
顾漫新作
双宜顾漫
顾漫的书
深爱 顾漫
顾漫美人
顾漫 番外
顾漫短篇
作者顾漫
顾漫新文
顾漫吧
顾漫qq
顾漫txt下载
顾漫名字
骄阳似我顾漫
顾漫骄阳似我下册全文
顾漫骄阳似我全文